This project is a simple proof of concept to reproduce a bug in IBC transactions through ibc-go, specifically related to packet timeout block height.
The bug occurs when executing an IBC transaction using --packet-timeout-height 9000-9100 --packet-timeout-timestamp 0. Even when specifying a Revision Number higher than the actual Revision Number of the chain, the transaction is processed normally without any errors.
When specifying a Revision Number higher than the actual Revision Number, the system should consider it an invalid timeout setting and return an error.
Even when specifying a Revision Number higher than the actual Revision Number, the transaction is processed normally without any errors.
- ibc-go version: v8.7.0
- Hermes version: v1.7.4
- Docker and Docker Compose
- jq
- curl
git clone https://github.com/lapidix/ibc-timeout-bug-poc.git
cd ibc-timeout-bug-pocmake startmake ibc-txmake fetch-tx# Clean only transaction data
make clean-tx
# Clean all data and stop Docker containers
make stop| Command | Description |
|---|---|
make start |
Start Docker containers |
make ibc-tx |
Execute IBC transfer, query, and extract send_packet event |
make fetch-tx |
Query transaction via HTTP API and extract send_packet event |
make clean-tx |
Clean only transaction data |
make stop |
Stop Docker containers and clean all data |
make clean |
Clean all data |
make check-ibc |
Check IBC channel status |
make help |
Display help |
After executing a transaction, the following files are created in the tx folder:
latest_tx_hash- The most recent transaction hashtx_[TX_HASH].json- Complete transaction informationsend_packet_[TX_HASH].json- send_packet event information
{
"type": "send_packet",
"attributes": [
{
"key": "packet_timeout_height",
"value": "9001-9138"
},
{
"key": "packet_timeout_timestamp",
"value": "0"
},
{
"key": "packet_sequence",
"value": "1"
},
{
"key": "packet_src_port",
"value": "transfer"
},
{
"key": "packet_src_channel",
"value": "channel-0"
}
]
}The packet_timeout_height field in particular indicates the block height at which the packet timeout occurs. This value plays a crucial role in reproducing the bug.
- Run the
make ibc-txcommand to execute an IBC transaction. - Check the
send_packet_[TX_HASH].jsonfile created in thetxfolder. - Verify the
packet_timeout_heightvalue. It will be displayed in a format like9001-9138. - The first value (9001) represents the Revision Number. The bug is that the transaction is processed successfully even when this value is higher than the actual Revision Number of the network.
- In this project, the actual Revision Number is 1, but we specified an invalid value of 9000 using the
--packet-timeout-height 9000-9100option, and yet the transaction is processed normally.