-
Notifications
You must be signed in to change notification settings - Fork 296
use eth_chainId instead of net_version #3804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
etan-status
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that all major ELs implement this and no fallback seems necessary.
| fatal "The specified web3 provider serves data for a different chain", | ||
| expectedChain, providerChain | ||
| quit 1 | ||
| except CatchableError as exc: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't DataProviderFailure be enough here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe. Didn't want to risk it, because debugging that in an async context is problematic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, {.push raises: [Defect].} effectively doesn't apply to {.async.} functions, which means that even if currently, DataProviderFailure might be enough, changes in the library implementation could undermine that with no compiler-time warnings or errors.
Co-authored-by: Etan Kissling <[email protected]>
* use eth_chainId instead of net_version * Update beacon_chain/eth1/eth1_monitor.nim Co-authored-by: Etan Kissling <[email protected]> * fix logging for Quantity types Co-authored-by: Etan Kissling <[email protected]>
net_versionisn't one of the supported engine API methods in https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#underlying-protocol whileeth_chainIdis.Until ethereum/go-ethereum#25166 was merged, Geth effectively didn't support
eth_chainIdin merge networks in situations where it mattered, but with that fixed, it's now worth switching Nimbus to use it.Tested with
rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --mainnetandbuild/nimbus_beacon_node --network=mainnet web3 test --url=http://127.0.0.1:8545rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --ropstenandbuild/nimbus_beacon_node --network=ropsten web3 test --url=http://127.0.0.1:8545rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --goerliandbuild/nimbus_beacon_node --network=prater web3 test --url=http://127.0.0.1:8545rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --sepoliaandbuild/nimbus_beacon_node --network=sepolia web3 test --url=http://127.0.0.1:8545