Skip to content

fix(cketh): don't panic when transaction receipt is not yet indexed - #11093

Open
Rachit2323 wants to merge 3 commits into
dfinity:masterfrom
Rachit2323:fix/cketh-finalize-assert-to-graceful-return
Open

fix(cketh): don't panic when transaction receipt is not yet indexed#11093
Rachit2323 wants to merge 3 commits into
dfinity:masterfrom
Rachit2323:fix/cketh-finalize-assert-to-graceful-return

Conversation

@Rachit2323

Copy link
Copy Markdown
Contributor

Bug

When finalizing ETH withdrawals, the minter checks how many transactions were finalized on-chain, then fetches receipts for each one. These are two separate RPC calls — not atomic.

If an RPC provider returns null for a receipt (not yet indexed, transient lag), the code hits Ok(None) and silently skips that withdrawal. But then the assert_eq! below expects every withdrawal to have a receipt. The counts don't match and the whole finalization timer panics — blocking all pending ETH withdrawals until the next tick.

Fix

Replace assert_eq! with a log + early return. If the counts don't match, log a warning and retry on the next timer tick instead of panicking.

Tests

The existing test should_not_finalize_transaction_when_receipts_do_not_match continues to pass. The fix is safe — a mismatch is now treated as a transient RPC inconsistency, not a hard failure.

@github-actions github-actions Bot added the fix label Aug 10, 2026
@basvandijk basvandijk added the security-review-passed IDX or InfraSec have concluded it's safe to run CI on the external PR. label Aug 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@Rachit2323
Rachit2323 marked this pull request as ready for review August 12, 2026 14:35
@Rachit2323
Rachit2323 requested a review from a team as a code owner August 12, 2026 14:35
@github-actions github-actions Bot added the @defi label Aug 12, 2026
@zeropath-ai

zeropath-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 5c75fa2.

Security Overview
Detected Code Changes
Change Type Relevant files
Bug Fix ► rs/ethereum/cketh/minter/src/withdraw.rs
    Fix mismatch handling by logging a mismatch between expected and actual finalized withdrawal IDs and returning early to allow retry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@defi external-contributor fix security-review-passed IDX or InfraSec have concluded it's safe to run CI on the external PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants