Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into integration-tests-benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
AronisAt79 authored Sep 22, 2023
2 parents b61cfa7 + 69d0a63 commit cb1f0f0
Show file tree
Hide file tree
Showing 34 changed files with 1,532 additions and 1,652 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ To run the same tests as the CI, please use: `make test-all`.
## Running benchmarks

There are currently several benchmarks to run in the workspace in regards to the circuits.
All use the `DEGREE` env var to specify the degree of the `K` parameter that you want
All use the `DEGREE` env var to specify the degree of the `K` parameter that you want
to use for your circuit in the bench process.
- Keccak Circuit prover benches. -> `DEGREE=16 make packed_multi_keccak_bench`
- EVM Circuit prover benches. -> `DEGREE=18 make evm_bench`.
- State Circuit prover benches. -> `DEGREE=18 make state_bench`
- MPT Circuit prover benches. -> `DEGREE=14 make mpt_bench`
- MPT Circuit prover benches. -> `DEGREE=15 make mpt_bench`

You can also run all benchmarks by running: `make circuit_benches DEGREE=18`.

Expand Down
189 changes: 22 additions & 167 deletions testool/Config.toml
Original file line number Diff line number Diff line change
@@ -1,185 +1,22 @@
[[suite]]
id="default"
path="tests/src/GeneralStateTestsFiller/**/*"
max_gas = 500000
max_steps = 1000
ignore_tests = []
path="tests/src/GeneralStateTestsFiller/VMTests/vmArithmeticTest/addFiller.yml"
max_gas = 0
max_steps = 1000000

[[suite]]
id="nightly"
path="tests/src/GeneralStateTestsFiller/**/*"
max_gas = 0
max_steps = 100000
ignore_tests=[]

