Skip to content

ingest: expose fee-bump inner hashes on the view extractors#5964

Merged
tamirms merged 1 commit into
mainfrom
feebump-inner-hash-extract
Jul 16, 2026
Merged

ingest: expose fee-bump inner hashes on the view extractors#5964
tamirms merged 1 commit into
mainfrom
feebump-inner-hash-extract

Conversation

@tamirms

@tamirms tamirms commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What

ExtractLedgerEvents now reports a fee-bump transaction's inner hash alongside its transaction hash: new InnerHash [32]byte and FeeBump bool fields on LedgerTransactionEvents. Both hashes are values with identical lifetimes (the aliasing convention stays reserved for the variable-length event payloads), and InnerHash is meaningful iff FeeBump. LedgerTransactionViewByHash resolves a fee-bump by either of its hashes, still pairing the envelope by the outer hash.

Why

A transaction hash index built from the extraction walk needs both hashes to resolve fee-bumps the way the classic reader path does (the parsed LedgerTransaction already exposes the inner hash via its result pair). The first consumer is the full-history getTransaction index in stellar/stellar-rpc: it indexes from this walk, and indexing only the outer hash regressed inner-hash lookups relative to the SQLite path, which stores both hashes.

Performance

Both hashes come from the one TxProcessing walk; the inner hash is read from the result pair the walk already visits and stored inline in the output element, so there is no extra pass and no allocation. Benchmarks on the real pubnet ledger fixture (M1 Max, benchstat, n=10) against main:

  • ExtractLedgerEvents/view: -1.3% sec/op, allocations identical to main
  • LedgerTransactionViewByHash view variants: -1.7% to -3.0% sec/op

Tests

The fee-bump fixture now carries a real txFEE_BUMP_INNER_SUCCESS result with its inner result pair, and new tests cover extraction (inner hash present for fee-bumps, nil otherwise) and by-hash lookup through both hashes, including the reversed-TxSet envelope pairing case.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes fee-bump inner transaction hashes through view-based ingestion APIs.

Changes:

  • Extracts outer and inner hashes in one processing walk.
  • Supports fee-bump lookup by either hash.
  • Adds fee-bump fixtures and lookup/extraction tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
ingest/transaction_view.go Resolves fee-bumps by outer or inner hash.
ingest/transaction_view_test.go Adds fee-bump result fixtures and tests.
ingest/ledger_close_meta_view_nav.go Extracts both hashes from result views.
ingest/extract.go Exposes the inner hash in ledger events.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tamirms
tamirms force-pushed the feebump-inner-hash-extract branch from 1821f3e to c98f3db Compare July 16, 2026 10:13
A fee-bump transaction is resolvable by two hashes: its own (result-pair)
hash and the inner transaction's. ExtractLedgerEvents now carries the
inner hash (read from the same TransactionResultPair the walk already
visits, so no extra pass), and LedgerTransactionViewByHash matches either
hash, pairing the envelope by the outer hash as before. This lets a
tx-hash index built from the extraction walk resolve fee-bumps by inner
hash, matching the classic reader path's behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tamirms
tamirms force-pushed the feebump-inner-hash-extract branch from c98f3db to 3f629ee Compare July 16, 2026 10:27
@tamirms
tamirms requested a review from a team July 16, 2026 10:35
@tamirms
tamirms merged commit 2bfffb1 into main Jul 16, 2026
11 checks passed
@tamirms
tamirms deleted the feebump-inner-hash-extract branch July 16, 2026 14:58
tamirms added a commit to stellar/stellar-rpc that referenced this pull request Jul 16, 2026
The v1 RPC stores getTransaction lookup entries for both a fee-bump's
hashes (outer and inner); full-history indexed only the outer, so
getTransaction(innerHash) regressed to not-found. Both txhash writers now
emit one entry per hash — two for a fee-bump — using the inner hash the
SDK's extraction walk exposes from the result pair it already visits. The
read path needs no change: LedgerTransactionViewByHash resolves either
hash since the same SDK change.

Requires the go-stellar-sdk fee-bump inner-hash extractors
(stellar/go-stellar-sdk#5964), pinned by the go.mod bump.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tamirms added a commit to stellar/stellar-rpc that referenced this pull request Jul 16, 2026
The v1 RPC stores getTransaction lookup entries for both a fee-bump's
hashes (outer and inner); full-history indexed only the outer, so
getTransaction(innerHash) regressed to not-found. Both txhash writers now
emit one entry per hash — two for a fee-bump — using the inner hash the
SDK's extraction walk exposes from the result pair it already visits. The
read path needs no change: LedgerTransactionViewByHash resolves either
hash since the same SDK change.

Requires the go-stellar-sdk fee-bump inner-hash extractors
(stellar/go-stellar-sdk#5964), pinned by the go.mod bump.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tamirms added a commit to stellar/stellar-rpc that referenced this pull request Jul 16, 2026
The v1 RPC stores getTransaction lookup entries for both a fee-bump's
hashes (outer and inner); full-history indexed only the outer, so
getTransaction(innerHash) regressed to not-found. Both txhash writers now
emit one entry per hash — two for a fee-bump — using the inner hash the
SDK's extraction walk exposes from the result pair it already visits. The
read path needs no change: LedgerTransactionViewByHash resolves either
hash since the same SDK change.

Requires the go-stellar-sdk fee-bump inner-hash extractors
(stellar/go-stellar-sdk#5964), pinned by the go.mod bump.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tamirms added a commit to stellar/stellar-rpc that referenced this pull request Jul 16, 2026
The v1 RPC stores getTransaction lookup entries for both a fee-bump's
hashes (outer and inner); full-history indexed only the outer, so
getTransaction(innerHash) regressed to not-found. Both txhash writers now
emit one entry per hash — two for a fee-bump — using the inner hash the
SDK's extraction walk exposes from the result pair it already visits. The
read path needs no change: LedgerTransactionViewByHash resolves either
hash since the same SDK change.

Requires the go-stellar-sdk fee-bump inner-hash extractors
(stellar/go-stellar-sdk#5964), pinned by the go.mod bump.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tamirms added a commit to stellar/stellar-rpc that referenced this pull request Jul 16, 2026
The v1 RPC stores getTransaction lookup entries for both a fee-bump's
hashes (outer and inner); full-history indexed only the outer, so
getTransaction(innerHash) regressed to not-found. Both txhash writers now
emit one entry per hash — two for a fee-bump — using the inner hash the
SDK's extraction walk exposes from the result pair it already visits. The
read path needs no change: LedgerTransactionViewByHash resolves either
hash since the same SDK change.

Requires the go-stellar-sdk fee-bump inner-hash extractors
(stellar/go-stellar-sdk#5964), pinned by the go.mod bump.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

3 participants