Skip to content

fix ibc sent packet inner tx id hash parsing#441

Merged
Fraccaman merged 3 commits intomainfrom
tiago/fix-ibc-sent-packet-acks
Dec 4, 2025
Merged

fix ibc sent packet inner tx id hash parsing#441
Fraccaman merged 3 commits intomainfrom
tiago/fix-ibc-sent-packet-acks

Conversation

@sug0
Copy link
Collaborator

@sug0 sug0 commented Dec 2, 2025

TODO: write a unit test to cover this fn

pub fn get_ibc_packets(
    block_results: &BlockResult,
    txs: &[(WrapperTransaction, Vec<InnerTransaction>)],
) -> Vec<IbcSequence>;

@sug0 sug0 marked this pull request as ready for review December 4, 2025 14:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical bug in IBC sent packet inner transaction hash parsing and refactors the IBC transaction type system. The main change introduces a three-tiered fallback mechanism for extracting transaction IDs from IBC packets: first from event attributes, then by detecting internal address senders (PGF funding), and finally falling back to legacy transaction list extraction for backward compatibility with older Namada versions. Additionally, IbcTrasparentTransfer is split into directional variants (IbcSendTrasparentTransfer and IbcRecvTrasparentTransfer) to better distinguish between sending and receiving transfers.

Key changes:

  • Implements inner transaction hash extraction from event attributes with fallback strategies for legacy support and internal transfers
  • Refactors IbcTrasparentTransfer enum into send/recv variants to properly distinguish transfer direction
  • Adds comprehensive test coverage for the get_ibc_packets function covering all three extraction paths

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
transactions/src/services/tx.rs Implements new tx_id extraction logic with three-tiered fallback, adds test coverage for get_ibc_packets, updates gas estimation to handle split IBC transaction types
shared/src/transaction.rs Splits IbcTrasparentTransfer into send/recv variants, adds is_sent_ibc() method, adds Eq/PartialEq derives for IbcSequence, adds Default derive for Fee
shared/src/utils.rs Updates transaction kind mapping to use new IbcSendTrasparentTransfer and IbcRecvTrasparentTransfer variants
shared/src/block_result.rs Adds inner_tx_hash field to Event struct, implements IbcPacket helper methods (as_fungible_token_packet, id), adds try_parse_inner_tx_hash function
shared/src/block.rs Updates pattern matching for split IBC transaction types across balance extraction and IBC token operations
orm/src/transactions.rs Updates database mapping to handle both IbcSendTrasparentTransfer and IbcRecvTrasparentTransfer as IbcTransparentTransfer in DB
justfile Adds support for passing additional arguments to test command

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

@Fraccaman Fraccaman merged commit 6af4d19 into main Dec 4, 2025
72 of 84 checks passed
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