From 9dffe2f6e94c7138f8867a743087daeb6634e1a6 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Thu, 26 Aug 2021 21:09:53 -0400 Subject: [PATCH] solution: support new method eth_feeHistory --- docs/04-upstream-config.adoc | 8 ++++---- .../dshackle/upstream/calls/DefaultEthereumMethods.kt | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/04-upstream-config.adoc b/docs/04-upstream-config.adoc index a7c7f295..6bb82cee 100644 --- a/docs/04-upstream-config.adoc +++ b/docs/04-upstream-config.adoc @@ -179,7 +179,7 @@ Dshackle currently supports - `eth_getTransactionByBlockNumberAndIndex` - `eth_getTransactionReceipt` - `eth_getUncleByBlockNumberAndIndex` - +- `eth_feeHistory` .Plus following methods are answered directly by Dshackle - `net_version` @@ -193,7 +193,7 @@ Dshackle currently supports - `eth_hashrate` - `eth_accounts` -It's possible to enable additional methods that are available on upstream, or disable an existing method. For that purpose +It's possible to enable additional methods that are available on upstream, or disable an existing method.For that purpose there is `methods` configuration: [source, yaml] @@ -211,10 +211,10 @@ upstreams: ---- Such configuration option allows to execute method `trace_transaction` and also disables `eth_getBlockByNumber` on that -particular upstream. If a client requests to execute method `trace_transaction` then it will be scheduled to that upstream (or +particular upstream.If a client requests to execute method `trace_transaction` then it will be scheduled to that upstream (or any upstream with such method enabled). -NOTE: It's especially useful when used together with upstream labels. If an archive upstream has label `archive: true` it's +NOTE: It's especially useful when used together with upstream labels.If an archive upstream has label `archive: true` it's possible to specify that the client wants to execute method `trace_transaction` only on an archive node(s), which has complete historical data for tracing. diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt index cc88d4d2..bf0f735f 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -61,7 +61,8 @@ class DefaultEthereumMethods( "eth_getBlockByNumber", "eth_getTransactionByBlockNumberAndIndex", "eth_getTransactionReceipt", - "eth_getUncleByBlockNumberAndIndex" + "eth_getUncleByBlockNumberAndIndex", + "eth_feeHistory" ) private val allowedMethods = anyResponseMethods + firstValueMethods + specialMethods + headVerifiedMethods