Skip to content

Conversation

@whankinsiv
Copy link
Collaborator

@whankinsiv whankinsiv commented Dec 9, 2025

Description

This PR introduces a new handle_onchain_tx_raw method on the ChainIndex trait.

This allows an index to override tx decoding to process raw bytes rather than a decoded MultiEraTx. This enables integrations (such as the Scooper) that depend on a different Pallas version than Acropolis. Indexes that do not override handle_onchain_tx_raw continue using the existing decoded path semantics with no behavior change.

Related Issue(s)

Relates to #462

How was this tested?

  • Verified that indexes relying on the default decoded mode behave exactly as before.
  • Verified that Scooper integration can decode transactions independently without Pallas dependency collisions.

Checklist

  • My code builds and passes local tests
  • I added/updated tests for my changes, where applicable
  • I updated documentation (if applicable)
  • CI is green for this PR

Impact / Side effects

Existing indexes require no changes. Index authors now have explicit control over how transaction decoding is performed, enabling compatibility with custom or conflicting Pallas versions.

Reviewer notes / Areas to focus

handle_apply_txs in custom_indexer/src/index_actor.rs.

…endent Pallas versions

Signed-off-by: William Hankins <william@sundae.fi>
@whankinsiv whankinsiv requested a review from SupernaviX December 9, 2025 18:47
Comment on lines 23 to 31
/// Low-level transaction handler that receives raw CBOR bytes.
///
/// The indexer runtime calls this when `wants_raw_bytes() == true`.
/// Implementors can parse the bytes using their own Pallas versions,
/// bypass decoding in the runtime, or operate directly on the CBOR.
async fn handle_onchain_tx_bytes(&mut self, info: &BlockInfo, raw_tx: &[u8]) -> Result<()> {
let _ = (info, raw_tx);
Ok(())
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if we make the default implementation of this method parse the bytes itself, and then call its own handle_onchain_tx? Then we don't need wants_raw_bytes

Copy link
Collaborator Author

@whankinsiv whankinsiv Dec 9, 2025

Choose a reason for hiding this comment

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

Updated the default implementation of handle_onchain_tx_bytes to decode and then call handle_onchain_tx in d823216. Thanks for the suggestion!

…bytes

Signed-off-by: William Hankins <william@sundae.fi>
@whankinsiv whankinsiv merged commit cbf6d44 into main Dec 9, 2025
2 checks passed
@whankinsiv whankinsiv deleted the whankinsiv/handle_tx_bytes branch December 9, 2025 20:53
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