Skip to content

feat!: emit bundle format v2 with next_scp and next_transactions - #32

Merged
samjay8 merged 2 commits into
mainfrom
feat/bundle-v2
Nov 8, 2026
Merged

samjay8 merged 2 commits into
mainfrom
feat/bundle-v2

Conversation

@samjay8

@samjay8 samjay8 commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Emit externalize/bundle/v2: two new required fields, next_scp and next_transactions (ledger N+1's ScpHistoryEntry and TransactionHistoryEntry). Validators sign only StellarValue. Ledger N+1's externalized txSetHash commits to its transaction set, and that set carries previousLedgerHash = SHA-256(header N), so these two records bind the rest of header N. Pairs with the verifier's fix/certify-header.

  • When N ends its checkpoint, the successor's records are fetched from the next checkpoint. If that checkpoint isn't published yet, exnode bundle fails with a retry message and the HTTP routes return 503 with Retry-After and no-store. A bundle is never emitted without the two fields.
  • /v1/ledgers/latest/bundle now redirects to the ledger before the archive tip, the newest one whose successor is archived. exnode status prints it.
  • /v1/transactions/{hash}/bundle now accepts txset=true.
  • testdata/bundle-64791359.json was regenerated as v2 from https://history.stellar.org/prd/core-live/core_live_001/, using checkpoint 03dca33f plus scp/transactions 03dca37f for ledger 64791360. All v1 fields are byte-identical to before. Fixtures were added for the boundary, mid-checkpoint, not-yet-published and testnet cases.
  • README, OpenAPI and CHANGELOG (Unreleased) are updated.

Verified: externalize verify built from fix/certify-header (d2139a8) accepts the regenerated fixture (--events, with both claims proven). It also accepts two live mainnet bundles from this branch: 65366975, a checkpoint boundary, and 65367038, mid-checkpoint. Ledger 65367039, the archive tip, correctly fails with "retry in a few minutes".

Known: the CI conformance job compares against the verifier's main fixture, which is still v1. It will fail until the verifier's v2 fixture lands.

Validators sign only a ledger's StellarValue, so v1 bundles left the rest
of the header (txSetResultHash, previousLedgerHash) unbound. v2 adds
ledger N+1's ScpHistoryEntry and TransactionHistoryEntry: N+1's
externalized txSetHash commits to its transaction set, whose
previousLedgerHash is SHA-256(header N).

- Fetch the successor's records, from the next checkpoint when N ends
  one; if it is not published yet, fail with a retry message (HTTP 503
  with Retry-After, never cached) instead of emitting a partial bundle.
- latest redirects to the ledger before the archive tip.
- Add txset=true to /v1/transactions/{hash}/bundle.
- Regenerate testdata/bundle-64791359.json as v2 from SDF's mainnet
  archive and add successor fixtures for mainnet and testnet.
@samjay8
samjay8 marked this pull request as ready for review November 8, 2026 21:19
@samjay8
samjay8 merged commit 9193ce6 into main Nov 8, 2026
21 of 22 checks passed
@samjay8 samjay8 mentioned this pull request Nov 8, 2026
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.

1 participant