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

improve(finalizer): Filter USDC from arbitrum and op stack finalizers #1539

Merged
merged 9 commits into from
May 20, 2024

Conversation

nicholaspai
Copy link
Member

No description provided.

nicholaspai and others added 7 commits May 19, 2024 22:15
…nsactions to query for CCTP l2->l1 transactions

We’re not de-duping the set of txn receipts to query for CCTP l2 to l1 deposits, but we do this in the l1 to l2 direciton.

What’s unique for L2 to L1 is we look for SpokePool.TokensBridged() events but we forget there might be multiple of these in the same block
…or multiple day downtime

Currently the finalizer is optimized for run-time speed and tries to look over as short of an event search window as possible.

However, this provides very little margin for error in case the finalizer goes down for multiple days.
// We want to conservatively query for events that are between 0 and 24 hours old
// because Linea L1->L2 messages are claimable after ~20 mins.
const { fromBlock, toBlock } = await getBlockRangeByHoursOffsets(l1ChainId, 24, 0);
const { fromBlock, toBlock } = await getBlockRangeByHoursOffsets(l1ChainId, 24 * 7, 0);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to add this longer look back in #1535

// because Linea L2->L1 messages are claimable after 6 - 32 hours
const { fromBlock, toBlock } = await getBlockRangeByHoursOffsets(l2ChainId, 72, 8);
// Linea L2->L1 messages are claimable after 6 - 32 hours
const { fromBlock, toBlock } = await getBlockRangeByHoursOffsets(l2ChainId, 24 * 8, 6);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to add this in #1535

@nicholaspai nicholaspai marked this pull request as ready for review May 20, 2024 01:24
Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there's a way around the logIndexesForMessage - I'll look into it this week

@nicholaspai nicholaspai merged commit 2cb56d8 into james/account-for-polygon-finalization May 20, 2024
4 checks passed
nicholaspai added a commit that referenced this pull request May 20, 2024
* fix(finalizer): polygon

* improve(finalizer): Filter USDC from arbitrum and op stack finalizers (#1539)

* fix(Finalizer): Dedup transaction hash list when creating list of transactions to query for CCTP l2->l1 transactions

We’re not de-duping the set of txn receipts to query for CCTP l2 to l1 deposits, but we do this in the l1 to l2 direciton.

What’s unique for L2 to L1 is we look for SpokePool.TokensBridged() events but we forget there might be multiple of these in the same block

* improve(finalizer): Increase margin of error for finalizer to cover for multiple day downtime

Currently the finalizer is optimized for run-time speed and tries to look over as short of an event search window as possible.

However, this provides very little margin for error in case the finalizer goes down for multiple days.

* Update l2ToL1.ts

* add arbitrum/optimism filters

* Update l2ToL1.ts

* Update arbitrum.ts

---------

Co-authored-by: nicholaspai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants