Repository navigation
feat!: emit bundle format v2 with next_scp and next_transactions - #32
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emit
externalize/bundle/v2: two new required fields,next_scpandnext_transactions(ledger N+1'sScpHistoryEntryandTransactionHistoryEntry). Validators sign onlyStellarValue. Ledger N+1's externalizedtxSetHashcommits to its transaction set, and that set carriespreviousLedgerHash = SHA-256(header N), so these two records bind the rest of header N. Pairs with the verifier'sfix/certify-header.exnode bundlefails with a retry message and the HTTP routes return 503 withRetry-Afterandno-store. A bundle is never emitted without the two fields./v1/ledgers/latest/bundlenow redirects to the ledger before the archive tip, the newest one whose successor is archived.exnode statusprints it./v1/transactions/{hash}/bundlenow acceptstxset=true.testdata/bundle-64791359.jsonwas regenerated as v2 fromhttps://history.stellar.org/prd/core-live/core_live_001/, using checkpoint03dca33fplusscp/transactions03dca37ffor ledger 64791360. All v1 fields are byte-identical to before. Fixtures were added for the boundary, mid-checkpoint, not-yet-published and testnet cases.Verified:
externalize verifybuilt fromfix/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
conformancejob compares against the verifier'smainfixture, which is still v1. It will fail until the verifier's v2 fixture lands.