Index Byron-era outputs and spends - #6
Merged
Merged
Conversation
Jimbo4350
force-pushed
the
feat/byron-outputs
branch
5 times, most recently
from
September 9, 2026 16:55
e1a8625 to
ae70d2c
Compare
cardano-api exports AdaAssetId only as a constructor of AssetId, so the bare import stopped test/Main.hs compiling.
getBlockTxs returns [] for a Byron block and there is no Tx ByronEra, so the decode entry points indexed nothing from Byron. Read the transactions off byronBlockRaw instead. A Byron output is an address and an ada-only value; a bootstrap address has no credentials, which the query side already handles. The decoder is the only thing that changes. transaction_index is the block's transaction order and spending_input_index the transaction's input order, Byron having no redeemer pointers to align to. Genesis-distributed outputs are in no block, so they stay unindexed. Tested per transaction and from real block bytes: mainnet block 2,160,150 and an epoch boundary block, with ids verified against mainnet.
Jimbo4350
force-pushed
the
feat/byron-outputs
branch
from
September 9, 2026 17:01
ae70d2c to
b5158bb
Compare
Jimbo4350
marked this pull request as ready for review
September 9, 2026 17:12
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.
Context
Sieve indexed nothing from Byron. The three decode entry points discarded the era witness and went through
getBlockTxs, which returns[]for aByronBlock, and there is noTx ByronEra. A Byron block was processed as an empty one — not even a checkpoint row — so a sync from origin had no resume point until the first Shelley match, and*meant "Shelley onwards".Shape
byronTxsis all the new plumbing:byronBlockRaw, skip epoch boundary blocks, take the transaction payload. A Byron output is an address and an ada-only value.Nothing downstream changes. Bootstrap addresses give NULL credentials, which is already the
*/*filter; an ada-only value writes nopoliciesrows. No schema, writer or CLI change. One new library dep,cardano-ledger-byron—Cardano.Api.Consensusre-exportsbyronBlockRaw/byronIdTx, and the conversions already exist, so there is no new conversion code.Worth reviewing
transaction_indexis the block's transaction order;spending_input_indexis the transaction's input order, Byron having no redeemer pointers to align to. Both are pinned by tests.How to trust it
Clean build, no warnings,
fourmoluapplied, 62 tests pass (11 new).Per transaction: address round-trips to base58, ada-only value, positional output indices, NULL credentials, no assets,
*matches and*/*does not, a spend's consumed reference byte-identical to the producing output's, inputs indexed in transaction order.From real block bytes, the only way to reach the
BlockInModedispatch: mainnet block 2,160,150 (six transactions) and an epoch boundary block, vendored from cardano-rpc's golden files. 17 outputs across 2,2,2,2,7,2, 17 spends across 2,10,2,1,1,1, ids verified against mainnet.A mainnet sync of origin..4,000,000 indexed 4,460,109 outputs; 200 sampled outputs render identically to a reference index.