Skip to content

feat: add trueblocks support#1404

Merged
barnabasbusa merged 8 commits into
ethpandaops:mainfrom
MysticRyuujin:feat/trueblocks
May 29, 2026
Merged

feat: add trueblocks support#1404
barnabasbusa merged 8 commits into
ethpandaops:mainfrom
MysticRyuujin:feat/trueblocks

Conversation

@MysticRyuujin
Copy link
Copy Markdown
Contributor

@MysticRyuujin MysticRyuujin commented May 19, 2026

Summary

Adds trueblocks as an additional_services option that runs chifra daemon — the TrueBlocks REST API — against a participant EL on container port 8080. Per-chain trueBlocks.toml is rendered for the active network (network_params.network / network_id), and allocs.csv is pre-staged for unknown chains so chifra's archive check passes. Image is published from ethpandaops/eth-client-docker-image-builder#384.

The package runs chifra daemon only. The scraper isn't started automatically — POST /scrape on the daemon (or run chifra scrape against the same data dir) when you want to build the local Unchained Index. The other chifra endpoints (/status, /blocks, /receipts, /transactions, /traces, /logs) work without an index — they're chifra-flavored RPC pass-through.

Configuration

trueblocks_params:
  image: "ethpandaops/trueblocks:v5.9.3"
  # Verbatim RPC URL chifra should target. Leave empty to use
  # all_el_contexts[target_index] (the in-cluster participant).
  target_rpc_url: ""
  target_index: 0
  scrape:                # written into trueBlocks.toml; 0 = network-aware default
    apps_per_chunk: 0
    snap_to_grid: 0
    first_snap: 0
    unripe_dist: 0
  env: {}

Devnet example:

participants:
  - el_type: erigon
    cl_type: lighthouse
additional_services:
  - trueblocks

Notes

chifra's IsNodeArchive does a CSV-vs-RPC consistency check rather than a real archive probe, so it returns false on chains we don't ship a bundled allocs.csv for. The launcher works around it by writing a self-consistent allocs.csv for the active chain in a one-shot plan.run_sh bootstrap (probes the first prefund's actual block-0 balance, drops the rendered toml in alongside the image's bundled per-chain configs, stores the result as a files artifact mounted into the daemon container). Filed upstream: TrueBlocks/trueblocks-core#4044.

We considered khedra (the official chifra daemon + chifra scrape unified successor) but its startup Configured() check requires a reachable mainnet RPC returning chainId 1, which doesn't fit hermetic devnets. Filed upstream: TrueBlocks/trueblocks-khedra#22 — if a headless mode lands, we can migrate.

Test plan

  • Erigon + Lighthouse devnet: daemon comes up healthy, /status returns isArchive: true, isTracing: true, trueblocksVersion: GHC-TrueBlocks//5.9.3; /blocks?blocks=0 returns genesis; /list?addrs=<prefund> returns appearances after a POST /scrape; /chunks?mode=index reflects the new chunk.
  • bal-devnet-7 client images (Erigon + Reth × Lighthouse + Lodestar matrix, fulu @ 0, gloas @ 9): same checks pass against chifra v5.9.3 + erigon 3.5.0.
  • kurtosis lint --format clean; kurtosis run --dry-run clean.

Copy link
Copy Markdown
Collaborator

@barnabasbusa barnabasbusa left a comment

Choose a reason for hiding this comment

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

this looks a bit too vibe cody, even for me

Comment thread src/trueblocks/Dockerfile Outdated
Comment thread src/trueblocks/trueblocks_launcher.star Outdated
Comment thread src/trueblocks/trueblocks_launcher.star Outdated
Comment thread src/trueblocks/trueblocks_launcher.star Outdated
Comment thread src/trueblocks/trueblocks_launcher.star Outdated
@MysticRyuujin
Copy link
Copy Markdown
Contributor Author

