Skip to content

[performance] Migrate bloatnet to perf-devnet-3 and fix genesis hash collisions - #19741

Merged
AskAlexSharov merged 2 commits into
performancefrom
wmitsuda/fix-chain-bloatnet
Mar 9, 2026
Merged

AskAlexSharov merged 2 commits into
performancefrom
wmitsuda/fix-chain-bloatnet

Conversation

@wmitsuda

@wmitsuda wmitsuda commented Mar 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Migrate bloatnet config to perf-devnet-3: updated CL bootstrap ENRs, checkpoint sync URL, fork versions, MinGenesisTime, EL bootnodes, and genesis state SSZ
  • Remove registeredChainsByGenesisHash map and ChainSpecByGenesisHash() which can only hold one entry per genesis hash, breaking when mainnet and bloatnet share the same hash (0xd4e56740...)
  • Thread chainName string through CommitGenesisBlock/WriteGenesisBlock/configOrDefault so all lookups use ChainSpecByName instead of genesis hash
  • Pass chain-specific bootnodes/DNS directly to sentry GrpcServer instead of looking them up by genesis hash at P2P server start time

Context

The non-deterministic Go map iteration in init() made the genesis hash collision winner random — bloatnet would sometimes load mainnet's snapshot hashes (306 files instead of 278), causing "webseed infohash mismatch" warnings and incorrect sync behavior.

