Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendIBCTransfer bug with sequence numbers larger than max int #977

Closed
KyleMoser opened this issue Feb 12, 2024 · 1 comment · Fixed by #990
Closed

SendIBCTransfer bug with sequence numbers larger than max int #977

KyleMoser opened this issue Feb 12, 2024 · 1 comment · Fixed by #990
Assignees

Comments

@KyleMoser
Copy link

In interchaintest/chain/cosmos/cosmos_chain.go SendIBCTransfer , there appears to be a bug...

seqNum, err := strconv.Atoi(seq)
    if err != nil {
        return tx, fmt.Errorf("invalid packet sequence from events %s: %w", seq, err)
    }
    tx.Packet.Sequence = uint64(seqNum)

Defined in ICS-4, sequences are int64 type. The call to strconv.Atoi treats it as an int type. It should use strconv.ParseInt(seq, 10, 64).

@pharr117
Copy link
Contributor

pharr117 commented Feb 13, 2024

@KyleMoser I see this definition of Packet in ICS-4:

https://github.com/cosmos/ibc/blob/ded4eb44d8c6b4d32d386728414bec3999fa069a/spec/core/ics-004-channel-and-packet-semantics/README.md?plain=1#L119-L128

Sequence looks like a uint64 in the above, so I believe we should be parsing with ParseUint. Its also being cast to uint64 after parsing and during assignment to tx.Packet.Sequence. Please let me know if I am wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants