-
Notifications
You must be signed in to change notification settings - Fork 233
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
use eth_chainId instead of net_version #3804
Conversation
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 <etan@status.im>
* use eth_chainId instead of net_version * Update beacon_chain/eth1/eth1_monitor.nim Co-authored-by: Etan Kissling <etan@status.im> * fix logging for Quantity types Co-authored-by: Etan Kissling <etan@status.im>
net_version
isn't one of the supported engine API methods in https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#underlying-protocol whileeth_chainId
is.Until ethereum/go-ethereum#25166 was merged, Geth effectively didn't support
eth_chainId
in 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 --mainnet
andbuild/nimbus_beacon_node --network=mainnet web3 test --url=http://127.0.0.1:8545
rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --ropsten
andbuild/nimbus_beacon_node --network=ropsten web3 test --url=http://127.0.0.1:8545
rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --goerli
andbuild/nimbus_beacon_node --network=prater web3 test --url=http://127.0.0.1:8545
rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --sepolia
andbuild/nimbus_beacon_node --network=sepolia web3 test --url=http://127.0.0.1:8545