[[suite]]
id = "light"
path="tests/src/GeneralStateTestsFiller/**/*"
max_gas = 500000
max_steps = 1000
allow_tests=[
"add_d0(add_neg1_neg1)_g0_v0",
"mul_d0(mul_2_3)_g0_v0",
"sub_d0(sub_23_1)_g0_v0",
"div_d0(div_2_big)_g0_v0",
"sdiv_d0(sdiv_1_neg1)_g0_v0",
"mod_d0(mod_2_3)_g0_v0",
"smod_d0(smod_2_3)_g0_v0",
"addmod_d0(addmod_1_2_2)_g0_v0",
"mulmod_d0(mm_1_2_2)_g0_v0",
"exp_d7(exp_2_257)_g0_v0",
"signextend_d0(invalid_byte)_g0_v0",
"lt_d0(lt_neg2_0)_g0_v0",
"gt_d0(gt_neg2_0)_g0_v0",
"slt_d0(slt_neg2_0)_g0_v0",
"sgt_d0(sgt_neg2_0)_g0_v0",
"eq_d0(eq_neg5_neg3)_g0_v0",
"iszero_d0(iszero_neg1)_g0_v0",
"and_d0(and_2_2)_g0_v0",
"or_d0(or_2_2)_g0_v0",
"xor_d0(xor_2_2)_g0_v0",
"not_d0_g0_v0",
"byte_d0(byte_31_big)_g0_v0",
"shl_-1_0_d0_g0_v0",
"shr_-1_0_d0_g0_v0",
# SAR
# KECCAK
# ADDRESS
# BALANCE
"envInfo_d8(origin)_g0_v0",
"envInfo_d4(caller)_g0_v0",
"envInfo_d5(callvalue)_g0_v0",
"calldataload_d0(two_bytes)_g0_v0",
"envInfo_d9(calldatasize)_g0_v0",
"calldatacopy_d7(sec)_g0_v0",
"envInfo_d6(codesize)_g0_v0",
"envInfo_d1(codecopy)_g0_v0",
"envInfo_d7(gasprice)_g0_v0",
# EXTCODESIZE
# EXTCODECOPY
# RETURNCODESIZE
# RETURNCODECOPY
# EXTCODEHASH (need to find a test for it)
"blockInfo_d0(coinbase)_g0_v0",
"blockInfo_d4(timestamp)_g0_v0",
"blockInfo_d3(number)_g0_v0",
"blockInfo_d1(difficulty)_g0_v0",
"blockInfo_d2(gaslimit)_g0_v0",
"chainId_d0_g0_v0",
"selfBalance_d0_g0_v0",
# no tests for BASEFEE ?
"refundMax_d0_g0_v0", # POP
"mload16bitBound_d0_g0_v0",
"gasCostMemory_d44_g0_v0", # MSTORE
"randomStatetest148_d0_g0_v0", # MSTORE8
"SLOAD_Bounds_d0_g0_v0",
"sstoreGas_d0_g0_v0",
"JUMP_Bounds2_d0_g0_v0",
"JUMPI_Bounds_d0_g0_v0",
"callcode_checkPC_d0_g0_v0", # PC
"randomStatetest310_d0_g0_v0", # MSIZE
"RawCallGas_d0_g0_v0",
# JUMPDEST
"push_d0(push1)_g0_v0",
"push_d1(push2)_g0_v0",
"push_d2(push3)_g0_v0",
"push_d3(push4)_g0_v0",
"push_d4(push5)_g0_v0",
"push_d5(push6)_g0_v0",
"push_d6(push7)_g0_v0",
"push_d7(push8)_g0_v0",
"push_d8(push9)_g0_v0",
"push_d9(push10)_g0_v0",
"push_d10(push11)_g0_v0",
"push_d11(push12)_g0_v0",
"push_d12(push13)_g0_v0",
"push_d13(push14)_g0_v0",
"push_d14(push15)_g0_v0",
"push_d15(push16)_g0_v0",
"push_d16(push17)_g0_v0",
"push_d17(push18)_g0_v0",
"push_d18(push19)_g0_v0",
"push_d19(push20)_g0_v0",
"push_d20(push21)_g0_v0",
"push_d21(push22)_g0_v0",
"push_d22(push23)_g0_v0",
"push_d23(push24)_g0_v0",
"push_d24(push25)_g0_v0",
"push_d25(push26)_g0_v0",
"push_d26(push27)_g0_v0",
"push_d27(push28)_g0_v0",
"push_d28(push29)_g0_v0",
"push_d29(push30)_g0_v0",
"push_d30(push31)_g0_v0",
"push_d31(push32)_g0_v0",
"dup_d0(dup1)_g0_v0",
"dup_d1(dup2)_g0_v0",
"dup_d2(dup3)_g0_v0",
"dup_d3(dup4)_g0_v0",
"dup_d4(dup5)_g0_v0",
"dup_d5(dup6)_g0_v0",
"dup_d6(dup7)_g0_v0",
"dup_d7(dup8)_g0_v0",
"dup_d8(dup9)_g0_v0",
"dup_d9(dup10)_g0_v0",
"dup_d10(dup11)_g0_v0",
"dup_d11(dup12)_g0_v0",
"dup_d12(dup13)_g0_v0",
"dup_d13(dup14)_g0_v0",
"dup_d14(dup15)_g0_v0",
"dup_d15(dup16)_g0_v0",
"swap_d0(swap1)_g0_v0",
"swap_d1(swap2)_g0_v0",
"swap_d2(swap3)_g0_v0",
"swap_d3(swap4)_g0_v0",
"swap_d4(swap5)_g0_v0",
"swap_d5(swap6)_g0_v0",
"swap_d6(swap7)_g0_v0",
"swap_d7(swap8)_g0_v0",
"swap_d8(swap9)_g0_v0",
"swap_d9(swap10)_g0_v0",
"swap_d10(swap11)_g0_v0",
"swap_d11(swap12)_g0_v0",
"swap_d12(swap13)_g0_v0",
"swap_d13(swap14)_g0_v0",
"swap_d14(swap15)_g0_v0",
"swap_d15(swap16)_g0_v0",
"log0_emptyMem_d0_g0_v0",
"log1_emptyMem_d0_g0_v0",
"log2_emptyMem_d0_g0_v0",
"log3_emptyMem_d0_g0_v0",
"log4_emptyMem_d0_g0_v0",
# CREATE
"callcode_checkPC_d0_g0_v0", # for CALL
# CALLCODE
# RETURN
# DELEGATECALL
# CREATE2
# STATICCALL
# REVERT

]

[[set]]
id = "sigkill"
desc = "tests that sigkill"
tests = []

# skipped tests, do not need to be fixed --------------------------------------------------

[[skip_tests]]
desc = ""
tests = []

# ignored paths -------------------------------------------------------------------------

