-
Notifications
You must be signed in to change notification settings - Fork 34
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
LO2302 support timeout #158
base: main
Are you sure you want to change the base?
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.
Pull Request Overview
This PR adds support for packet timeout functionality as part of LO2302. The key changes include introducing a new SortUnrelayedPackets function in the naive strategy, updating the RelayService logic to use the sorted relay packets, and adding tests to validate timeout behavior.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
core/naive-strategy.go | Added SortUnrelayedPackets method with logic to mark timeout packets and adjust packet routing based on channel order. |
core/service.go | Updated RelayService to use the sorted relay packets for further processing. |
chains/tendermint/query.go | Introduced QueryNextSequenceReceive along with its underlying helper functions. |
core/chain.go | Added go:generate directive and QueryNextSequenceReceive to the Chain interface. |
core/strategies.go | Added SortUnrelayedPackets to the StrategyI interface. |
core/types.go | Added a new Sort field to the PacketInfo struct to support timeout sorting. |
core/provers.go | Updated type references to use the correct ibcexported package. |
core/service_test.go | Added and modified tests to validate the new timeout support in various scenarios. |
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.
@dai1975 I have put some comments.
core/chain_testmock.go
Outdated
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.
Since this file is used only in testing, the file name should end with _test.go
, for example mock_chain_test.go
.
core/types.go
Outdated
@@ -13,6 +13,7 @@ type PacketInfo struct { | |||
chantypes.Packet | |||
Acknowledgement []byte `json:"acknowledgement"` | |||
EventHeight clienttypes.Height `json:"event_height"` | |||
Sort string `json:"sort"` |
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.
Isn't TimedOut bool
(for example) a more suitable definition?
core/naive-strategy.go
Outdated
@@ -199,6 +200,74 @@ func (st *NaiveStrategy) UnrelayedPackets(ctx context.Context, src, dst *Provabl | |||
}, nil | |||
} | |||
|
|||
func (st *NaiveStrategy) SortUnrelayedPackets(ctx context.Context, src, dst *ProvableChain, sh SyncHeaders, rp *RelayPackets) (*RelayPackets, 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.
I think this process is not "sort", right?
For example ProcessTimeoutPackets
is more straightforward.
8b0fa62
to
bfb0b8a
Compare
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
bfb0b8a
to
ffdce65
Compare
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
Signed-off-by: Daisuke Kanda <[email protected]>
No description provided.