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

delay_period is handled in the wrong unit #927

Closed
5 tasks
soareschen opened this issue May 11, 2021 · 1 comment · Fixed by #931
Closed
5 tasks

delay_period is handled in the wrong unit #927

soareschen opened this issue May 11, 2021 · 1 comment · Fixed by #931
Assignees
Labels
A: bug Admin: something isn't working

Comments

@soareschen
Copy link
Contributor

soareschen commented May 11, 2021

Crate

ibc

Summary of Bug

In ibc-go, the delay_period field is processed as nanoseconds, but in ibc-rs, the delay_period is converted to and from seconds using Duration::from_secs and .as_secs().

Example of erroneous conversion:

Acceptance Criteria

  • Change uses of delay_period in ibc-rs when converting to/from RawMsgConnectionOpenTry to use nanoseconds.
  • The CLI will continue using .as_seconds() to display the result in seconds.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ancazamfir
Copy link
Collaborator

Good catch! We knew it's in nanoseconds but when we changed the CLI parameter from nanoseconds to seconds we introduced the conversion errors.
Was curious as I was testing this a lot, so did a quick test with correct units and all looks good. Because we were consistent in our conversion mistakes, the delay introduced in packet relaying was correct (for both recv packets and timeouts). We were just preventing the on-chain validation to catch any cases we weren't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Admin: something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants