Repository navigation
Prove older ledgers with externalize ancestry - #20
Merged
Merged
Conversation
A certified ledger vouches for its ancestors, but the CLI could only certify ledgers that come with their own SCP messages. externalize ancestry certifies a bundle's ledger, then follows previous-ledger hashes back through archived ledger-*.xdr.gz files to the requested ledger, printing its hash and close time (or --json via report::ancestry). The library side is prove_ancestor: it takes whole archive files, uses only the headers from the target up to the certified ledger, and fails closed: a missing header is Error::MissingHeader naming the ledger, a target that is not older is Error::NotAnAncestor, and a forged header breaks the chain even with its own hash recomputed. Tests use the previous mainnet checkpoint's headers (ledger-03dca2ff, from SDF's archive) to prove ledger 64791250 from 64791359. Closes #3.
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.
Closes #3.
externalize ancestryproves a ledger older than a certified one. It certifies the bundle's ledger (claims included, asverifydoes), then follows previous-ledger hashes back through archivedledger-*.xdr.gzfiles to the requested ledger.--jsonprintsreport::ancestry: the proven ledger, the certifying ledger (the same shape as a verified bundle's), and the number of links. Exit codes matchverify: 0 proven, 1 rejected, 2 could not run.The library side is
prove_ancestor. It accepts whole archive files and uses only the headers from the target up to the certified ledger. It fails closed:Error::MissingHeader(seq), naming the ledger whose archive file to add;Error::NotAnAncestor;Error::BrokenChain.Done-when from the issue
ledger-03dca2ff.xdr.gz, the previous mainnet checkpoint's headers (15 KB, from SDF's archive), and proves 64,791,250 from 64,791,359.ancestry. The trust model, CONTRIBUTING (fixtures) and the CHANGELOG are updated too.Checked
cargo fmt --check,cargo clippy --workspace --all-targets,cargo doc,cargo test --workspace(4 new library tests, 3 new CLI tests), and the wasm32 build ofexternalize-core.