feat(minibf): add /scripts/{script_hash}/redeemers endpoint - #1199
Draft
slowbackspace wants to merge 4 commits into
Draft
feat(minibf): add /scripts/{script_hash}/redeemers endpoint#1199slowbackspace wants to merge 4 commits into
/scripts/{script_hash}/redeemers endpoint#1199slowbackspace wants to merge 4 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
slowbackspace
force-pushed
the
feat/minibf-scripts-redeemers
branch
3 times, most recently
from
August 13, 2026 13:19
e78f74c to
559b91b
Compare
Scan the union of the archive dimensions a script can leave traces in
(script bytes, payment credential, policy, stake credential), then match
each redeemer to its script per tx. This finds executions through
reference scripts, which carry no script bytes in the tx.
The redeemer-to-script matching now also covers cert and reward
purposes, so /txs/{tx_hash}/redeemers reports script_hash for those
too.
… scan - blocks_by_tag_stream now delegates to blocks_by_tags_stream: one copy of the chunked cursor logic remains - the scripts handler reuses log_and_500 instead of hand-rolled tracing + 500 closures - the RedeemerTag-to-purpose policy (including the vote/propose gap) lives in mapping.rs, once per generated enum - by_hash_redeemers keeps HTTP concerns; scan_script_redeemers owns the scan loop, with prices_for_epoch as the memoized pparams lookup No behavior change: route tests and the official Blockfrost fixtures pass unchanged.
The scripts redeemers scan derives candidates from side-effect dimensions, and governance redeemers leave no side effect any dimension tags. Resolve the redeemer-to-script matching once, at index time, and tag each executed script under a new script_redeemers dimension. - the matcher moves to pallas_extras with a generic error type and gains vote and propose arms (voter credential, proposal policy script); the endpoints keep their Blockfrost-parity output, so the new purposes surface only as tags for now - index_block tags every resolvable execution, phase-2-failed txs included: tags are candidates, the Blockfrost rule stays a query-time filter - the scripts redeemers union gains the new dimension as its first key; stores synced before this commit lack the tags, and the union keeps those complete - redb3 (deprecated backend) gets the table and arms so the dimension works there too - the stele goldens re-pin: the canonical indexes layer carries one record per dimension, so its diffId, record count and inscription digest change deliberately
The union of side-effect dimensions existed to keep old stores complete while the script_redeemers dimension was new. Precedent says the transition story is a resync (#974, #976 shipped their dimensions the same way), so drop the union: the endpoint scans the exact dimension and nothing else. This removes the noise cases entirely — deposits into a script address and transfers of a policy's assets no longer produce candidate blocks. With the union gone, nothing needs a multi-tag scan anymore. Remove blocks_by_tags_stream and restore blocks_by_tag_stream to its original single-tag form. A store synced before the dimension serves only post-upgrade history on this endpoint; full history needs a store synced from scratch or a snapshot cut from one. Also rewraps a goldens doc comment that failed the nightly fmt gate.
slowbackspace
force-pushed
the
feat/minibf-scripts-redeemers
branch
from
August 13, 2026 13:24
559b91b to
14602cc
Compare
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 #1077.
What
GET /scripts/{script_hash}/redeemerswithcount/page/orderpagination and the Blockfrost 404/empty-page semantics.script_redeemersdimension, streamed throughblocks_by_script_redeemers_streamindolos-cardano. The endpoint scans that dimension alone — see the dimension section below for why query-time derivation cannot work.redeemer_script_hashfunction. It now covers spend, mint, cert, and reward. As a side effect,/txs/{tx_hash}/redeemersnow fillsscript_hashfor cert and reward redeemers (it returned an empty string before).Verification
Nonecases and key-credential negatives.blockfrost-testssuite against a synced preview node: the strict golden fixture for this endpoint (112 rows, exact db-sync fees) passes, plus all pagination-error fixtures and thetxs/:tx/redeemersregression tests.The script_redeemers dimension
Deriving candidates at query time cannot be complete: an execution through a reference script carries no script bytes, and governance redeemers (vote, propose) leave no side effect that any dimension tags. So the endpoint is backed by an index-time dimension, following the precedent of #974 (ACCOUNT_WITHDRAWALS) and #976 (POOL_CERTS):
index_blockresolves each redeemer to its script — a shared matcher inpallas_extras, covering all six purposes including vote (the voter's credential) and propose (the proposal's policy script) — and tags the executed script underscript_redeemers.Operational note (release-note material): a store synced before this change serves only post-upgrade history on
/scripts/{script_hash}/redeemers. Full history needs a store synced from scratch, or a snapshot cut from one — the same transition model as #974/#976.Known limits / follow-ups
🤖 Generated with Claude Code