Skip to content

Backrun bundles#389

Merged
dvush merged 51 commits intomainfrom
backrun-bundles
Feb 25, 2026
Merged

Backrun bundles#389
dvush merged 51 commits intomainfrom
backrun-bundles

Conversation

@dvush
Copy link
Contributor

@dvush dvush commented Feb 13, 2026

📝 Summary

Adds support for backrun bundles.

  • adds eth_sendBackrunBundle rpc (see new rpc.rs)
  • adds backrun bundle pool to store backrun bundles (see new '*pool.rs`)
  • modified block builder to include backrun bundles (see context.rs change)

See module level docs in backrun_bundle/mod.rs for detailed explanation.

Also see docs and definitions for the following structs: BackrunBundleGlobalPool, BackrunBundlePayloadPool, StoredBackrunBundle, BackrunBundleRPCArgs.

💡 Motivation and Context

Backrun bundle is a new type of bundle that allows backrunning mempool transactions. If enabled, after mempool transaction is included builder tries to include the best available backruns for that transactions.


✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

@dvush dvush requested a review from SozinM as a code owner February 13, 2026 10:56
Copilot AI review requested due to automatic review settings February 13, 2026 10:56
Copilot AI review requested due to automatic review settings February 19, 2026 15:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +773 to +780
if self
.address_gas_limiter
.consume_gas(bundle.backrun_tx.signer(), br_gas_used)
.is_err()
{
log_br_txn(TxnExecutionResult::MaxGasUsageExceeded);
continue;
}
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

Gas limiter is consumed before checking if the backrun transaction should be included. If the transaction reverts (line 782-789) or exceeds max_gas_per_txn (line 791-796), the gas has already been consumed from the limiter (line 773-780) even though the transaction won't be included in the block.

This is inconsistent with normal transactions, where consume_gas is called after all exclusion checks (see line 561). Move the consume_gas call to after the success check and max_gas_per_txn check to ensure gas is only consumed for transactions that will actually be included.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 24, 2026 13:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@julio4
Copy link
Member

julio4 commented Feb 25, 2026

@dvush Is it fully ready? It's a lot of changes so let's merge these in priority

@dvush
Copy link
Contributor Author

dvush commented Feb 25, 2026

@julio4 yes, in the current form it is but we would need to tweak it a bit here and there

@julio4
Copy link
Member

julio4 commented Feb 25, 2026

@julio4 yes, in the current form it is but we would need to tweak it a bit here and there

lets merge and iteratively tweak it!

@dvush dvush enabled auto-merge (squash) February 25, 2026 14:17
@dvush dvush merged commit 14632d2 into main Feb 25, 2026
4 of 5 checks passed
@dvush dvush deleted the backrun-bundles branch February 25, 2026 14:31
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.

6 participants