[[skip_paths]]
desc = "unimplemented"
paths = [
"EIP1559",
"EIP2930",
"stPreCompiledContracts",
"stZeroKnowledge"
"stZeroKnowledge"
]

[[skip_paths]]
Expand Down Expand Up @@ -221,6 +58,8 @@ paths = [
"create2callPrecompilesFiller.json",
"callToNonExistentFiller.json",
"tackDepthLimitSECFiller.json",
"callDataCopyOffsetFiller.json",
"calldatacopy_dejavu2Filler.json",
"ValueOverflowFiller" # weird 0x:biginteger 0x...
]

Expand All @@ -235,3 +74,19 @@ paths = [
"RevertRemoteSubCallStorageOOGFiller.yml",
"solidityExampleFiller.yml"
]

[[skip_paths]]
desc = "todo!"
paths = [
"CreateAddressWarmAfterFailFiller.yml",
"result_cancunEnvConvertionFiller.json",
"result_mergeEnvConvertionFiller.json",
"eoaEmptyFiller.yml"
]


[[skip_paths]]
desc = "unused"
paths = [
"doubleSelfdestructTestFiller.yml"
]
43 changes: 43 additions & 0 deletions testool/codehash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2896,3 +2896,46 @@ c4bf5ad3a96e11d4a794acd75d486639b5cf225f871db8d20d56123b23f526d4=600060006000600
d8a56c290ee5169eb894f0fa07066821d23f5f3d40b071d6e0d6c7afb282fe37=5a6000556000600060006000600073c94f5374fce5edbc8e2a8697c15331677e6ebf0b61ea60f2600155600160645500
abd7afc4a0b5580e7dc271b92f328b8e6996a971d6cf6612cb392fa447f2709f=5a6000556000600060006000600073c94f5374fce5edbc8e2a8697c15331677e6ebf0b61ea60f1600155600160645500
9555f80f23ad28f27a451dcf714ba3ca9508c507d16c2f5c74f9e9d991b51ec2=5a600055600060006000600073c94f5374fce5edbc8e2a8697c15331677e6ebf0b61ea60f4600155600160645500
681a49d6032393d3f7b5f66cad1e2c029ac72708b3c84e3ce94174d99d7fbc06=600435606481610100811460295761020081146033576103008114603d576104008114604757604e565b601b82019150604e565b601b82019150604e565b601882019150604e565b6018820191505b5060008060008060008686f16000555050
e5c6a102b383b20ce844126abb7d0bf51fea53914c23ff516cd9e6cb2188e0cb=416000806000806000856000f15050
c65e9a13daad46d0fb23c588c7ecb5ee3a807bf026711736ca0638314fc2c49c=416000806000806000856000f25050
304e4e2c9002c9663b1f664e3501f04a6b8aab9fb8e0d251afe05408c897daab=41600080600080846000f45050
bdbc1d342b1d78c86d9db1b2908f7f01f274e5e44bb72405e510bf331ca42215=41600080600080846000fa5050
23baac6d5c80a3460b14c20dcdace0680ab6ee414b3fb2cbfbda963d208a8170=416000806000806004356000811461004e57600181146100615760028114610077576003811461008a576004811461009d57600581146100bb57600681146100d957600781146100f557600080fd5b600f94505a9350853b91505a925061010d565b601394505a93506000806000883c5a925061010d565b600f94505a9350853f91505a925061010d565b600f94505a9350853191505a925061010d565b602194505a935060008060008060008a612710f191505a925061010d565b602194505a935060008060008060008a612710f291505a925061010d565b601e94505a935060008060008089612710f491505a925061010d565b601e94505a935060008060008089612710fa91505a92505b5083828403036000558060005260206000f3
c9be2eac47d065bde64cf971fbce63007dd79301665543a3e3dabe3cceb32650=6000806000806000803560601c620186a0f160005560018055
38a0e59befa52d28044471ca5eb4f9930bb6e4e2ff33b993fc62e60202869fff=600080600080610600620186a0fa6000556001805560016000601f3e600051600255
a616d9465e4127a877fb2d1fc36427f0fa72fc388d02b10ef21cbd7f09091766=6000806000806000803560601c620186a0f160005560018055
625c7b72397db0ffa1e8435286765d34a367dfaf0c486d0ad3cd57e59f19e20f=6000356000526000803660008073c94f5374fce5edbc8e2a8697c15331677e6ebf0b62989680f1806000556001805550
f0c8600835d1911fdce3f30d919a430be6d79f9cf8e0b58dbc1aeeaec0240ca4=7f600a80600080396000f3000000000000000000000000000000000000000000006000526000355a63deadbeef82600080f55a8203600a5580600055505050
52bb67412ac0148ba8454b8d14eecb2df80f6d9d9c2185fbfb353244389a6531=6000356000526000803660008061c0de62989680f1806000556001805550
2c2982f5372d0bb97d234f16210ecdf8e6ff9275eb34d60af05dab73a6193ba8=7f600a80600080396000f3000000000000000000000000000000000000000000006000526000355a81600080f05a8203600a5580600055505050
c802c45b226f9562759b05a08789691010b15e1ac224b7c313180df28adac6f4=6000806000806000620e49716000f150
4570dfe181646d399548df1310a95afe2ee9958e7d53455310a1a275cfa0c524=60016000556000806000806000620c0dea5af15060016000f3
73b716163efca33a23f793875569df9e759d4097ad21a389b3119db4291e1f2b=600160005560018055600080600080620c0dea5af45060016000f3
81051233c31b2337d5dbc235f028cfaf2370153cb7a7dba659a46498002efbd7=6001600055600180556000806000806000620c0dea5af25060016000f3
e3d73815b5fc103b09264ed463c8bc5565d05d85c94cc023599d787f9eed66c2=60016000556000806000806000620c0ded5af15060016000f3
72811360dafe6138c6488fd76cace07214dda6d9a45f6ffbfdcf98865e89cce5=60016000556000806000806000620c0de05af15060016000f3
210e3aadfd37ac7de088bcac902b74cf48a8ff68a7103d84c6d189a1437ae473=6001600055600180556000600155620c0de1803b80600080843c80600080f0506001808201f3
409f61826f7356f59fcbdf1f13a6679279e9920f8dadcff570f0a32c0cce2fd5=6001600055600180556000600155620c0de1803b80600080843c600081600080f5506001808201f3
0c1f1c2b53e6b6a0c7732ff85e9be54e3f4421012fe9364c43268a3aefa5e714=6000600060006000600073c94f5374fce5edbc8e2a8697c15331677e6ebf0b61ea60f1506d64600c6000556000526005601bf360005230ff00
fa8a9f80bc520300a3798d8c68e181adab921285010b614549869de5ccd27d1c=7f60016000f30000000000000000000000000000000000000000000000000000006000526005600080f060005560018055
aafbf83c0f3710c167ebc33f27dceb2eb9d28abb1fb05c21e34b1f9e2233c6d8=6001600055600180556000600155620c0de1600f7f6001600055600060005560016000f30000000000000000000000000000000000600052600081600080f5506001808201f3
451c55c3eba6157da3ed475ff5c85c21b0bbed3ff08121e3e5e2d815dba5714d=6001600055600180556000600155620c0de1600f7f6001600055600060005560016000f30000000000000000000000000000000000600052600081600080f5506001808201f3
d2ade8c7069746243223af9eff36a334c9efc8fdd8d168858e7f987bd9074a05=60016000f3
2801af36164dbee3c029113259d657d1c2175f1fe62f432b894000772c16f845=5a60015560043560243560443561c0de3b8060008061c0de3c826001820353816101005260008460f0811460385760f581146045576052565b610120600080f091506052565b615a17610120600080f591505b50806000555a60015403600155803f6002555050505050
7b6065bf0a39a0029168a47a75e335f270df1f36d3db2736e7d3d6b53ff44a36=5a600035602060008060008061010086f150815a10600055602060008060008061010086f250815a10600155602060006020600061010085f450815a10600255602060006020600061010085fa50815a106003555050
3f5c413fc75d017c094476ccfe60240068d906fad96ec1552be536191129fd68=600160010160005500
e5c786ec740075936fbc7e1ee84d9ab75a38278663c27f7416374f5ded41a231=30ff00
5b29c457a7d88022ec5b28f39e9b15622da6d884643a771edd4c9e97dd0e331a=670123456789abcdef600052600080600f60008073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee61fffff150
c970ee84da99f7186034b44f7bbc9d521569320a1c643f41efe8bf9f52c7dc72=600a68010000000000000001601f3960005160008103601a57005b50
748350f391f4b406b2e18729bc7632c714cdde93ba664241521fb3b54096cb2b=61100060002050
f35ce58ac83c4fa7d9b1d8eb8a75494a87a4df27f06bb4d2d7198546bcf0a634=6110005150
8b92e3499ee6364588d2152a82bf2e4c8e22e35b6b3c65f5e53fb172b598046a=6000806000558060015580600255806003558060045580600555806006558060075559905050
40450c645189cc3193cfbc4f731f3b3789af2ab8a04f348ed17fb9ed68164da4=6061600053601060015360006002536060600353600060045360f36005536006600080f050
68992affd32f78e54656d7b1853b46c9031fedfc5f6769d8336d80596650c68c=60008035126000600135128160005581600155816002558160035581600455816005558160065581600755816008558160095581600a5581600b5581600c5581600d5581600e5581600f5560008115605757617eea90505b60008203606457617ee090505b600080600080600061c0de86f150505050
9fbaa879e71f83700a2ef45abdc3e546888dbb59c374cb1f683d6d58e4b96b35=32ff
0f27e05ea187e05f8d1414fea9d1cef952045895fa0ea1b9afcb067663c27238=32806000558031603155803b603b55803f603f55600181013f61013f5561bad13f61bad15561bad23f61bad25561bad33f61bad35561bad43f61bad4555a600080600080600435865af1505a810360f1555a9050600080600080600061dead5af1505a810360ff555050
e8a7a68124e629036058991fac713b358337fe7412d37c3d9b89a331520d18b9=348060011c6000806000808461dead62011170f18183036000806000808461dead62011170f15050505050
7ebea5551401edbb59e83be5648bb70b08dec05208045272c020d206acf1a6c1=600054600181016000558062e4970101ff
5a96de1b93928214fa164ae3487c73e2ac678feb29cd5bdbf107342152d30f1f=60003560f81c61ffff60003560e81c1660008203601857005b60ff820360225780ff5b600080600080600086865af103603757600080fd5b5050
c34ba972d8ae90026ee747e3e40f100666a67dbecaf1ea05faeb474b619bcb2e=600060ff60005360106001536000600253600080600360008061dead5af19050806000556110003160015561dead3160025560003560f81c806001811460605760028114607357600381146087576004811460a0576005811460bd57600080fd5b600080600380600261dead5af1925060d8565b60008060036000600261dead5af1925060d8565b600160025360008060036000600261dead5af1925060d8565b60016000536001600253600080600360008061dead5af1925060d8565b6001600053600160025360008060036000600261dead5af192505b50816010556110003160115561dead31601255611001316013555050
2 changes: 1 addition & 1 deletion testool/docker/solc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /solidity
RUN apk update && apk add boost-dev boost-static build-base cmake git

