Skip to content

Add estimateGas test cases for EIP-7702 and EIP-7623 #668

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// checks that including ephemeral authorizations increases gas
//
// speconly: client response is only checked for schema validity.
>> {"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"from":"0x0c2c51a0990aee1d73c1228de158688341557508","nonce":"0x0","to":"0x0100000000000000000000000000000000000000","value":"0x1"}]}
<< {"jsonrpc":"2.0","id":1,"result":"0x5208"}
>> {"jsonrpc":"2.0","id":2,"method":"eth_estimateGas","params":[{"authorizationList":[{"address":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","chainId":"0x1","nonce":"0x0","r":"0x1111111111111111111111111111111111111111111111111111111111111111","s":"0x2222222222222222222222222222222222222222222222222222222222222222","yParity":"0x0"}],"from":"0x0c2c51a0990aee1d73c1228de158688341557508","nonce":"0x0","to":"0x0100000000000000000000000000000000000000","type":"0x4","value":"0x1"}]}
<< {"jsonrpc":"2.0","id":2,"result":"0xb52e"}
5 changes: 5 additions & 0 deletions tests/eth_estimateGas/eth_estimateGas/estimate-blob-tx.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// checks gas estimation for blob transactions (EIP-4844)
//
// speconly: client response is only checked for schema validity.
>> {"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"blobVersionedHashes":["0x0100000000000000000000000000000000000000000000000000000000000000"],"from":"0x0c2c51a0990aee1d73c1228de158688341557508","maxFeePerBlobGas":"0x5","nonce":"0x0","to":"0x0100000000000000000000000000000000000000","type":"0x5","value":"0x1"}]}
<< {"jsonrpc":"2.0","id":1,"result":"0x5208"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// checks combined effect of calldata floor and authorization gas cost
//
// speconly: client response is only checked for schema validity.
>> {"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"authorizationList":[{"address":"0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","chainId":"0x1","nonce":"0x0","r":"0x1111111111111111111111111111111111111111111111111111111111111111","s":"0x2222222222222222222222222222222222222222222222222222222222222222","yParity":"0x0"}],"from":"0x0c2c51a0990aee1d73c1228de158688341557508","nonce":"0x0","to":"0x0100000000000000000000000000000000000000","type":"0x4","value":"0x1"}]}
<< {"jsonrpc":"2.0","id":1,"result":"0xb52e"}
3 changes: 3 additions & 0 deletions tests/eth_estimateGas/eth_estimateGas/estimate-failed-call.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// estimates a contract call that reverts
>> {"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"from":"0x0102030000000000000000000000000000000000","input":"0xff030405","to":"0x17e7eedce4ac02ef114a7ed9fe6e2f33feba1667"}]}
<< {"jsonrpc":"2.0","id":1,"error":{"code":3,"message":"execution reverted","data":"0x77726f6e672d63616c6c6461746173697a65"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// ensures floor calldata cost dominates the gas used for trivial execution
//
// speconly: client response is only checked for schema validity.
>> {"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"from":"0x0c2c51a0990aee1d73c1228de158688341557508","input":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff","nonce":"0x0","to":"0x0100000000000000000000000000000000000000","value":"0x1"}]}
<< {"jsonrpc":"2.0","id":1,"result":"0xf545"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// estimates a simple transfer
>> {"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"from":"0xaa00000000000000000000000000000000000000","to":"0x0100000000000000000000000000000000000000"}]}
<< {"jsonrpc":"2.0","id":1,"result":"0x5208"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// estimates a successful contract call
//
// speconly: client response is only checked for schema validity.
>> {"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"from":"0x0102030000000000000000000000000000000000","input":"0xff01","to":"0x17e7eedce4ac02ef114a7ed9fe6e2f33feba1667"}]}
<< {"jsonrpc":"2.0","id":1,"result":"0x5316"}
Loading