Skip to content
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

Duplicate packets on start #2256

Merged
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
042480e
Pull in upstream changes
seanchen1991 Apr 22, 2022
69a1f8f
Merge branch 'informalsystems:master' into master
seanchen1991 Apr 22, 2022
d0be1f8
Pull in upstream changes
seanchen1991 May 3, 2022
45e082f
Pull in upstream changes
seanchen1991 May 4, 2022
f0fc83d
Merge branch 'master' of https://github.com/informalsystems/ibc-rs
seanchen1991 May 4, 2022
8bc79b7
Merge branch 'master' of https://github.com/informalsystems/ibc-rs
seanchen1991 May 10, 2022
9bee642
Merge branch 'master' of https://github.com/informalsystems/ibc-rs
seanchen1991 May 16, 2022
82cdf25
Merge branch 'master' of https://github.com/informalsystems/ibc-rs
seanchen1991 May 25, 2022
807f2ce
Remove unnecessary destructuring assignment
seanchen1991 May 26, 2022
d1f419e
Decrement height when scheduling packet clearing
seanchen1991 Jun 1, 2022
93f2a57
Add changelog entry
seanchen1991 Jun 1, 2022
305a80d
Clarify comment
seanchen1991 Jun 6, 2022
99f2bc3
fix merge conflict
seanchen1991 Jun 7, 2022
e338bbd
Remove unnecessary destructure
seanchen1991 Jun 7, 2022
087da42
Initiate clear packet flow when a IbcEvent is received
seanchen1991 Jun 8, 2022
5ebf439
Revert to more straightforward logic to see if CI still breaks
seanchen1991 Jun 8, 2022
f20b3df
Merge branch 'master' into duplicate-packets-on-start
seanchen1991 Jun 16, 2022
650a57a
Refactor handle_packet_cmd
seanchen1991 Jun 16, 2022
50e5d53
Clean up handle_packet_cmd
seanchen1991 Jun 16, 2022
566ca32
Update handle_packet_cmd doc comment
seanchen1991 Jun 16, 2022
f56d52f
Incorporate PR feedback
seanchen1991 Jun 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix duplicate packets being generated on start. ([#2093](https://github.com/informalsystems/ibc-rs/issues/2093))
8 changes: 4 additions & 4 deletions relayer/src/worker/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@ fn handle_packet_cmd<ChainA: ChainHandle, ChainB: ChainHandle>(

// Handle the arrival of an event signaling that the
// source chain has advanced to a new block.
WorkerCmd::NewBlock {
height,
new_block: _,
} => {
WorkerCmd::NewBlock { height, .. } => {
// Decide if packet clearing should be scheduled.
// Packet clearing may happen once at start,
// and then at predefined block intervals.
Expand All @@ -172,6 +169,9 @@ fn handle_packet_cmd<ChainA: ChainHandle, ChainB: ChainHandle>(
clear_interval,
height,
) {
// Decrement the height in order to avoid clearing packets at the same
// height at which the packet's events were queried
let height = height.decrement().unwrap();
seanchen1991 marked this conversation as resolved.
Show resolved Hide resolved
seanchen1991 marked this conversation as resolved.
Show resolved Hide resolved
link.a_to_b.schedule_packet_clearing(Some(height))
} else {
Ok(())
Expand Down