RUN git clone https://github.com/ethereum/solidity .
RUN git checkout v0.8.13
RUN git checkout v0.8.17

WORKDIR /solidity/build
RUN cmake .. -DCMAKE_BUILD_TYPE=Release
Expand Down
6 changes: 3 additions & 3 deletions testool/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn encode_funccall(spec: &str) -> Result<Bytes> {
"uint" => ParamType::Uint(256),
"uint256" => ParamType::Uint(256),
"bool" => ParamType::Bool,
_ => panic!("unimplemented abi type {:?}", t),
_ => panic!("unimplemented abi type {t:?}"),
};

let encode_type = |t, v: &str| match t {
Expand All @@ -35,7 +35,7 @@ pub fn encode_funccall(spec: &str) -> Result<Bytes> {
ParamType::Bool => match v.to_lowercase().as_str() {
"true" | "0x01" => Ok(Token::Bool(true)),
"false" | "0x00" => Ok(Token::Bool(false)),
_ => panic!("unexpected boolean '{}'", v),
_ => panic!("unexpected boolean '{v}'"),
},
_ => unimplemented!(),
};
Expand All @@ -44,7 +44,7 @@ pub fn encode_funccall(spec: &str) -> Result<Bytes> {
.iter()
.enumerate()
.map(|(n, t)| Param {
name: format!("p{}", n),
name: format!("p{n}"),
kind: map_type(t),
internal_type: None,
})
Expand Down
Loading

0 comments on commit cb1f0f0

Please sign in to comment.