Pushed 8589219 addressing review feedback:

  • Dockerfile deleted — chifra image is now built in eth-client-docker-image-builder (companion: ethpandaops/eth-client-docker-image-builder#384)
  • ImageBuildSpec path removed; the service now just pulls ethpandaops/trueblocks:v5.9.3
  • Bootstrap shell logic (chifra config setup, allocs.csv probe, scrape retry loop, daemon exec) moved out of the launcher and into the image's entrypoint.sh — the launcher just renders trueBlocks.toml and sets a handful of TB_* env vars
  • Comment block in _build_entrypoint_cmd deleted (function itself is gone); a single 4-line comment remains explaining the one chifra quirk we still work around
  • version param dropped from trueblocks_params (it was only for the now-removed source build); image is the only knob

Net diff vs the original commit: -219/+28 lines across 7 files (launcher trimmed from ~280 → 162 lines).

On the IsNodeArchive workaround you flagged ("don't we know if a node is archive or not?") — turns out the function is misnamed: it does a CSV-vs-RPC consistency check rather than a real archive-mode probe. Filed upstream with a proposed fix: TrueBlocks/trueblocks-core#4044. The workaround now lives in entrypoint.sh in the image-builder PR and can be removed once that lands upstream.

End-to-end re-tested with the new image + simplified launcher on an Erigon + Lighthouse devnet: isArchive: true, isTracing: true, scraper produced the first finalized chunk, /status / /blocks / /list / /chunks all return expected data.

@MysticRyuujin MysticRyuujin marked this pull request as draft May 19, 2026 23:35
@MysticRyuujin
Copy link
Copy Markdown
Contributor Author

Pushed 33dc5ff. Simplified further on top of the prior round:

  • The image is now just chifra + bundled per-chain configs; no entrypoint script, no env-var contract. Companion PR was simplified to match — vanilla Dockerfile only (#384).
  • Bootstrap moved out of the image and into a plan.run_sh step in the launcher: probes the prefund balance, drops the rendered trueBlocks.toml in, produces a single files artifact, mounts it into the daemon.
  • Dropped auto-scrape entirely. The package runs chifra daemon only; users POST /scrape (or run chifra scrape against the data dir) when they want indexing. Removes the scrape retry loop and the sleep_seconds knob.

Also filed TrueBlocks/trueblocks-khedra#22 — khedra would be the cleaner long-term answer (single-process daemon+scraper), but its startup requires a reachable mainnet RPC returning chainId 1, which doesn't fit hermetic devnets. If that lands we can migrate.

@MysticRyuujin MysticRyuujin marked this pull request as ready for review May 20, 2026 00:20
barnabasbusa added a commit to ethpandaops/eth-client-docker-image-builder that referenced this pull request May 20, 2026
## Summary

Adds an `ethpandaops/trueblocks` image build (`chifra` from
`TrueBlocks/trueblocks-core`). Consumed by
[ethpandaops/ethereum-package#1404](ethpandaops/ethereum-package#1404)
to run the chifra daemon as a kurtosis additional service. TrueBlocks
stopped publishing official Docker images after `v5.0.0`.

## Files

| File | Purpose |
| --- | --- |
| `trueblocks/Dockerfile` | Multi-stage build, `golang:1.25.1-bookworm`
→ `debian:bookworm-slim`, ENTRYPOINT chifra |
| `.github/workflows/build-push-trueblocks.yml` | Manual build workflow
(modeled on `build-push-slashoor.yml`) |
| `branches.yaml` | Adds `trueblocks: [main, v5.9.3]` |
| `platforms.yaml` | Adds `trueblocks: [linux/amd64, linux/arm64]` |
| `generate_config.py` | Adds `'trueblocks':
'TrueBlocks/trueblocks-core'` to `DEFAULT_REPOS` |
| `README.md` | Tooling workflows list addition |

The image also ships chifra's bundled per-chain configs (`allocs.csv`
etc.) from `src/other/install/per-chain/`.

## Test plan

- [x] Local build via `docker buildx build --file
./trueblocks/Dockerfile <source>` against `v5.9.3` — succeeds, image is
139 MB.
- [x] End-to-end via
[ethereum-package#1404](ethpandaops/ethereum-package#1404)
on an Erigon + Lighthouse devnet: chifra daemon comes up, `/status`
returns `isArchive: true`, `trueblocksVersion: GHC-TrueBlocks//5.9.3`;
`/blocks`, `/list`, `/chunks` all respond.
- [ ] Trigger the workflow once after merge to publish the first
`ethpandaops/trueblocks:v5.9.3` and `ethpandaops/trueblocks:main` tags.

---------

Signed-off-by: Chase Wright <chase.wright@ethereum.org>
Co-authored-by: Barnabas Busa <barnabas.busa@ethereum.org>
@barnabasbusa barnabasbusa enabled auto-merge (squash) May 29, 2026 07:54
@barnabasbusa barnabasbusa merged commit b9231ac into ethpandaops:main May 29, 2026
17 checks passed
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