emeraldpay / dshackle

Fault Tolerant Load Balancer for Ethereum and Bitcoin APIs
Apache License 2.0
312 stars 56 forks source link

IllegalStateException: No executor delegate for eth_getLogs #66

Open E1458 opened 3 years ago

E1458 commented 3 years ago

Tried dshackle for a load balancer in several ETH2.0 clients (Lighthouse, Teku, Nimbus) and got this error: "_IllegalStateException: No executor delegate for ethgetLogs". The host was Ubuntu 20.04.1. In spite of the error, it seems like working but the long java error message in the log (journalctl) is really annoying. I am attaching the yaml conf file and full log below.

Beside the error, it generates too many unnecessary requests and consumes up the free tier allowance of Infura and Alchemy. It would be great if there was an option for "minimal requests". I appreciate this project and it has a very good potential for the load balancer of ETH2.0 clients since this is the only one available at the moment. Thank you.

DshackleYaml.txt DshackleErrorLog.txt

MysticRyuujin commented 3 years ago

If you take a look at the docs here: https://github.com/emeraldpay/dshackle/blob/master/docs/04-upstream-config.adoc

You'll see this section:

By default an ethereum upstream allows calls to the following JSON RPC methods:

eth_getLogs is not listed

You'll need to add it to the methods enabled list, something like this:

    - id: infura-goerli
      chain: goerli
      options:
        disable-validation: true
      methods:
        enabled:
          - name: eth_getLogs
      connection:
        ethereum:
          rpc:
            url: "https://goerli.infura.io/v3/****"

I don't know all the methods required to support the ETH2 nodes but you can just expose them all (tediously), if you're only dealing with a local node.

Or go grab the list of all supported methods from Infura here: https://infura.io/docs/ethereum/json-rpc

E1458 commented 3 years ago

Thank you very much, Sir. That worked.

-------- Original message -------- From: Chase Wright notifications@github.com Date: 2020-11-18 11:53 a.m. (GMT-08:00) To: emeraldpay/dshackle dshackle@noreply.github.com Cc: E1458 fudata@hotmail.com, Author author@noreply.github.com Subject: Re: [emeraldpay/dshackle] IllegalStateException: No executor delegate for eth_getLogs (#66)

If you take a look at the docs here: https://github.com/emeraldpay/dshackle/blob/master/docs/04-upstream-config.adoc

You'll see this section:

By default an ethereum upstream allows calls to the following JSON RPC methods:

eth_getLogs is not listed

You'll need to add it to the methods enabled list, something like this:

  methods:
    enabled:
      - name: eth_getLogs

I don't know all the methods required to support the ETH2 nodes but you can just expose them all (tediously), if you're only deal with a local node.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/emeraldpay/dshackle/issues/66#issuecomment-729916520, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APE67BPUGLXN3O24DVHT2RLSQQQ3DANCNFSM4TY5RJOA.

splix commented 3 years ago

@E1458 It seems you've figured out how to setup it with help of @MysticRyuujin (thank you). Method eth_getLogs is not enabled by default, so you have to set it up. And for Infura I also recommend to disabled validation, as @MysticRyuujin mentioned

Btw, I'm not sure it really works for ETH2. I mean, I've never tried, but I believe there are few critical changes in the API and consensus that are not properly handled by Dshackle right now. It uses different strategy to ensure safety for different blockchains, one of Ethereum, and another one for Bitcoin. I guess for Ethereum 2.0 I'll need to implement another version. But it's definitely in my plans to support ETH2.0 eventually, and if you're having other troubles with ETH2.0 please submit tickets with the details, that would be a great help.

MysticRyuujin commented 3 years ago

So, yeah, you can't load balance a beacon node, but using dshackle for load balancing the ETH1 connection for a beacon chain node works just fine.

However, the chainId issue for mainnet needs to be fixed before it can be used for mainnet.

I was hoping we'd eventually get ETH2 API support too, but those APIs were not even standardized until very recently.

E1458 commented 3 years ago

Yes, I meant Eth 1.0 node load balancing for ETH 2.0 clients. It seems quite working well, though I suspect it sends its own extra requests to the Eth1 upstream in addition to the api functions requested from the internal ETH 2.0 client. Also, it seems to send out api requests to the Eth1 node which are defined as "fallback" too. This is not desirable when you want to limit the total requests to use a free layer of, eg: Alchemy or Infura. That's what I meant by wishing a "minimal request mode" option/flag which would just bypass only the requested api functions and only to the node specified as "role: standard" unless this upstream node fails.