Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
749df58
db/state, db/kv/stream: add HistoryKeyTxNumRange and MultisetKV
sudeepdino008 Feb 10, 2026
84d9935
db/state, db/kv/stream: use stream.KU64 for HistoryKeyTxNumRange, add…
sudeepdino008 Feb 10, 2026
9412b7e
db/state: remove HistoryKeyRange and skipValues (superseded by Histor…
sudeepdino008 Feb 10, 2026
b13473d
cmd, db/state: add txnum index check for commitment rebuild
sudeepdino008 Feb 6, 2026
fde1949
db/state: scaffold block-by-block commitment rebuild loop
sudeepdino008 Feb 6, 2026
55382c3
db/state: rewrite RebuildCommitmentFilesWithHistory core loop
sudeepdino008 Feb 6, 2026
3597c49
backtester, db/state: add NewRebuildStateReader and wire into loop
sudeepdino008 Feb 6, 2026
537e7b3
db/state: add size-based flush + BuildFilesInBackground
sudeepdino008 Feb 6, 2026
d2a70b8
db/state: prune commitment domain after BuildFilesInBackground
sudeepdino008 Feb 6, 2026
670a059
db/state: add progress logging every 20s
sudeepdino008 Feb 6, 2026
7edc915
db/state: add squeeze pass for ReplaceKeysInValues
sudeepdino008 Feb 6, 2026
0121f38
db/state: add future TODO comments
sudeepdino008 Feb 6, 2026
723bca1
db/state: verify stateRoot against canonical headers after each block
sudeepdino008 Feb 6, 2026
f519740
db/state: use snapshot-aware blockReader for stateRoot verification
sudeepdino008 Feb 6, 2026
30d0378
db/state, stagedsync: derive txNumsReader from blockReader inside Reb…
sudeepdino008 Feb 6, 2026
0ea49cf
rename symbol
sudeepdino008 Feb 6, 2026
d0a7fcb
save
sudeepdino008 Feb 7, 2026
6f7272a
cmd/integration, cmd/utils: choose rebuild path based on DB commitmen…
sudeepdino008 Feb 9, 2026
6345e9b
db/state, db/kv: add HistoryKeyRange (keys-only) + EnableReadAhead + …
sudeepdino008 Feb 9, 2026
e4ef3f1
db/state: use []string in prefetchResult, drop unused txNumsReader fr…
sudeepdino008 Feb 10, 2026
242de30
db/state: fix HistoryKeyTxNumIterDB cursor bug, add edge-case tests
sudeepdino008 Feb 10, 2026
8acbbc0
db/state: extract HistoryKeyTxNumRange into dedicated files
sudeepdino008 Feb 10, 2026
9d4c703
Merge branch 'history_key_txnum_range' into commitment_history_regen
sudeepdino008 Feb 10, 2026
ca0262b
db/state, db/kv/stream: tighten HistoryKeyTxNumRange code (-308/+55 l…
sudeepdino008 Feb 10, 2026
ba47102
Merge branch 'history_key_txnum_range' into commitment_history_regen
sudeepdino008 Feb 10, 2026
c9afd85
db/state: replace keyPrefetcher with batchFetcher, wire HistoryKeyTxN…
sudeepdino008 Feb 10, 2026
25dc973
db/state: collect-sort-merge bucketing in fetchBatch, add Exhaust() f…
sudeepdino008 Feb 10, 2026
c903bee
db/state: fix batchFetcher hang on shutdown, bail on context error be…
sudeepdino008 Feb 10, 2026
388a4bd
execProgress fix
sudeepdino008 Feb 11, 2026
6895557
Merge remote-tracking branch 'origin/main' into commitment_history_regen
sudeepdino008 Feb 13, 2026
9930841
add instruction to commitment rebuild log if maxTxNum is not populate…
sudeepdino008 Feb 13, 2026
e8203f3
Merge remote-tracking branch 'origin/main' into commitment_history_regen
sudeepdino008 Feb 16, 2026
658f71f
Merge branch 'main' into commitment_history_regen
sudeepdino008 Feb 17, 2026
28a8e80
db/state: replace batchFetcher with ETL collector in rebuild loop, ad…
sudeepdino008 Feb 17, 2026
86345c0
db/state: flush at block boundary when domains exceed batchSize durin…
sudeepdino008 Feb 17, 2026
119c7df
db/state/squeeze: enable warmup cache for commitment during history r…
sudeepdino008 Feb 17, 2026
7f5c455
db/state/squeeze: enable parallel trie warmup during commitment histo…
sudeepdino008 Feb 17, 2026
a94cf17
db/state/squeeze: flush commitment every 200k blocks; enable parallel…
sudeepdino008 Feb 17, 2026
f3b54df
db/state/squeeze: set state reader and clear warmup cache at block start
sudeepdino008 Feb 17, 2026
529a198
db/state/squeeze: add diagnostics for post-flush SeekCommitment and r…
sudeepdino008 Feb 17, 2026
df822f3
db/state/squeeze: set blockNum/txNum before TouchKey after flush
sudeepdino008 Feb 17, 2026
20592fa
db/state/squeeze: skip commitment prune when no .seg files exist
sudeepdino008 Feb 17, 2026
6197100
cmd/integration: add --clear-commitment flag to rebuild command
sudeepdino008 Feb 18, 2026
53cc453
db/state/squeeze: use BuildFiles2 to limit build to flushed steps
sudeepdino008 Feb 18, 2026
4261c6f
db/state/squeeze: call mergeLoopStep directly instead of BuildFilesIn…
sudeepdino008 Feb 18, 2026
8a2f6cc
db/state: track total value size in CachePutSize metric
sudeepdino008 Feb 18, 2026
66059bd
db/state/squeeze: use common.ByteCount for memBatch log fields
sudeepdino008 Feb 18, 2026
7cb1522
db/state/squeeze: move size-based flush out of ETL Load callback
sudeepdino008 Feb 19, 2026
2912f46
cmd/integration, db/state/squeeze: add --resume flag for commitment r…
sudeepdino008 Feb 20, 2026
48b0be6
cmd/integration: skip history prompt when --resume is set
sudeepdino008 Feb 20, 2026
2b06948
cmd/integration: reject --resume when commitment history is not enabled
sudeepdino008 Feb 20, 2026
4ece3cb
cmd/integration: fail on invalid yes/no response in rebuild prompt
sudeepdino008 Feb 20, 2026
3b7b1f2
cmd/integration: remove obvious comment
sudeepdino008 Feb 20, 2026
37a5596
[TO_BE_REVERTED] db/state/squeeze: add debug tracing and warmup cache…
sudeepdino008 Feb 20, 2026
0f3c2fa
Merge remote-tracking branch 'origin/main' into commitment_history_regen
sudeepdino008 Feb 23, 2026
827302e
db/state/squeeze: fix SharedDomains API after main merge
sudeepdino008 Feb 23, 2026
177c608
db/state/squeeze: fix rebuild panic when commitment files are deleted
sudeepdino008 Feb 23, 2026
5ce6108
commitmentdb: add ERIGON_DEBUG_COMMITMENT_READ_BLOCK env for tracing …
sudeepdino008 Feb 24, 2026
932d5df
Merge remote-tracking branch 'origin/main' into commitment_history_regen
sudeepdino008 Feb 24, 2026
3531c85
save
AskAlexSharov Feb 25, 2026
955ed2a
save
AskAlexSharov Feb 25, 2026
2cce1f2
Merge remote-tracking branch 'origin/main' into commitment_history_regen
sudeepdino008 Feb 25, 2026
c697da6
db/state/squeeze: adaptive batch block count for commitment history r…
sudeepdino008 Feb 25, 2026
bcaaf01
db/state/squeeze: cap adaptive batchBlockCount at 100k
sudeepdino008 Feb 25, 2026
60a6762
db/state/squeeze: disable only inter-domain dependencies during commi…
sudeepdino008 Feb 25, 2026
ef152d2
db/state/squeeze: fix skipped empty blocks before first keyed block i…
sudeepdino008 Feb 26, 2026
ca44fdc
save
sudeepdino008 Feb 27, 2026
72d6a71
fix(rebuild_commitment_history): wait for builds before merge, skip s…
Mar 4, 2026
31873c4
rpc: add_check on persistentReceipt (#19414)
lupin012 Feb 25, 2026
fd8c8e5
Test_HexPatriciaHashed_ProcessWithDozensOfStorageKeys flaky fix (#19472)
AskAlexSharov Feb 25, 2026
5f324e1
decomp: speedup `nextPos()` part2 (#19325)
AskAlexSharov Feb 25, 2026
23b5116
seg: calc `ratio` without source file size check (i plan to skip file…
AskAlexSharov Feb 25, 2026
afb8e2a
execmoduletester: use options pattern (#19475)
taratorio Feb 25, 2026
25ec369
move btindex from `db/state` pkg to `db/datastruct/btindex` (#19464)
AskAlexSharov Feb 25, 2026
b8456f6
stream on `rwtx`: to use `.Current()` instead of storing pointers in …
AskAlexSharov Feb 25, 2026
57e608a
Test optimisation: pool resources allocated in the HexPatriciaHashed …
AlexeyAkhunov Feb 25, 2026
696e0c1
`go fix -minimax` (#19461)
AskAlexSharov Feb 25, 2026
5ea2be4
seg: if word-level compression disabled. don't create `.idt` file (#1…
AskAlexSharov Feb 25, 2026
12505f8
test: various `no space left on disk` fixes. part3 (#19477)
AskAlexSharov Feb 25, 2026
4a4f887
Replace time.After with time.Sleep in test sleepWithContext (#19485)
AlexeyAkhunov Feb 25, 2026
e31cafc
[SharovBot] fix: replace testify/require with if+panic in sentinel te…
Giulio2002 Feb 25, 2026
da50e92
sd: txnum remove step4 (#19481)
AskAlexSharov Feb 25, 2026
54a9ee2
`go fix -inline ./...` (#19462)
AskAlexSharov Feb 25, 2026
f5be35a
crypto: switch from deprecated methods (#19465)
AskAlexSharov Feb 25, 2026
bbf0916
rpc: remove 1 sprintf from hot-path (#19471)
AskAlexSharov Feb 25, 2026
0df81d4
merge: prioritize Domain merge over History (#19441)
AskAlexSharov Feb 25, 2026
3e6d908
rpc: improve check on Context-Cancellation not using string compare (…
lupin012 Feb 25, 2026
44c7d83
Skip BAL validation when not available (#19486)
shohamc1 Feb 25, 2026
3e018d6
all-tests: clean macos image (#19490)
mriccobene Feb 25, 2026
da34d97
[SharovBot] fix(node): track StartRpcServer goroutine in bgComponents…
Giulio2002 Feb 26, 2026
d5934f4
[SharovBot] ci: add continue-on-error to Conditional Docker Login ste…
Giulio2002 Feb 26, 2026
00c3fee
rpc: eth_feeHistory pending (#19455)
lupin012 Feb 26, 2026
2472dcb
rpc: filter set filter value (#19491)
lupin012 Feb 26, 2026
4fe1d7d
qa-tests: upload preparing step logs to rpc integration latest (#19488)
mriccobene Feb 26, 2026
f77d5f1
several flaky tests fixes (#19498)
AskAlexSharov Feb 26, 2026
c049f9a
[SharovBot] ci(kurtosis): cache third-party containers and erigon bui…
Giulio2002 Feb 26, 2026
8ca33b7
integrity: split checkers to slow/fast, move `CheckStateVerify` to sl…
AskAlexSharov Feb 26, 2026
1dbfd8d
db/state: simplify tests (#19497)
AskAlexSharov Feb 26, 2026
9ae8709
integrity: CheckKvi parallel (#19502)
AskAlexSharov Feb 26, 2026
7e150ef
Refactor test-all-erigon workflow for self-hosted Windows (#19466)
lystopad Feb 26, 2026
a577138
Disable Go cache in workflow on win-server (#19505)
lystopad Feb 26, 2026
aa76733
[SharovBot] test: split parallel test into test+benchmark to fix CI d…
Giulio2002 Feb 26, 2026
652ded4
[SharovBot] fix(stagedsync): add mutex to Progress.LogCommitments to …
Giulio2002 Feb 26, 2026
432ecf3
[wip] sd: removing txNum field (#19489)
AskAlexSharov Feb 26, 2026
b41466e
Parallel exec fixes (#17319)
mh0lt Feb 26, 2026
07a0e0a
[wip] compressor and recsplit: global workers limit (#19195)
AskAlexSharov Feb 26, 2026
872f1cd
StateFerify: use `etl` (#19504)
AskAlexSharov Feb 27, 2026
e66a1ad
Revert "[wip] sd: removing txNum field " (#19508)
Giulio2002 Feb 27, 2026
f400b45
Add skip for failing test (#19517)
mh0lt Feb 27, 2026
a0ab184
BuildMissedAccessors: less fs scans (#19518)
AskAlexSharov Feb 27, 2026
1566fb9
rpc add impl admin_addTrustedPeer admin_removeTrustedPeer (#19413)
lupin012 Feb 27, 2026
c032045
MatchVersionedFile: speed (#19522)
AskAlexSharov Feb 27, 2026
ceff40d
rlpgen (#19513)
AskAlexSharov Feb 27, 2026
d8f1d90
skip re-validation for self-published messages, fix BLS deserializati…
domiwei Feb 27, 2026
a2dbf67
add log-prefix to `p2p` pkg (#19529)
AskAlexSharov Feb 28, 2026
a3b3c63
[SharovBot] fix(txpool): evict zombie queued txns exceeding MaxNonceG…
Giulio2002 Feb 28, 2026
bdf29f0
rpc: add eth_getStorageValues endpoint (#19442)
Sahil-4555 Feb 28, 2026
9b2919b
prune unification (TxLookup) (#19179)
JkLondon Feb 28, 2026
ef2c24f
db/state: skip Benchmark_BtreeIndex_Search when data file is absent (…
anacrolix Feb 28, 2026
a4f5065
etl: limit SortAndFlushInBackground feature to only 1 goroutine per c…
AskAlexSharov Feb 28, 2026
d91dade
seg: nextPos optimize part3 (#19530)
AskAlexSharov Feb 28, 2026
24e815f
recsplit: prepare for parallelism (#19514)
AskAlexSharov Feb 28, 2026
382ce12
fix nil-ptr in `DumpBeaconBlocks` (#19532)
AskAlexSharov Feb 28, 2026
8047e35
remove ottersync banner from logs (#19534)
AskAlexSharov Feb 28, 2026
270b870
recsplit: use `uint32` for bucketIdx - to reduce amount of intermedia…
AskAlexSharov Feb 28, 2026
ea0cc9f
fix missing attestations by using GossipSub for subnet peer coverage …
domiwei Feb 28, 2026
97e8779
ApplyDeferredBranchUpdates: reduce atomics overhead (#19541)
AskAlexSharov Mar 1, 2026
47dedb9
recsplit: support progress reporting (#19536)
AskAlexSharov Mar 1, 2026
68de311
claude: add launch-bal-devnet-2 skill (#19548)
mh0lt Mar 1, 2026
d5819ec
rpc: fix debug_traceCallMany global BlockOverrides and StateOverrides…
lupin012 Mar 1, 2026
308eb1e
rpc: eth_feeHistory optimisation (#19526)
lupin012 Mar 1, 2026
1fe0edc
d_lru: remove mutex (#19543)
AskAlexSharov Mar 2, 2026
d821635
rpc: trace_replayTransaction() add stack info in case of TLOAD (#19550)
lupin012 Mar 2, 2026
134a2ba
seg rm-state: delete .tmp files from snapshot directories (#19549)
sudeepdino008 Mar 2, 2026
3fe75be
db/state: remove unused classes (#19540)
AskAlexSharov Mar 2, 2026
7b972cd
add `NO_DEEP_MERGE_HISTORY` env - to allow only history-merges up to …
AskAlexSharov Mar 2, 2026
0acd0fe
[SharovBot] fix Amsterdam signer support and BAL non-determinism (#19…
Giulio2002 Mar 2, 2026
4d5d505
deps: switch to upstream holiman/uint256 (#19561)
yperbasis Mar 2, 2026
e8da1ed
merge: better progress in logs (#19554)
AskAlexSharov Mar 2, 2026
da7db5a
Sequence: Builder to avoid intermediate EF representation (#19552)
AskAlexSharov Mar 2, 2026
1952a89
[kimiko] MCP finisher (0.0.2) (#19487)
JkLondon Mar 2, 2026
689dee8
merge, execmoduletester: add FakeMerge engine and Prague pre-deploys …
mh0lt Mar 2, 2026
8acce78
docs: fix port config flags in migrating-from-geth.md (#19572)
bloxster Mar 2, 2026
186ce7e
docs: fix flag defaults and remove non-existent flags in fundamentals…
bloxster Mar 2, 2026
560666e
rpc: align Mgt Pending block (#19409)
lupin012 Mar 2, 2026
89bf930
rpc: fix in API with request Hash and state processing add check Cano…
lupin012 Mar 2, 2026
334e9d6
EliasFano.Build: less iterations in upperBits loop (#19556)
AskAlexSharov Mar 2, 2026
9dfeaf6
rpc: impl trace_rawTransaction (#19524)
lupin012 Mar 3, 2026
1eb7cc2
p2p: better handling of RLP errors in `wit` (#19569)
yperbasis Mar 3, 2026
f385230
docs: clarify --grpc flag availability in grpc.md (#19574)
bloxster Mar 3, 2026
5d3070a
docs: add MCP Server documentation to fundamentals (#19575)
bloxster Mar 3, 2026
1208711
stagedsync: defer state files indexing on restart to reduce startup l…
JkLondon Mar 3, 2026
565bb8b
p2p/sentry: fix wrong OR in case statement for wit (#19580)
taratorio Mar 3, 2026
33fc7e9
qa-tests: use a specific version of the prebuilt db in RPC and Tip-Tr…
mriccobene Mar 3, 2026
f8f29b3
qa-tests: change RPC Integration Latest test trigger (#19563)
mriccobene Mar 3, 2026
e4c1a8f
db/state, snapcfg: download erigondb.toml via torrent; move settings …
wmitsuda Mar 4, 2026
9746330
ci: improve disk space management on self-hosted Windows runner (#19593)
lystopad Mar 4, 2026
2ea01ff
[SharovBot] Fix data race between buildFiles and recalcVisibleFiles (…
Giulio2002 Mar 4, 2026
d3b59d4
cl/p2p, cl/sentinel: fix DISCV5 ENR missing IP when discovery address…
lystopad Mar 4, 2026
b7f297b
SequenceBuilder: add .Reset() method and use it during merge (#19567)
AskAlexSharov Mar 4, 2026
849a98a
replaceShortenedKeysInBranch: less re-allocs (#19584)
AskAlexSharov Mar 4, 2026
51f2757
rpc: unify BlockOverrides into a single type with three override meth…
lupin012 Mar 4, 2026
fe2cc16
[rpc] [kimiko] support for testing_buildBlockV1 (#19478)
JkLondon Mar 4, 2026
a94ad2c
`erigon snapshots check-commitment-hist-at-blk-range`: prevent check …
AskAlexSharov Mar 4, 2026
1923672
integrity: --skip-check support (#19598)
AskAlexSharov Mar 4, 2026
26c3528
integrity: align log prefixes (#19599)
AskAlexSharov Mar 4, 2026
b712a48
point to erigon-snapshot `release/3.4` (#19601)
AskAlexSharov Mar 4, 2026
8bae1f8
Fix/bal selfdestruct netzero (#19528)
mh0lt Mar 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
118 changes: 118 additions & 0 deletions .claude/skills/erigondb-sync-integration-test-plan/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
name: erigondb-sync-integration-test-plan
description: Integration test plan for erigondb.toml settings resolution across 3 runtime scenarios (legacy, fresh+downloader, fresh+no-downloader)
allowed-tools: Bash, Read
user-invocable: false
---

# erigondb.toml Integration Test Plan

Verify that `erigondb.toml` settings are correctly resolved across three distinct runtime scenarios: legacy datadirs, fresh sync with downloader, and fresh sync without downloader.

Use this plan after any changes to the erigondb.toml resolution logic (creation, defaults, legacy detection, downloader delivery) to confirm all paths still work.

## Parameters

Two values must be provided by the caller:

| Parameter | Description | Example |
|-----------|-------------|---------|
| **chain** | Chain name passed to `--chain=` | `hoodi`, `mainnet` |
| **legacy datadir** | Path to an existing Erigon datadir that has `preverified.toml` but **no** `erigondb.toml` | `~/eth-nodes/erigon33-hoodi-stable` |

All scenarios use `--prune.mode=archive`.

## Pre-requisites

1. **Built binary** — invoke `/erigon-build` if `./build/bin/erigon` does not exist.
2. **Legacy datadir** — the user-provided path must contain `snapshots/preverified.toml` and must **not** contain `snapshots/erigondb.toml`.
3. **Port availability** — use `/erigon-network-ports` for reference. Each scenario uses a different port offset (+100, +200, +300) via `/erigon-ephemeral` conflict detection.

## Scenario A: Legacy datadir

**Goal**: Starting on a legacy datadir (has `preverified.toml`, no `erigondb.toml`) creates `erigondb.toml` with legacy settings (`step_size = 1562500`).

### Steps

1. Create an ephemeral clone of the user's legacy datadir using `/erigon-ephemeral` (Mode B: clone). This gives an isolated copy so the original is untouched.
2. Confirm pre-conditions on the clone:
- `snapshots/preverified.toml` exists
- `snapshots/erigondb.toml` does **not** exist
3. Start erigon with port offset **+100** (via `/erigon-ephemeral` port conflict detection):
```
./build/bin/erigon \
--datadir=<clone-path> \
--chain=<chain> \
--prune.mode=archive \
<port flags at +100 offset>
```
4. Wait for startup (~15s). Check logs for a message indicating legacy settings detection (e.g., `Creating erigondb.toml with LEGACY settings`).
5. Verify the generated file:
```bash
cat <clone-path>/snapshots/erigondb.toml
```
Expected: `step_size = 1562500`
6. Kill the process and clean up the ephemeral datadir.

## Scenario B: Fresh sync with downloader

**Goal**: A fresh datadir (no `preverified.toml`, no `erigondb.toml`) starts with code defaults (`step_size = 1562500`), then the downloader delivers the network's `erigondb.toml` during the header-chain phase, which may have different settings (e.g., `step_size = 390625` for hoodi).

### Steps

1. Create an empty ephemeral datadir using `/erigon-ephemeral` (Mode A: empty).
2. Start erigon with port offset **+200**:
```
./build/bin/erigon \
--datadir=<empty-path> \
--chain=<chain> \
--prune.mode=archive \
<port flags at +200 offset>
```
3. Check early logs for a message indicating defaults are being used (e.g., `erigondb.toml not found, using defaults`) with `step_size=1562500`.
4. Wait for the header-chain download phase to complete (~30-120s depending on network). Watch logs for:
- `[1/6 OtterSync] Downloader completed header-chain`
- `Reading DB settings from existing erigondb.toml`
- `erigondb stepSize changed, propagating` (if the network's settings differ from the code defaults)
5. Verify the delivered file:
```bash
cat <empty-path>/snapshots/erigondb.toml
```
The values come from the network's published `erigondb.toml` (check the chain's webseed for the canonical values).
6. Kill the process and clean up the ephemeral datadir.

## Scenario C: Fresh sync with `--no-downloader`

**Goal**: A fresh datadir with `--no-downloader` immediately writes `erigondb.toml` with code defaults (`step_size = 1562500`).

### Steps

1. Create an empty ephemeral datadir using `/erigon-ephemeral` (Mode A: empty).
2. Start erigon with port offset **+300** and `--no-downloader`:
```
./build/bin/erigon \
--datadir=<empty-path> \
--chain=<chain> \
--prune.mode=archive \
--no-downloader \
<port flags at +300 offset>
```
3. Check logs for a message indicating defaults were written immediately (e.g., `Initializing erigondb.toml with DEFAULT settings`) with `step_size=1562500`.
4. Verify the file exists immediately:
```bash
cat <empty-path>/snapshots/erigondb.toml
```
Expected: `step_size = 1562500` (code defaults, since no downloader to provide network settings)
5. Kill the process and clean up the ephemeral datadir.

## Success Criteria

| Scenario | Condition | Expected step_size | File timing |
|----------|-----------|-------------------|-------------|
| A (legacy) | `Creating erigondb.toml with LEGACY settings` log | 1,562,500 | Written immediately on startup |
| B (fresh+downloader) | `erigondb.toml not found, using defaults` then `erigondb stepSize changed, propagating` | Code default 1,562,500 then network value (chain-dependent) | After downloader delivers it |
| C (fresh+no-downloader) | `Initializing erigondb.toml with DEFAULT settings (nodownloader)` log | 1,562,500 | Written immediately on startup |

## Cleanup

After all scenarios complete, ensure all ephemeral datadirs and processes are cleaned up. Use `/erigon-ephemeral` Step 5 (cleanup) for each instance, or Step 6 (leftover detection) to find any stragglers.
185 changes: 185 additions & 0 deletions .claude/skills/launch-bal-devnet-2/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
---
name: launch-bal-devnet-2
description: Launch erigon + Lighthouse on the bal-devnet-2 ethpandaops devnet (EIP-7928 Block Access Lists). Manages start/stop of both EL and CL clients with proper port offsets and JWT auth.
allowed-tools: Bash, Read, Write, Edit, Glob
allowed-prompts:
- tool: Bash
prompt: start, stop, and manage erigon and lighthouse processes for bal-devnet-2
---

# Launch bal-devnet-2 (EIP-7928 BAL Devnet)

Run erigon (EL) + Lighthouse (CL) on the bal-devnet-2 ethpandaops devnet for testing EIP-7928 Block Access Lists.

## Network Details

| Parameter | Value |
|-----------|-------|
| Chain ID | 7033429093 |
| Genesis timestamp | 1770388190 |
| Amsterdam timestamp | 1770400508 (epoch 32) |
| Lighthouse image | `ethpandaops/lighthouse:bal-devnet-2-65bb283` |
| Lighthouse version | v8.0.1 (commit 65bb283, branch bal-devnet-2) |
| Explorer | https://explorer.bal-devnet-2.ethpandaops.io |
| Faucet | https://faucet.bal-devnet-2.ethpandaops.io |
| RPC | https://rpc.bal-devnet-2.ethpandaops.io |
| Checkpoint sync | https://checkpoint-sync.bal-devnet-2.ethpandaops.io |

## Working Directory

Ask the user where they want the working directory. Default suggestion: `~/bal-devnet-2/`.
Use `$WORKDIR` throughout to refer to the chosen path.

```
$WORKDIR/
├── genesis.json # EL genesis
├── config.yaml # CL beacon config
├── genesis.ssz # CL genesis state
├── testnet-config/ # Lighthouse testnet dir (config.yaml + genesis.ssz + deploy files)
├── start-erigon.sh # Erigon start script (run FIRST)
├── start-lighthouse.sh # Lighthouse start script (run SECOND)
├── stop.sh # Stop both erigon + Lighthouse
├── clean.sh # Stop, wipe data, re-init genesis
├── erigon-data/ # Erigon datadir (contains jwt.hex)
├── lighthouse-data/ # Lighthouse datadir
├── erigon-console.log # Erigon stdout/stderr
└── lighthouse-console.log # Lighthouse stdout/stderr
```

## Port Assignments (offset +100)

| Service | Port | Protocol |
|---------|------|----------|
| Erigon HTTP RPC | 8645 | TCP |
| Erigon Engine API (authrpc) | 8651 | TCP |
| Erigon WebSocket | 8646 | TCP |
| Erigon P2P | 30403 | TCP+UDP |
| Erigon gRPC | 9190 | TCP |
| Erigon Torrent | 42169 | TCP+UDP |
| Erigon pprof | 6160 | TCP |
| Erigon metrics | 6161 | TCP |
| Lighthouse P2P | 9100 | TCP+UDP |
| Lighthouse QUIC | 9101 | UDP |
| Lighthouse HTTP API | 5152 | TCP |
| Lighthouse metrics | 5264 | TCP |

## Workflow

### Step 1: Check Prerequisites

1. Verify erigon binary exists at `./build/bin/erigon`. If not, invoke `/erigon-build`.
2. Verify the Lighthouse Docker image is available:
```bash
docker image inspect ethpandaops/lighthouse:bal-devnet-2-65bb283 > /dev/null 2>&1
```
If not, pull it:
```bash
docker pull ethpandaops/lighthouse:bal-devnet-2-65bb283
```
3. Verify config files exist in `$WORKDIR` (genesis.json, testnet-config/).
If not, download them:
```bash
mkdir -p $WORKDIR/testnet-config
curl -sL -o $WORKDIR/genesis.json https://config.bal-devnet-2.ethpandaops.io/el/genesis.json
curl -sL -o $WORKDIR/testnet-config/config.yaml https://config.bal-devnet-2.ethpandaops.io/cl/config.yaml
curl -sL -o $WORKDIR/testnet-config/genesis.ssz https://config.bal-devnet-2.ethpandaops.io/cl/genesis.ssz
echo "0" > $WORKDIR/testnet-config/deposit_contract_block.txt
echo "0" > $WORKDIR/testnet-config/deploy_block.txt
```

### Step 2: Initialize Datadir (first run only)

If `$WORKDIR/erigon-data/chaindata` does not exist:
```bash
./build/bin/erigon init --datadir $WORKDIR/erigon-data $WORKDIR/genesis.json
```

### Step 3: Create Scripts (first run only)

If the start/stop/clean scripts don't exist yet, generate them. The scripts must use absolute paths based on `$WORKDIR`. Key details:

**start-erigon.sh** — Runs erigon with `--externalcl`. Must start FIRST (creates JWT secret).
- Env vars: `ERIGON_EXEC3_PARALLEL=true`, `ERIGON_ASSERT=true`, `ERIGON_EXEC3_WORKERS=12`, `LOG_HASH_MISMATCH_REASON=true`
- Flags: `--datadir=$WORKDIR/erigon-data`, `--externalcl`, `--networkid=7033429093`, all 16 EL bootnodes, erigon static peers, `--prune.mode=minimal`, all offset ports (see port table), `--http.api=eth,erigon,engine,debug`, `--pprof`, `--metrics`
- EL bootnodes: fetch from `https://config.bal-devnet-2.ethpandaops.io/api/v1/nodes/inventory` (extract enode URLs from `execution.enode` fields)

**start-lighthouse.sh** — Runs Lighthouse via Docker with `--network=host`. Must start SECOND.
- Checks JWT exists at `$WORKDIR/erigon-data/jwt.hex`
- Docker container name: `bal-devnet-2-lighthouse`
- Mounts: `$WORKDIR/testnet-config:/config:ro`, `$WORKDIR/lighthouse-data:/data`, JWT as `/jwt.hex:ro`
- Flags: `--testnet-dir=/config`, `--execution-endpoint=http://127.0.0.1:8651`, `--execution-jwt=/jwt.hex`, all 15 CL ENR bootnodes, offset ports, `--checkpoint-sync-url=https://checkpoint-sync.bal-devnet-2.ethpandaops.io`
- CL bootnodes: fetch from same inventory URL (extract ENR entries from `consensus.enr` fields)

**stop.sh** — Stops Lighthouse (`docker stop bal-devnet-2-lighthouse`) then erigon (`pkill -f "datadir.*bal-devnet-2/erigon-data"`).

**clean.sh** — Runs `stop.sh`, removes erigon chain data (chaindata, snapshots, txpool, nodes, temp) and lighthouse data, re-initializes genesis.

### Step 4: Start Erigon (FIRST)

Erigon must start first because it creates the JWT secret that Lighthouse needs.

```bash
cd $WORKDIR && nohup bash start-erigon.sh > erigon-console.log 2>&1 &
```

Verify it started:
- Check `tail $WORKDIR/erigon-console.log` for startup messages
- Check JWT exists: `ls $WORKDIR/erigon-data/jwt.hex`
- Check port binding: `ss -tlnp | grep 8651`

### Step 5: Start Lighthouse (SECOND)

After erigon is running and JWT exists:

```bash
cd $WORKDIR && nohup bash start-lighthouse.sh > lighthouse-console.log 2>&1 &
```

Verify it started:
- Check `tail $WORKDIR/lighthouse-console.log` for "Lighthouse started"
- Look for "Loaded checkpoint block and state" (checkpoint sync)
- Look for `peers: "N"` showing peer connections

### Step 6: Monitor

```bash
# Erigon sync progress
tail -f $WORKDIR/erigon-console.log

# Lighthouse sync progress
tail -f $WORKDIR/lighthouse-console.log

# Check erigon block height via RPC
curl -s http://localhost:8645 -X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' | python3 -m json.tool

# Check lighthouse sync status
curl -s http://localhost:5152/eth/v1/node/syncing | python3 -m json.tool
```

### Step 7: Stop

```bash
bash $WORKDIR/stop.sh
```

This stops Lighthouse (via `docker stop`) then erigon (via `pkill`).

### Step 8: Clean (wipe data and re-init)

```bash
bash $WORKDIR/clean.sh
```

This runs `stop.sh`, removes erigon chain data (chaindata, snapshots, txpool, nodes, temp) and lighthouse data, then re-initializes genesis. After clean, start again with Steps 4-5.

## Troubleshooting

| Problem | Solution |
|---------|----------|
| JWT auth fails | Ensure erigon started first and `jwt.hex` exists. Lighthouse must mount the same file. |
| No EL peers | Check firewall allows port 30403. Try adding `--nat=extip:<your-ip>`. |
| No CL peers | Check firewall allows port 9100/9101. ENR bootnodes may have changed — re-fetch from inventory. |
| "Head is optimistic" | Normal during initial sync. Erigon is behind Lighthouse. Will resolve as erigon catches up. |
| Engine API timeout | Check erigon is running and authrpc port 8651 is accessible. |
| Port conflict | Check `ss -tlnp | grep <port>`. Kill conflicting process or use higher offset. |
2 changes: 1 addition & 1 deletion .github/workflows/qa-constrained-tip-tracking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: [ self-hosted, qa, "${{ matrix.backend }}", tip-tracking ]
timeout-minutes: 780 # 13 hours
env:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version-main/datadir
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version/datadir
ERIGON_TESTBED_DATA_DIR: /opt/erigon-testbed/datadir
ERIGON_QA_PATH: /home/qarunner/erigon-qa
TRACKING_TIME_SECONDS: 7200 # 2 hours
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/qa-rpc-integration-tests-gnosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
cancel-in-progress: true
runs-on: [ self-hosted, qa, Gnosis, rpc-integration ]
env:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/gnosis-reference-version/datadir
ERIGON_TESTBED_AREA: /opt/erigon-testbed
ERIGON_QA_PATH: /home/qarunner/erigon-qa
ERIGON_ASSERT: true
Expand All @@ -40,6 +39,21 @@ jobs:
- name: Check out repository
uses: actions/checkout@v6

- name: Set reference data dir based on branch
run: |
# For pull_request events base_ref is the target branch name; for push/dispatch parse from ref.
BRANCH="${{ github.base_ref }}"
if [ -z "$BRANCH" ]; then
BRANCH="${{ github.ref }}"
BRANCH="${BRANCH#refs/heads/}"
fi
if [[ "$BRANCH" == release/* ]]; then
VERSION="${BRANCH#release/}"
echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version-${VERSION}/datadir" >> $GITHUB_ENV
else
echo "ERIGON_REFERENCE_DATA_DIR=/opt/erigon-versions/gnosis-reference-version/datadir" >> $GITHUB_ENV
fi

- name: Clean Erigon Build Directory
run: |
make clean
Expand Down
Loading
Loading