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

feat(4337): Enforce ConditionalOptions check during payload building #76

Merged
merged 5 commits into from
Dec 11, 2024

Conversation

0xKitsune
Copy link
Contributor

@0xKitsune 0xKitsune commented Dec 11, 2024

This PR updates the payload builder to enforce any pooled transaction with ConditionalOptions clear validation before including the tx into the payload. In the current implementation, all transactions that fail conditional options checks will be removed from the mempool.

// --snip--
  while let Some(pool_tx) = best_txs.next() {
        if let Some(conditional_options) = pool_tx.transaction.conditional_options() {
            if let Err(_) = validate_conditional_options(conditional_options, &client) {
                best_txs.mark_invalid(&pool_tx);
                invalid_txs.push(pool_tx.hash().clone());
                continue;
            }
        }

// --snip--
 if !invalid_txs.is_empty() {
   pool.remove_transactions(invalid_txs);
}

Copy link
Collaborator

@0xOsiris 0xOsiris left a comment

Choose a reason for hiding this comment

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

Looks good, just one improvement I think we can make!

world-chain-builder/src/payload/builder.rs Show resolved Hide resolved
world-chain-builder/src/rpc/bundle.rs Outdated Show resolved Hide resolved
world-chain-builder/src/rpc/bundle.rs Outdated Show resolved Hide resolved
world-chain-builder/src/rpc/bundle.rs Outdated Show resolved Hide resolved
@0xKitsune 0xKitsune merged commit 7051f4d into main Dec 11, 2024
3 checks passed
@0xKitsune 0xKitsune deleted the kit/conditional-options-check branch December 11, 2024 19:37
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