-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
IBC ICS Spec versus IBC SDK/ relayer implementations #5908
Comments
Connection and channel state machine diagrams also need updates. |
Thanks @ancazamfir! Looks like some differences need rectifying here. |
The The rest of the differences are substantive and should be fixed - thanks. |
re: |
@cwgoes can you check tomorrow if 3-5 still apply? Sounds like a small fix |
(4) is still the case in the SDK; this line should be changed. |
@ancazamfir Is the goal for the default relayer to relay everything which can be possibly be relayed? I'm not sure if you would necessarily want to relay if it seemed like another relayer had started the handshake too. |
Fixed spec-side in cosmos/ibc@00531ee. |
The spec-side ICS 18 work can be tracked in cosmos/ibc#402. (ICS 18 was not really ever intended to be comprehensive, I can update it though) |
But then both relayers may back off. And SDK handler on |
A few observations regarding some inconsistencies among the connection/ channel handshake specs, relayer spec, SDK code.
ICS pdf
In SDK the message's
ValidateBasic
is executed before the handler is called so msg validation (including identifiers) is not performed in the handler. Similar in other handlers in the spec.ICS:
Here in the spec line
2046/18
thestate
not initialized, in SDK is set toUNINITIALIZED
which is not a valid state in ICS pdf.Then, related to the allowed
INIT -> TRYOPEN
transition. It looks like both A and B can be inINIT
state (they were independently initialized by different agents). And it is expected that a relayer will relay for this case but this is not covered in thependingDatagrams
in ICS-018.Regardless, it is possible that
connOpenTry
is relayed to both A and B and both chains will transition toTRYOPEN
.Again, a correct relayer will not relay in this case as per ICS-018. If a relayer does relay a
connOpenAck
to A when both A and B are inTRYOPEN
, the handler on A will be ok according to the ICS but fails in SDK:ICS pdf:
2071 1 function connOpenAck(
...
2080 10 abortTransactionUnless(connection.state === INIT || connection.state === TRYOPEN)
SDK:
cosmos-sdk/x/ibc/03-connection/keeper/handshake.go
Line 145 in d456271
Assuming we go with the ICS we are now in the case where both A and B are in
OPEN
state which is nice as it finishes the handshake in the presence of multiple correct relayers.Similar observations for channel handshake except the the
chanOpenAck
in SDK correctly allows forINIT
andTRYOPEN
states.The text was updated successfully, but these errors were encountered: