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

Don't default to mainnet if NetworkID != 1 #9408

Merged
merged 5 commits into from
Feb 12, 2024
Merged

Conversation

yperbasis
Copy link
Member

@yperbasis yperbasis commented Feb 8, 2024

In certain scenarios (e.g. Hive) genesis is initially populated by erigon init and afterwards erigon is started with some networkid flag, typically != 1. In that case it's incorrect to use default (mainnet) genesis instead of reading genesis from the DB.

This PR fixes Issue #9191 and also some Hive tests that were incorrectly returning SYNCING because they were trying to download mainnet snapshots.

Copy link
Collaborator

@AskAlexSharov AskAlexSharov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. please keep HistoryV3.WriteOnce() before WriteGenesis (e3 will read it and write genesis a bit different way)
  2. maybe devnet downloading mainnet snapshots #9191 - is also related to this issue

@yperbasis yperbasis merged commit 321b8d9 into devel Feb 12, 2024
7 checks passed
@yperbasis yperbasis deleted the hive_withdrawal6 branch February 12, 2024 07:50
yperbasis added a commit that referenced this pull request Feb 29, 2024
After PR #9408 `cfg.Genesis` may be `nil`. Fixes the following issue in
Hive tests:
```
runtime error: invalid memory address or nil pointer dereference" stack="[main.go:29 panic.go:914 panic.go:261 signal_unix.go:861 stageloop.go:540 backend.go:773 node.go:124 main.go:65 make_app.go:52 command.go:279 app.go:337 app.go:311 main.go:34 proc.go:267 asm_amd64.s:1650]
```
mriccobene pushed a commit to mriccobene/erigon that referenced this pull request Mar 13, 2024
After PR erigontech#9408 `cfg.Genesis` may be `nil`. Fixes the following issue in
Hive tests:
```
runtime error: invalid memory address or nil pointer dereference" stack="[main.go:29 panic.go:914 panic.go:261 signal_unix.go:861 stageloop.go:540 backend.go:773 node.go:124 main.go:65 make_app.go:52 command.go:279 app.go:337 app.go:311 main.go:34 proc.go:267 asm_amd64.s:1650]
```
fridrik01 added a commit to berachain/beacon-kit that referenced this pull request Nov 28, 2024
However, its still not solved as erigon does not respect the
--networkid which causes beacond to fail since its expecting
chainid 80087.

It seems this issue was fixed in erigontech/erigon#9408
but even with pulling a recent docker image its still not working
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.

3 participants