Skip to content
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

Merged
merged 3 commits into from Jun 27, 2022
Merged

use eth_chainId instead of net_version #3804

merged 3 commits into from Jun 27, 2022

Conversation

tersec
Copy link
Contributor

@tersec tersec commented Jun 27, 2022

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 while eth_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 and build/nimbus_beacon_node --network=mainnet web3 test --url=http://127.0.0.1:8545
  • rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --ropsten and build/nimbus_beacon_node --network=ropsten web3 test --url=http://127.0.0.1:8545
  • rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --goerli and build/nimbus_beacon_node --network=prater web3 test --url=http://127.0.0.1:8545
  • rm ~/.ethereum/ -rv && go-ethereum/build/bin/geth --http --sepolia and build/nimbus_beacon_node --network=sepolia web3 test --url=http://127.0.0.1:8545

Copy link
Contributor

@etan-status etan-status left a 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:
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

beacon_chain/eth1/eth1_monitor.nim Outdated Show resolved Hide resolved
Co-authored-by: Etan Kissling <etan@status.im>
@github-actions
Copy link

Unit Test Results

0 tests   0 ✔️  0s ⏱️
0 suites  0 💤
0 files    0

Results for commit e5be1e8.

@tersec tersec enabled auto-merge (squash) June 27, 2022 11:49
@tersec tersec merged commit 8de316f into unstable Jun 27, 2022
@tersec tersec deleted the HsM branch June 27, 2022 15:02
zah pushed a commit that referenced this pull request Jun 28, 2022
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants