-
Notifications
You must be signed in to change notification settings - Fork 382
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
ICS04: Something confusing about function timeoutPacket and timeoutOnClose #965
Comments
Hey @michwqy. Thanks for the questions. I will try to summarise the questions, just so that I can make sure that I understand them. Question 1: As you correctly point out, in Besides that I see that for Question 2: I think you're also right here and the condition should be fine-tuned to cover the situation you describe. If you have an I would appreciate if @AdityaSripal could double check both of the above. |
Thanks @crodriguezvega . Question 1: In the above discussion, I assumed that all previous packets had been received successfully.
But if considering previous packets can also be timeout, I think the right code should be switch channel.order {
case ORDERED:
abortTransactionUnless(nextSequenceRecv <= packet.sequence)
abortTransactionUnless(connection.verifyNextSequenceRecv(
proofHeight,
proof,
packet.destPort,
packet.destChannel,
nextSequenceRecv
))
break;
case ORDERED_ALLOW_TIMEOUT:
abortTransactionUnless(nextSequenceRecv > packet.sequence && connection.verifyPacketReceipt(...TIMEOUT_RECEIPT) == FALSE )
// since nextSequenceRecv <= packet.sequence are right
abortTransactionUnless(connection.verifyNextSequenceRecv(
proofHeight,
proof,
packet.destPort,
packet.destChannel,
nextSequenceRecv
))
break; Question 2: I agree what you said. |
Thanks for the reply, @michwqy. Just a question: for |
Sorry, it is a mistake. To be honest, So the condition should be |
According to
As for
packet
, there are three scenarios (assume that all previous packets were successfully received).recvPacket
has not been called. SonextSequenceRecv == packet.sequence
whether timeout height/timestamp has passed on the counterparty chain or not.recvPacket
has been called and timeout height/timestamp has passed on the counterparty chain. SonextSequenceRecv == packet.sequence +1
andverifyPacketReceipt(...packet.sequence, TIMEOUT_RECEIPT)) == True
recvPacket
has been called and timeout height/timestamp has not passed on the counterparty chain. SonextSequenceRecv == packet.sequence +1
andverifyPacketReceipt(...packet.sequence, TIMEOUT_RECEIPT)) == False
So in
ORDERED_ALLOW_TIMEOUT
channel, a module can claim a packet is timeout ifmeans function
recvPacket
has not been called.or
means function
recvPacket
has been called and timeout height/timestamp has passed.But in
I think it means
It may be a mistake.
And in
As
I don't know if the function
timeoutOnClose
is allowed to called if timeoutHeight or timeoutTimestamp has been reached. (Like channel is closed afterrecvPacket
called on counterparty chain and beforetimeoutOnClose
called on local chain). But If the answer is yes, the condition should be(nextSequenceRecv <= packet.sequence) || (verifyPacketReceipt(...packet.sequence, TIMEOUT_RECEIPT)) == True)
.The text was updated successfully, but these errors were encountered: