Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 on a per-connection basis #507
Delay period on a per-connection basis #507
Changes from all commits
e93172e
3fe9439
86ea753
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
My understanding is that
delayPeriod
is a parameter defined by the chain to provide security to its users. Shouldn't it be reasonable to give each side of the connection possibility to choosedelayPeriod
? Also what happen in crossing hello case when differentdelayPeriod
is chosen by counter parties?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.
I don't think chains are defining the delay period in this implementation. As you say, each side of the conenction has the possibility to choose the
delayPeriod
.In the case of crossing hello's, the connection handshake will succeed with different delay periods. It can be viewed the same as if the crossing hellos selected different client identifiers (they cannot connect with each other because they have different parameters)
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.
I think you mean to say it will fail.
We want the initiator of the handshake to define the
delayPeriod
on both ends. Consider that I want to create a connection with ChainA and chainB, and I want to use thedelayPeriod
feature to protect packets going across this connection from misbehaviour on either side.I submit a
ConnOpenInit
to chainA with adelayPeriod=60
. Now, I intend to also set adelayPeriod
on chainB, however another relayer has submitted aConnOpenTry
before me on chainB withdelayPeriod=0
. This tx passes, and I now have a connection withdelayPeriod
on chainA and nodelayPeriod
on chainB.This is clearly not what I wanted as the initiator. This is why we fix the delay period at the
INIT
step to ensure that the final connection, regardless of which relayer completes it, has the delay period that was specified by the initiating relayer. InOpenTry
, we enforce that this connectionEnd also has a delay period specified by the initiating relayer.As @colin-axner said, in case of crossing hello's that don't agree on delay period, we error just as we do in other cases where parameters do not match.
Now, it is possible that in the
INIT
step, we could define different delay periods for each chain. SoConnOpenInit
might specifydelayPeriod
ANDcounterpartyDelayPeriod
.I could see this being potentially useful in cases where a highly secure chain is connecting to a more risky chain, the initiating relayer may specify no delay period for the
cosmos-hub
client but a high delay period for therisky-chain
client.However, this is a (slight) complication that doesn't seem all that useful imo, and unnecessary for IBC 1.0
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.
It seems that giving possibility for each party to choose a delayPeriod would conflict with optimistic sends, so it seems like good tradeoff to have it the same on both ends.
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.
Aye, we discussed this a bit internally, I guess it should be summarised somewhere public. Great summary @AdityaSripal!