Commit 84d91b8
[SharovBot] fix: reduce genesis MDBX map size on Windows to prevent pagefile exhaustion (#19382)
## Summary
Fixes the reproducible Windows CI failure in
`TestExecutionSpecBlockchain/prague/eip7702_set_code_tx`.
**Failing job:**
https://github.com/erigontech/erigon/actions/runs/22247494407/job/64374046614
## Root Cause
The temporary MDBX database opened in `GenesisToBlock()` was configured
with a **2 TB map size**. This was intentional to support large custom
genesis blocks (e.g., `erigon init` with >1 GB state), but it causes an
immediate crash on Windows:
```
panic: fail to open mdbx: mdbx_env_open: The paging file is too small for this operation to complete.
```
**Why Windows-specific:** On Linux/macOS, MDBX backs large file mappings
with sparse files and copy-on-write pages — only actually-touched pages
consume disk/RAM. On Windows, file-backed mappings (including the
pagefile-backed in-memory ones MDBX uses) must have the **entire map
size reserved** in the system paging file upfront. A 2 TB reservation
far exceeds the CI pagefile minimum of 8 GB, so the `mdbx_env_open` call
fails immediately.
This is not a flaky test — it reproduces every time on any Windows
machine without a >2 TB pagefile.
## Fix
Use **1 GB** as the genesis temp DB map size on Windows. This is:
- Sufficient for any practical genesis block (even very large ones)
- Compatible with the CI pagefile (8 GB minimum, fits even with parallel
test concurrency)
- Preserves the 2 TB ceiling on Linux/macOS where it is harmless
## What Was NOT the Issue
The task description mentioned `setCode=false` in the Prague signer —
but inspecting the current codebase shows that `setCode=true` is
**already correctly set** for Prague in `MakeSigner()`. The `setCode tx
is not supported` log errors visible in the CI logs come from
`CancunToPragueAtTime15k` tests where blocks have timestamps < 15,000
(before Prague activates), which is **expected behavior**. The only real
bug was the MDBX pagefile exhaustion.
## Testing
- `go build ./...` passes ✓
- The fix is platform-conditional: Windows → 1 GB, Linux/macOS → 2 TB
(unchanged)
- On Windows, the genesis temp DB now uses 1 GB, matching the scale of
other test MDBX databases
Closes #19378 (prior PR that documented the issue without fixing it)
Co-authored-by: SharovBot <sharovbot@erigon.ci>1 parent 3e4fe1d commit 84d91b8
1 file changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
314 | | - | |
315 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
316 | 326 | | |
317 | 327 | | |
318 | 328 | | |
| |||
0 commit comments