Skip to content

Commit cb0d0fe

Browse files
committed
fix: preserve confirmed active canary state
Avoid dropping an active canary when nonce advances due to that canary's own confirmation, and update the confirmation test to model nonce advancement.
1 parent 6ca0435 commit cb0d0fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/proof_of_gossip.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,9 @@ where
534534
};
535535

536536
if on_chain_nonce > active.nonce {
537+
if self.provider.receipt_exists(active.tx_hash)? {
538+
return Ok(());
539+
}
537540
info!(
538541
target: "bera_reth::pog",
539542
tx_hash = %active.tx_hash,
@@ -1214,6 +1217,7 @@ mod tests {
12141217
let tx_hash = service.active.as_ref().unwrap().tx_hash;
12151218

12161219
service.provider.add_receipt(tx_hash);
1220+
service.provider.set_nonce(1);
12171221
service.tick().await.unwrap();
12181222

12191223
assert!(service.active.is_none());

0 commit comments

Comments
 (0)