-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat(e2e): added timeout tests and switch to seconds in timestamps #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes mostly look reasonable to me. I just left two comments with what I believe to be the implications. Let me know if you agree with that or not :) If we are OK with those, I think we can just merge this.
uint64 nanoTimestamp = uint64(block.timestamp * 1_000_000_000); | ||
if (msg_.packet.timeoutTimestamp <= nanoTimestamp) { | ||
revert IBCInvalidTimeoutTimestamp(msg_.packet.timeoutTimestamp, nanoTimestamp); | ||
if (msg_.packet.timeoutTimestamp <= block.timestamp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implications of this, combined with the packetCommitment creation that changes from seconds to nanoseconds, as far as I can tell are:
- The packet from the other chain will need to use seconds
- The packet commitment from the other chain will need to also commit to nanoseconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The packet commitment from the other chain is ibc-go, so it already uses nanoseconds.
We do not impose any requirements on the packet being submitted to the counterparty chain. We only require that packets submitted to this chain by the relayer use seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see. All packet and light clients need to be nanoseconds on ibc-go and all packets and light clients need to be second in the evm implementation. And the relayers just need to translate the timestamps, is that correct?
uint64 nanoTimestamp = uint64(block.timestamp * 1_000_000_000); | ||
if (msg_.timeoutTimestamp <= nanoTimestamp) { | ||
revert IBCInvalidTimeoutTimestamp(msg_.timeoutTimestamp, nanoTimestamp); | ||
if (msg_.timeoutTimestamp <= block.timestamp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implications for sending packets like this would only be that the light client needs to use seconds (since that is what it will check against for a timeout). That seems both reasonable and easy to reason about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp1 light client is already using seconds for timestamps
No description provided.