Skip to content

feat(examples): add multi-transaction block simulation example#3516

Open
danieljrc888 wants to merge 1 commit intobluealloy:mainfrom
danieljrc888:add-multi-tx-block-sim-example
Open

feat(examples): add multi-transaction block simulation example#3516
danieljrc888 wants to merge 1 commit intobluealloy:mainfrom
danieljrc888:add-multi-tx-block-sim-example

Conversation

@danieljrc888
Copy link
Copy Markdown

Summary

  • Adds a new multi_tx_block_sim example demonstrating how to simulate an entire block of transactions using REVM
  • Shows two execution strategies: per-transaction commit (transact_commit) and batch commit (transact_many_commit)
  • Covers contract deployment, multi-account interaction, value transfers, gas tracking, and balance reporting

What the example demonstrates

  1. Configuring a realistic block environment (number, timestamp, coinbase, basefee)
  2. Deploying a counter contract and having multiple accounts interact with it
  3. Tracking cumulative gas usage across all transactions in a block
  4. Comparing per-transaction commit vs batch commit strategies

Test plan

  • Example compiles (cargo build -p example-multi-tx-block-sim)
  • Example runs successfully (cargo run -p example-multi-tx-block-sim)
  • CI passes

Demonstrates simulating an entire block with multiple transactions:
- Block environment setup (number, timestamp, coinbase, basefee)
- Contract deployment and cross-account interaction
- Cumulative gas tracking across transactions
- Two execution strategies: per-tx commit and batch commit
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.

1 participant