Skip to content

feat: add EIP-7702 SetCode workload for type-4 stress - #54

Open
nekomoto911 wants to merge 6 commits into
mainfrom
feat/eip7702-workload
Open

feat: add EIP-7702 SetCode workload for type-4 stress#54
nekomoto911 wants to merge 6 commits into
mainfrom
feat/eip7702-workload

Conversation

@nekomoto911

Copy link
Copy Markdown

Summary

  • Add workload = "eip7702" that deploys a minimal fallback-only delegate from the faucet, cascade-funds ETH only (skips ERC20 deploy/distribution), and drives self-sponsored type-4 SetCode transactions at target_tps.
  • Track per-tx nonce_increment (2 for self-sponsored 7702: tx + auth) so the address pool advances correctly after inclusion; keep enable_swap_token as a legacy fallback when workload is omitted.
  • Document the new workload in README / bench_config.template, and extend recover snapshots with eip7702_delegate.

Test plan

  • cargo check / cargo build --release on this branch
  • Local or testnet: workload = "eip7702", low target_tps (e.g. 10), finite duration_secs; confirm delegate deploy, ETH faucet, and type-4 inclusion
  • Re-run with --recover and verify snapshot eip7702_delegate is reused without redeploying
  • Regression: workload = "erc20" (or omit + enable_swap_token = false) still runs ERC20 path
  • Regression: workload = "swap" (or legacy enable_swap_token = true) still runs Uniswap path

Add workload = "eip7702" that deploys a minimal delegate, cascade-funds
ETH only, and issues self-sponsored type-4 SetCode txs at target TPS.
Track nonce_increment (2 for self-sponsored 7702) so the address pool
advances correctly after inclusion. Keep enable_swap_token as a legacy
fallback when workload is omitted.
The previous solc empty-contract runtime ended in REVERT (5f80fd), so every
self-sponsored type-4 call landed with status=0x0. Use a one-byte STOP
runtime so the call succeeds after set-code.
Replace the no-op STOP delegate with BatchExecutor.multiSend so each
type-4 tx re-delegates the sender then calls the EOA itself with a
batch of ETH transfers (default 4 recipients × 1 gwei). Funds circulate
among workers; gas limit raised for auth + multi-call overhead.
multiSend targets other workers that already set code to BatchExecutor.
Without receive/fallback, empty-calldata value transfers hit the selector
dispatch and revert ("send"), so most type-4 txs failed after the first
round of delegations. Trace confirmed: second CALL to a 0xef0100 EOA reverted.
Public testnet default rpc.txfeecap is 1 ETH. EIP-7702 stress used
350k gas × 5000 Gwei = 1.75 ETH and was rejected at send. Keep tip at
500 Gwei (txpool promote) but maxFee 1000 Gwei so 7702 reserve is 0.35
ETH. Lockstep faucet per-tx budget to 0.35 ETH. Stop scaling cascade to
99% of on-chain faucet balance (breaks shared multi-leg faucets). Use
global bench fees for 7702 delegate deploy (0.5 ETH product under cap).
@nekomoto911
nekomoto911 requested a review from keanji-x August 10, 2026 08:59
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