Test plan

  • Bloatnet: erigon init --chain=bloatnet --datadir=<DIR> <genesis.json> + erigon --chain=bloatnet --datadir=<DIR> --caplin.checkpoint-sync.disable — 278 header-chain files (not mainnet's 306), no "webseed infohash mismatch", deterministic across 3 runs

Post-merge

wmitsuda added 2 commits March 6, 2026 15:40
…net-3

perf-devnet-2 is down (checkpoint sync returns 404/500). Update all CL
and EL parameters to target perf-devnet-3:

- CL bootstrap ENRs: replace 3 devnet-2 with 8 devnet-3 ENRs
- Checkpoint sync URL: perf-devnet-2 -> perf-devnet-3
- Fork versions: 0x..802764 -> 0x..364469
- MinGenesisTime: 1751967000 -> 1771423200
- EL bootnodes: replace 5 devnet-2 enodes with 7 devnet-3 enodes
- Genesis state SSZ: replace with devnet-3 genesis
- Decode genesis state as ElectraVersion (devnet-3 has Electra at epoch 0)
…sis hash collisions

Mainnet and bloatnet share the same genesis hash, but registeredChainsByGenesisHash
can only hold one entry per hash. The non-deterministic Go map iteration in init()
made the collision winner random, causing bloatnet to sometimes load mainnet's
snapshot hashes.

Remove registeredChainsByGenesisHash and ChainSpecByGenesisHash entirely. All
callers now use ChainSpecByName (via chainName parameter) instead. Add
ChainSpecsByGenesisHash (returning []Spec) for error messages only.

Thread chainName through CommitGenesisBlock/WriteGenesisBlock/configOrDefault.
Pass chain-specific bootnodes/dnsNetwork directly to sentry GrpcServer instead
of looking them up by genesis hash at P2P server start time.
@wmitsuda

wmitsuda commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

I'd appreciate some rigorous review in this one @AskAlexSharov @taratorio @yperbasis

I got rid of registeredChainsByGenesisHash hash -> spec mapping because now that we want to support shadowfork specs in-code, the previous assumption of 1 genesis hash : 1 spec is not true anymore.

but in order to do that I had to retrofit chainname into places that used genesis hash, including very old code and some important tests. I'd appreciate fresh eyes to make sure I didn't mock anything by accident just to make tests pass.

@AskAlexSharov
AskAlexSharov merged commit 98a2ec5 into performance Mar 9, 2026
13 checks passed
@AskAlexSharov
AskAlexSharov deleted the wmitsuda/fix-chain-bloatnet branch March 9, 2026 08:11
wmitsuda added a commit that referenced this pull request Mar 9, 2026
…collisions (#19741)

## Summary

- Migrate bloatnet config to perf-devnet-3: updated CL bootstrap ENRs,
checkpoint sync URL, fork versions, MinGenesisTime, EL bootnodes, and
genesis state SSZ
- Remove `registeredChainsByGenesisHash` map and
`ChainSpecByGenesisHash()` which can only hold one entry per genesis
hash, breaking when mainnet and bloatnet share the same hash
(`0xd4e56740...`)
- Thread `chainName string` through
`CommitGenesisBlock`/`WriteGenesisBlock`/`configOrDefault` so all
lookups use `ChainSpecByName` instead of genesis hash
- Pass chain-specific bootnodes/DNS directly to sentry `GrpcServer`
instead of looking them up by genesis hash at P2P server start time

## Context

The non-deterministic Go map iteration in `init()` made the genesis hash
collision winner random — bloatnet would sometimes load mainnet's
snapshot hashes (306 files instead of 278), causing "webseed infohash
mismatch" warnings and incorrect sync behavior.

## Test plan

- [x] Bloatnet: `erigon init --chain=bloatnet --datadir=<DIR>
<genesis.json>` + `erigon --chain=bloatnet --datadir=<DIR>
--caplin.checkpoint-sync.disable` — 278 header-chain files (not
mainnet's 306), no "webseed infohash mismatch", deterministic across 3
runs

## Post-merge

- [ ] Cherry-pick the merge commit to `main`
wmitsuda added a commit that referenced this pull request Mar 9, 2026
…collisions (#19741)

## Summary

- Migrate bloatnet config to perf-devnet-3: updated CL bootstrap ENRs,
checkpoint sync URL, fork versions, MinGenesisTime, EL bootnodes, and
genesis state SSZ
- Remove `registeredChainsByGenesisHash` map and
`ChainSpecByGenesisHash()` which can only hold one entry per genesis
hash, breaking when mainnet and bloatnet share the same hash
(`0xd4e56740...`)
- Thread `chainName string` through
`CommitGenesisBlock`/`WriteGenesisBlock`/`configOrDefault` so all
lookups use `ChainSpecByName` instead of genesis hash
- Pass chain-specific bootnodes/DNS directly to sentry `GrpcServer`
instead of looking them up by genesis hash at P2P server start time

## Context

The non-deterministic Go map iteration in `init()` made the genesis hash
collision winner random — bloatnet would sometimes load mainnet's
snapshot hashes (306 files instead of 278), causing "webseed infohash
mismatch" warnings and incorrect sync behavior.

## Test plan

- [x] Bloatnet: `erigon init --chain=bloatnet --datadir=<DIR>
<genesis.json>` + `erigon --chain=bloatnet --datadir=<DIR>
--caplin.checkpoint-sync.disable` — 278 header-chain files (not
mainnet's 306), no "webseed infohash mismatch", deterministic across 3
runs

## Post-merge

- [ ] Cherry-pick the merge commit to `main`
wmitsuda added a commit that referenced this pull request Mar 9, 2026
…collisions (#19741)

## Summary

- Migrate bloatnet config to perf-devnet-3: updated CL bootstrap ENRs,
checkpoint sync URL, fork versions, MinGenesisTime, EL bootnodes, and
genesis state SSZ
- Remove `registeredChainsByGenesisHash` map and
`ChainSpecByGenesisHash()` which can only hold one entry per genesis
hash, breaking when mainnet and bloatnet share the same hash
(`0xd4e56740...`)
- Thread `chainName string` through
`CommitGenesisBlock`/`WriteGenesisBlock`/`configOrDefault` so all
lookups use `ChainSpecByName` instead of genesis hash
- Pass chain-specific bootnodes/DNS directly to sentry `GrpcServer`
instead of looking them up by genesis hash at P2P server start time

## Context

The non-deterministic Go map iteration in `init()` made the genesis hash
collision winner random — bloatnet would sometimes load mainnet's
snapshot hashes (306 files instead of 278), causing "webseed infohash
mismatch" warnings and incorrect sync behavior.

## Test plan

- [x] Bloatnet: `erigon init --chain=bloatnet --datadir=<DIR>
<genesis.json>` + `erigon --chain=bloatnet --datadir=<DIR>
--caplin.checkpoint-sync.disable` — 278 header-chain files (not
mainnet's 306), no "webseed infohash mismatch", deterministic across 3
runs

## Post-merge

- [ ] Cherry-pick the merge commit to `main`
wmitsuda added a commit that referenced this pull request Mar 10, 2026
…s hash collisions (#19741) (#19753)

## Summary

Cherry-pick of #19741 from `performance` to `release/3.4`.

- Migrate bloatnet configuration from perf-devnet-2 (which is down) to
perf-devnet-3
- Fix genesis hash collisions in `registeredChainsByGenesisHash` caused
by multiple chains sharing the same genesis hash
- Replace the genesis-hash-based chain lookup with explicit `chainName`
parameter threading

## Changes

- **`execution/chain/spec/config.go`** — Remove
`registeredChainsByGenesisHash` map
- **`execution/state/genesiswrite/genesis_write.go`** — Add `chainName`
parameter to `WriteGenesisState`
- **`p2p/sentry/sentry_grpc_server.go`** — Accept
`bootnodes`/`dnsNetwork` as explicit params instead of looking them up
from genesis hash
- **`node/eth/backend.go`** — Resolve and pass chain-specific
bootnodes/DNS params
- **`cl/clparams/config.go`** — Update bloatnet ENR and fork
configuration for perf-devnet-3

## Test plan

- [x] Cherry-pick applies cleanly (no conflicts)
- [x] `make lint` passes
- [x] `make erigon integration` builds successfully
- [ ] CI passes
wmitsuda added a commit that referenced this pull request Mar 10, 2026
…collisions (#19741)

## Summary

- Migrate bloatnet config to perf-devnet-3: updated CL bootstrap ENRs,
checkpoint sync URL, fork versions, MinGenesisTime, EL bootnodes, and
genesis state SSZ
- Remove `registeredChainsByGenesisHash` map and
`ChainSpecByGenesisHash()` which can only hold one entry per genesis
hash, breaking when mainnet and bloatnet share the same hash
(`0xd4e56740...`)
- Thread `chainName string` through
`CommitGenesisBlock`/`WriteGenesisBlock`/`configOrDefault` so all
lookups use `ChainSpecByName` instead of genesis hash
- Pass chain-specific bootnodes/DNS directly to sentry `GrpcServer`
instead of looking them up by genesis hash at P2P server start time

## Context

The non-deterministic Go map iteration in `init()` made the genesis hash
collision winner random — bloatnet would sometimes load mainnet's
snapshot hashes (306 files instead of 278), causing "webseed infohash
mismatch" warnings and incorrect sync behavior.

## Test plan

- [x] Bloatnet: `erigon init --chain=bloatnet --datadir=<DIR>
<genesis.json>` + `erigon --chain=bloatnet --datadir=<DIR>
--caplin.checkpoint-sync.disable` — 278 header-chain files (not
mainnet's 306), no "webseed infohash mismatch", deterministic across 3
runs

## Post-merge

- [ ] Cherry-pick the merge commit to `main`
wmitsuda added a commit that referenced this pull request Mar 11, 2026
…collisions (#19741) (#19751)

## Summary

Cherry-pick of #19741 from `performance` to `main`.

- Migrate bloatnet configuration from perf-devnet-2 (which is down) to
perf-devnet-3
- Fix genesis hash collisions in `registeredChainsByGenesisHash` caused
by multiple chains sharing the same genesis hash
- Replace the genesis-hash-based chain lookup with explicit `chainName`
parameter threading

## Changes

- **`execution/chain/spec/config.go`** — Remove
`registeredChainsByGenesisHash` map
- **`execution/state/genesiswrite/genesis_write.go`** — Add `chainName`
parameter to `WriteGenesisState`
- **`p2p/sentry/sentry_grpc_server.go`** — Accept
`bootnodes`/`dnsNetwork` as explicit params instead of looking them up
from genesis hash
- **`node/eth/backend.go`** — Resolve and pass chain-specific
bootnodes/DNS params
- **`cl/clparams/config.go`** — Update bloatnet ENR and fork
configuration for perf-devnet-3

## Test plan

- [x] Cherry-pick applies cleanly (no conflicts)
- [x] `make lint` passes
- [x] `make erigon integration` builds successfully
- [ ] CI passes
wmitsuda added a commit that referenced this pull request May 13, 2026
The merge of performance into wmitsuda/performance-tested produced two
adjacent BloatnetBootstrapNodes declarations. The dedup picked the
3-node pre-migration (perf-devnet-2) set instead of the 8-node
post-migration (perf-devnet-3) set from #19741. Restore the perf-devnet-3
list to match the performance branch.
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.

2 participants