fix ibc sent packet inner tx id hash parsing#441
Conversation
There was a problem hiding this comment.
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
IbcTrasparentTransferenum into send/recv variants to properly distinguish transfer direction - Adds comprehensive test coverage for the
get_ibc_packetsfunction 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.
TODO: write a unit test to cover this fn