Commit 8c07d53
cmd/utils/app: process all files passed to import command (erigontech#21513)
## Problem
The Hive `legacy-cancun` BlockchainTests suite intermittently fails 4
tests with `client did not start: timed out waiting for container
startup`:
- `walletReorganizeOwners_{Cancun,Istanbul,London,Paris}`
(e.g. [this
run](https://hive.ethpandaops.io/#/test/generic/1779833679-c7f17208e0b5dbf959b3448bbdaed60e)).
They took ~181s, just over Hive's 180s container-startup timeout. The
same test on other forks (Shanghai/Berlin) and `ForkStressTest_*` sit at
146–150s — right at the cliff.
## Root cause
The `import` command documents multi-file support:
```
USAGE: erigon import [command options] <filename> (<filename 2> ... <filename N>)
```
but `importChain` only processed `cliCtx.Args().First()`, silently
ignoring the rest. That forced Hive's erigon entrypoint into a
one-process-per-block-file loop. For `walletReorganizeOwners` (235 block
files) that is 235 full erigon startups — measured at ~0.5s/process ×
261 = 145s of pure startup, while actual block execution is ~40ms each.
go-ethereum has no such problem: its entrypoint imports every block in
one `geth import` invocation.
## Fix
Iterate every file argument in a single process, tolerating per-file
failures when several files are given (matching go-ethereum). This lets
the hive entrypoint import all blocks in one invocation, collapsing
hundreds of process startups into one (~150s → ~10s).
It also force-disables the embedded MCP server for the one-shot import
(`--mcp.disable`, alongside the existing NAT / downloader /
external-consensus disables) — a batch import has no use for it.
## Companion change (required)
The hive entrypoint must pass all block files in one invocation:
ethereum/hive#1519. Order matters — the hive change depends on this one
(on an old erigon, `import /blocks/*` would import only the first
block).
## Testing
- New unit tests (`import_cmd_test.go`): all-files iteration, per-file
failure tolerance, single-file error surfacing.
- Real-binary check: `erigon import a.rlp b.rlp` now attempts **both**
files in one process (previously stopped after the first).
- `make lint` clean; `make erigon integration` builds.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Giulio Rebuffo <111551070+Giulio2002@users.noreply.github.com>1 parent 74fbe0d commit 8c07d53
2 files changed
Lines changed: 100 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| |||
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
122 | 126 | | |
123 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
124 | 144 | | |
125 | 145 | | |
126 | 146 | | |
| |||
169 | 189 | | |
170 | 190 | | |
171 | 191 | | |
172 | | - | |
| 192 | + | |
173 | 193 | | |
174 | 194 | | |
175 | 195 | | |
| |||
192 | 212 | | |
193 | 213 | | |
194 | 214 | | |
195 | | - | |
| 215 | + | |
196 | 216 | | |
197 | 217 | | |
198 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
0 commit comments