-
Notifications
You must be signed in to change notification settings - Fork 340
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(hard_fork): part2 (Delyayed ack callback) #1355
feat(hard_fork): part2 (Delyayed ack callback) #1355
Conversation
logger.Info("reverting IBC rollapp packets", "rollappID", rollappID) | ||
|
||
// Get all the pending packets | ||
rollappPendingPackets := k.ListRollappPackets(ctx, types.PendingByRollappIDFromHeight(rollappID, height)) |
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.
probably wont fix for now but I think possible DOS if a lot of packets and fraud is e.g few days ago.
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.
pls open research topic
x/delayedack/keeper/fraud.go
Outdated
logger := ctx.Logger().With("module", "DelayedAckMiddleware") | ||
logger.Info("reverting IBC rollapp packets", "rollappID", rollappID) | ||
|
||
// Get all the pending packets |
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.
// Get all the pending packets | |
// Get all the pending packets from fork height inclusive |
x/delayedack/keeper/fraud.go
Outdated
} else { | ||
// for incoming packets, we need to reset the packet receipt | ||
ibcPacket := rollappPacket.Packet | ||
k.channelKeeper.SetPacketReceipt(ctx, ibcPacket.GetDestPort(), ibcPacket.GetDestChannel(), ibcPacket.GetSequence()) |
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 see how this is deleting the packet reciept?
from the ADR
// remove receipt
ibcPacket := rollappPacket.Packet
receiptKey := host.PacketReceiptKey(ibcPacket.GetDestPort(), ibcPacket.GetDestChannel(), ibcPacket.GetSequence())
channelKeeperStore.Delete(receiptKey)
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.
u right!
will fix
} | ||
|
||
// Get all pending rollapp packets until the latest finalized height | ||
return k.ListRollappPackets(ctx, types.PendingByRollappIDByMaxHeight(rollappID, latestFinalizedHeight)), latestFinalizedHeight, nil |
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.
seems like we're filitering by max latest finalized height instead from finalized height forwad.
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.
this code haven't changed. copied from x/delayedack/keeper/finalize.go
it's not used for fraud, it used by the query GetPendingPacketsByReceiver
I'll rename for clarity
b08a106
into
mtsitrin/937-rollapp-hard-fork-hub-side
// refund all pending outgoing packets | ||
if rollappPacket.Type == commontypes.RollappPacket_ON_ACK || rollappPacket.Type == commontypes.RollappPacket_ON_TIMEOUT { | ||
// refund all pending outgoing packets | ||
// we don't have access directly to `refundPacketToken` function, so we'll use the `OnTimeoutPacket` function | ||
err := ibc.OnTimeoutPacket(ctx, *rollappPacket.Packet, rollappPacket.Relayer) | ||
if err != nil { | ||
logger.Error("failed to refund reverted packet", append(logContext, "error", err.Error())...) | ||
} |
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.
should be changed to follow the ADR:
- timeout - only deleting the rollapp packet
- on_ack - to delete packet and re-create the commitment
Reverted
statusHardFork
x/delayedack
invariants as it's broken (since lazy finalization)