Skip to content

feat: migrate producer to upstream create-snapshots + bootstrap#42

Merged
paolino merged 6 commits into
mainfrom
chore/bump-amaru-rebased
Jun 5, 2026
Merged

feat: migrate producer to upstream create-snapshots + bootstrap#42
paolino merged 6 commits into
mainfrom
chore/bump-amaru-rebased

Conversation

@paolino

@paolino paolino commented May 18, 2026

Copy link
Copy Markdown
Contributor

Bumps amaru to upstream pragma-org/amaru main and migrates the bootstrap producer off the removed ledger-state-emitter/convert-ledger-state/import-* commands onto upstream's create-snapshots + bootstrap.

amaru pinned to lambdasistemi/amaru@feat/testnet-bootstrap (upstream main + a minimal, upstreamable delta: create-snapshots --targets-file/--cardano-db-dir, runtime --era-history-file/--global-parameters-file, the testnet tvar era-history sidecar fix, short-epoch saturate/forecast/consensus guards).

  • producer: targets.json + snapshots.json from header-extractor -> create-snapshots (isolated cardano-db view) -> era sidecars -> amaru bootstrap (derives nonces, imports headers). New bundle contract: ledger.db + chain.db + era-history.json.
  • relay image: bundle db-analyser; bundle_complete no longer requires nonces.json.
  • checks/bats updated; short-epoch golden reframed to producer + amaru run --era-history-file.

Verified: full nix build-gate green; live epoch-120 short-epoch follow cluster PASS - amaru follows across epochs 3->9 (slot 1088) with zero fatal errors.

@paolino paolino added the chore Maintenance label May 18, 2026
@paolino paolino self-assigned this May 18, 2026
Repoint flake from lambdasistemi/amaru/main to
lambdasistemi/amaru/feat/antithesis-testnet-support. The new branch
carries the same 11-patch stack (runtime testnet params, era-history
flags, ledger rotation/forecast/saturation fixes) rebased onto
pragma-org/amaru@bc90e534 — 65 commits ahead of the prior base.

Only flake.nix amaru ref and flake.lock amaru entry change. iohkNix
and blst are unchanged — the upstream supranational/blst tarball
shifted content under our pinned rev, but CI's fetch path still
returns v0.3.14 (matching the lock); locally only override-input
works around the regional content shift. Bumping iohkNix to match
local would force CI off the v0.3.14 content. Local builds verified
via override-input.
@paolino

paolino commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

The Live Bootstrap Producer step is currently blocked by an upstream
supranational/blst tarball content shift on commit
6d960cd05d6fe2b5bc9ba161edf0c1a131b87c4c:

  • The lock's recorded narHash (sha256-IlbN..., v0.3.14 content)
    matches what the runner that ran Build Gate fetched.
  • A different runner that ran the Live Bootstrap Producer step
    refetched at the same rev and got sha256-Q9/z... (v0.3.15
    content), failing the narHash check.
  • curl https://github.com/supranational/blst/archive/6d960cd0…tar.gz
    from this host now returns v0.3.15 in bindings/rust/Cargo.toml.
    Origin/main's CI green is therefore cache-luck only.

This is orthogonal to the amaru rebase. The image was built locally
against this PR's lock (--override-input iohkNix/blst <local-path>
to bypass the regional fetch shift) and pushed manually to GHCR as
ghcr.io/lambdasistemi/amaru-bootstrap-producer:bab6ba6836997c226cd5b0c05bc269bdf76403db
to unblock the Antithesis consumer-side validation in
cardano-node-antithesis#152.

PR stays draft until either (a) the blst pin is moved to a stable
source in a separate PR, or (b) CI cache happens to match the lock
again on a re-run.

paolino added 3 commits June 5, 2026 10:26
Replace the removed ledger-state-emitter/convert-ledger-state/import-* pipeline
with amaru create-snapshots (--targets-file/--cardano-db-dir to bypass
Koios/Mithril) followed by amaru bootstrap, which derives nonces and imports
packaged headers. Pin amaru to feat/testnet-bootstrap.

- bootstrap-producer.sh: targets.json + snapshots.json from header-extractor,
  isolated cardano-db view (don't mutate the operator chain DB), era-history
  sidecars + bundle era-history.json, run bootstrap from the staging CWD.
- new bundle contract: ledger.<net>.db + chain.<net>.db + era-history.json
  (nonces/headers baked into chain.db by bootstrap).
- checks: db-analyser on producer PATH; reframe short-epoch samples/golden to
  producer + amaru run --era-history-file; grow short-epoch corpus to 3000 slots.
- bats: rewrite sparse-boundaries/history for the new pipeline.
Two deployment-path bugs the create-snapshots/bootstrap producer migration
introduced for the relay image (not covered by the nix checks, caught by the
live short-epoch follow cluster):

- bootstrap-producer-image: add db-analyser to runtimeInputs + contents.
  create-snapshots shells out to db-analyser, which was absent from the image,
  so the relay's bootstrap looped forever with 'db-analyser was not found'.
- amaru-relay-bootstrap: bundle_complete no longer requires nonces.json; nonces
  + bootstrap headers are baked into chain.<net>.db by 'amaru bootstrap'. The
  stale check made the relay re-bootstrap endlessly and never exec amaru.

Verified: amaru-relay-1 follows a live epoch-120 short-epoch chain past slot
1088 (epochs 3..9) with zero fatal errors.
@paolino paolino changed the title chore(deps): rebase amaru fork onto upstream main feat: migrate producer to upstream create-snapshots + bootstrap Jun 5, 2026
@paolino paolino marked this pull request as ready for review June 5, 2026 12:59
paolino added 2 commits June 5, 2026 14:04
test-bootstrap-producer-live.bats still asserted nonces.json / snapshots/*.cbor
/ headers/* — the pre-bootstrap contract. amaru bootstrap bakes nonces+headers
into chain.<net>.db; assert era-history.json + >=3 ledger snapshot dirs instead.
This is the only check gated behind Docker (Live Bootstrap Producer CI), so it
was missed by the build-gate.
The lock pinned blst at the v0.3.15 rev (6d960cd) but recorded v0.3.14's
narHash; GitHub now serves v0.3.15 content for that rev in some regions,
intermittently breaking the lock both locally (always) and in CI (flaky:
Smoke Test failed on narHash mismatch). Pin iohk-nix's blst input to the
v0.3.14 tag rev (8c7db7fe), which iohk-nix's crypto overlay expects and which
hashes deterministically. Removes the need for the local --override-input.
@paolino paolino merged commit fba902d into main Jun 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant