foundry-rs / foundry-rs/foundry

feat(`anvil`): add `eth_sendBundle` for MEV-related integration tests

Open
#8,332 0 comments 0 reactions 0 assignees View on GitHub
A-private-transactions A-reth-anvil T-feature T-to-discuss
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
16h 38m
Merged PRs (30d)
511

Description

### Component

Anvil

### Describe the feature you would like

`eth_sendBundle` has become a very used primitive for MEV-aware application such as Private Mempool, block builders, snipers, etc.

Being able to test this feature using Anvil would close the loop on a bunch of our integration tests.

Specs: https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint

```
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_sendBundle",
"params": [
{
txs, // Array[String], A list of signed transactions to execute in an atomic bundle
blockNumber, // String, a hex encoded block number for which this bundle is valid on
minTimestamp, // (Optional) Number, the minimum timestamp for which this bundle is valid, in seconds since the unix epoch
maxTimestamp, // (Optional) Number, the maximum timestamp for which this bundle is valid, in seconds since the unix epoch
revertingTxHashes, // (Optional) Array[String], A list of tx hashes that are allowed to revert
replacementUuid, // (Optional) String, UUID that can be used to cancel/replace this bundle
}
]
}
```

### Additional context

https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint

Contributor guide

Open the contributing guide

Research direction

Start with Anvil's JSON-RPC surface and the linked Flashbots eth_sendBundle specification. Work through txs, blockNumber, the optional timestamp and reverting-hash fields, and replacementUuid, then define integration tests covering atomic bundle execution and validity constraints. Done means Anvil accepts the method with the documented behavior for MEV-related integration tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
blockchain, rust
Domain
blockchain, testing, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.