Implement general gas tracking
This PR implements the general gas tracking spec.
The main change is that now there is a third resource (in addition to weight and storage deposits): Ethereum gas. This is a shared resource (consumable through weight and through storage deposits) and is only used when a transaction specifies gas limits (which is the case for eth_transact) instead of weight and storage deposit limits.
This requires a big change in the metering logic: there is now a ResourceMeter which contains a weight meter and a storage deposit meter. The ResourceMeter implements the logic from the spec and needs to account for the shared resource Ethereum gas.
The main changes happens in commit https://github.com/paritytech/polkadot-sdk/pull/10166/commits/f2c48f5aafe9898ffd6ebcb82e478c1e3ba3dba5.
TODOs
- [x] Ignore deposit refunds for dry running
- [x] Properly enforce weight limits
- [x] Fix gas mapping in the tracer
- [x] Fix (?) gas mapping in block storage (
with_ethereum_context) - [x] Check dry running logic again, and create_call, also in
ExecConfig - [x] Introduce
SignedGas - [x] use
effective_gas_priceinstead of next fee multiplier- TBD, also see https://github.com/paritytech/polkadot-sdk/pull/10148#pullrequestreview-3407403361
- [x] ensure that deducted amount is
effective_gas_price* used gas- this has already been addressed in https://github.com/paritytech/polkadot-sdk/pull/10148
- [x] check logic of
ensure_not_overdrawn - [ ] Optimize calculations
- [ ] Scale gas amounts charged in revm
- [ ] Check whether rounding is done correctly
- [ ] add debug logging
Other TODOs
- [x] fix tests and benchmarks
- [ ] add new tests
- [x] add code docs
- [x] resolve merge conflicts
- [ ] run benchmarks
- [ ] add PR description
@TorstenStueber Hello, thanks for the quick fix. I tested this by running the Uniswap v2 periphery test suite with the latest code from the torsten/gas-fixes branch. The result was 22 failing test cases.
For comparison, the same test suite has only 9 failing cases when run against the latest master branch.
It's worth noting that although the error messages in Hardhat might differ between the failing tests, I've observed on the node that the root cause for all these failed transactions is an OutOfGas error.
@sekisamu thanks for the message. Can you add instructions how to run the tests in that repository? E.g.,
- Did you just compile the revive-dev-node and the pallet-revive-eth-rpc from my branch?
- Any setup required for Hardhat? Environment variables?
- What command do you use to run the tests?
@TorstenStueber Hello, I've updated the issue description and include the info you require.
- yes, I've used the branch
torsten/gas-fixes, the commit is: 947a492c685b9d5cf506d87cf70be1fabad744dd - No extra setup for hardhat, I've already included the account setup in hardhat config.
- included in the updated issue.
And I've also tried again on the latest commit of torsten/gas-fixes, you can find the result here:https://github.com/paritytech/contract-issues/issues/215#issuecomment-3511744166
@sekisamu it is fixed on the latest commit of this PR and both test suites (https://github.com/papermoonio/v2-periphery-polkadot/tree/revm and https://github.com/papermoonio/eth-transfer-test) are 100% successful.
/cmd fmt
Differential Tests Results (PolkaVM)
Specified Tests
-
simple -
complex -
translated_semantic_tests
Counts
- Total Number of Test Cases: 26447
- Total Number of Successes: 5801
- Total Number of Failures: 60
- Total Number of Ignores: 20586
Failures
The test specifiers seen in this section have the format 'path::case_idx::compilation_mode' and they're compatible with the revive differential tests framework and can be specified to it directly in the same way that they're provided through the --test argument of the framework.
The failures are provided in an expandable section to ensure that the PR does not get polluted with information. Please click on the section below for more information
Detailed Differential Tests Failure Information
| Test Specifier | Failure Reason | Note |
|---|---|---|
complex/create/create2_many/test.json::1::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("ContractTrapped") |
|
complex/create/create_in_library/test.json::0::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("") |
|
complex/create/create_in_library/test.json::0::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("") |
|
complex/create/create_many/test.json::1::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("ContractTrapped") |
|
complex/library_call_tuple/test.json::0::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("") |
|
complex/library_call_tuple/test.json::0::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("") |
|
complex/solidity_by_example/applications/iterable_mapping/test.json::0::Y- >=0.8.1 |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("") |
|
complex/solidity_by_example/applications/iterable_mapping/test.json::0::Y+ >=0.8.1 |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("") |
|
simple/function/many_arguments_2.sol::0::Y+ |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/simple/function/many_arguments_2.sol:52:40: 52 result = result && main(i, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20) == uint256(i) * i; ^^ |
|
simple/function/many_arguments_2.sol::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/simple/function/many_arguments_2.sol:52:40: 52 result = result && main(i, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20) == uint256(i) * i; ^^ |
|
simple/function/many_arguments_2_complex.sol::0::Y+ |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/simple/function/many_arguments_2_complex.sol:58:21: 58 p1, ^^ |
|
simple/internal_function_pointers/sum_oddness.sol::0::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("ContractTrapped") |
This test case succeeded with other compilation modes: {'Y-'} |
simple/internal_function_pointers/sum_oddness.sol::1::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("ContractTrapped") |
This test case succeeded with other compilation modes: {'Y-'} |
simple/pointer/large_offset.sol::0::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("ContractTrapped") |
|
simple/pointer/large_offset.sol::0::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("ContractTrapped") |
|
simple/recursion/recursion_keccak.sol::0::Y+ |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Failed to parse resolc standard JSON output: failed to parse resolc JSON output: recursion limit exceeded at line 1 column 184228 stderr: |
|
simple/recursion/recursion_keccak.sol::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Failed to parse resolc standard JSON output: failed to parse resolc JSON output: recursion limit exceeded at line 1 column 267625 stderr: |
|
simple/recursion_keccak.sol::0::Y+ |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Failed to parse resolc standard JSON output: failed to parse resolc JSON output: recursion limit exceeded at line 1 column 184158 stderr: |
|
simple/recursion_keccak.sol::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Failed to parse resolc standard JSON output: failed to parse resolc JSON output: recursion limit exceeded at line 1 column 267555 stderr: |
|
simple/try_catch/unbalanced_gas_limit.sol::0::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0"), CalldataItem("1"), CalldataItem("0"), CalldataItem("0")]) but got 0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 |
|
simple/try_catch/unbalanced_gas_limit.sol::0::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0"), CalldataItem("1"), CalldataItem("0"), CalldataItem("0")]) but got 0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 |
|
simple/yul_instructions/returndatacopy.sol::41::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("OutOfGas") |
|
simple/yul_instructions/returndatacopy.sol::41::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("OutOfGas") |
|
simple/yul_instructions/revert.sol::59::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::59::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::60::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::60::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::61::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::61::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::75::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::75::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::197::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::197::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::200::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("OutOfGas") |
|
simple/yul_instructions/revert.sol::200::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("OutOfGas") |
|
simple/yul_instructions/revert.sol::202::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::202::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::205::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("OutOfGas") |
|
simple/yul_instructions/revert.sol::205::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("OutOfGas") |
|
simple/yul_instructions/revert.sol::207::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::207::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Output assertion failed - Expected Compound([CalldataItem("0xdeadbeef")]) but got 0x0000000000000000000000000000000000000000000000000000000000000000 |
|
simple/yul_instructions/revert.sol::210::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("OutOfGas") |
|
simple/yul_instructions/revert.sol::210::Y+ |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("OutOfGas") |
|
translated_semantic_tests/array/copying/array_nested_calldata_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying nested calldata dynamic arrays to storage is not implemented in the old code generator. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/array_nested_calldata_to_storage/array_nested_calldata_to_storage.sol:2:1: 2 contract c { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/array_of_struct_calldata_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying of type struct C.S calldata[] calldata to storage is not supported in legacy (only supported by the IR pipeline). Hint: try compiling with `--via-ir` (CLI) or the equivalent `viaIR: true` (Standard JSON) --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/array_of_struct_calldata_to_storage/array_of_struct_calldata_to_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/array_of_struct_memory_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying of type struct C.S memory[] memory to storage is not supported in legacy (only supported by the IR pipeline). Hint: try compiling with `--via-ir` (CLI) or the equivalent `viaIR: true` (Standard JSON) --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/array_of_struct_memory_to_storage/array_of_struct_memory_to_storage.sol:1:1: 1 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/array_of_structs_containing_arrays_calldata_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying of type struct C.S calldata[] calldata to storage is not supported in legacy (only supported by the IR pipeline). Hint: try compiling with `--via-ir` (CLI) or the equivalent `viaIR: true` (Standard JSON) --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/array_of_structs_containing_arrays_calldata_to_storage/array_of_structs_containing_arrays_calldata_to_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/array_of_structs_containing_arrays_memory_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying of type struct C.S memory[] memory to storage is not supported in legacy (only supported by the IR pipeline). Hint: try compiling with `--via-ir` (CLI) or the equivalent `viaIR: true` (Standard JSON) --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/array_of_structs_containing_arrays_memory_to_storage/array_of_structs_containing_arrays_memory_to_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/calldata_array_to_mapping/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying nested calldata dynamic arrays to storage is not implemented in the old code generator. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/calldata_array_to_mapping/calldata_array_to_mapping.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying nested calldata dynamic arrays to storage is not implemented in the old code generator. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage/elements_of_nested_array_of_structs_calldata_to_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/elements_of_nested_array_of_structs_memory_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying of type struct C.S memory[1] memory to storage is not supported in legacy (only supported by the IR pipeline). Hint: try compiling with `--via-ir` (CLI) or the equivalent `viaIR: true` (Standard JSON) --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/elements_of_nested_array_of_structs_memory_to_storage/elements_of_nested_array_of_structs_memory_to_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/nested_array_of_structs_calldata_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying nested calldata dynamic arrays to storage is not implemented in the old code generator. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/nested_array_of_structs_calldata_to_storage/nested_array_of_structs_calldata_to_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/nested_array_of_structs_memory_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying of type struct C.S memory[] memory to storage is not supported in legacy (only supported by the IR pipeline). Hint: try compiling with `--via-ir` (CLI) or the equivalent `viaIR: true` (Standard JSON) --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/nested_array_of_structs_memory_to_storage/nested_array_of_structs_memory_to_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/nested_array_of_structs_storage_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying of type struct C.S memory[1] memory to storage is not supported in legacy (only supported by the IR pipeline). Hint: try compiling with `--via-ir` (CLI) or the equivalent `viaIR: true` (Standard JSON) --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/nested_array_of_structs_storage_to_storage/nested_array_of_structs_storage_to_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/nested_array_of_structs_with_nested_array_from_storage_to_memory/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying of type struct C.S memory[] memory to storage is not supported in legacy (only supported by the IR pipeline). Hint: try compiling with `--via-ir` (CLI) or the equivalent `viaIR: true` (Standard JSON) --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/nested_array_of_structs_with_nested_array_from_storage_to_memory/nested_array_of_structs_with_nested_array_from_storage_to_memory.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/copying/nested_dynamic_array_element_calldata_to_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying nested calldata dynamic arrays to storage is not implemented in the old code generator. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/copying/nested_dynamic_array_element_calldata_to_storage/nested_dynamic_array_element_calldata_to_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/nested_calldata_storage/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying nested calldata dynamic arrays to storage is not implemented in the old code generator. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/nested_calldata_storage/nested_calldata_storage.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/array/nested_calldata_storage2/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: UnimplementedFeatureError: Copying nested calldata dynamic arrays to storage is not implemented in the old code generator. --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/array/nested_calldata_storage2/nested_calldata_storage2.sol:2:1: 2 contract C { ^ (Relevant source part starts here and spans across multiple lines). |
|
translated_semantic_tests/saltedCreate/prediction_example/test.json::0::Y- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("revert: Address mismatch.") |
|
translated_semantic_tests/shanghai/evmone_support/test.json::0::Y- |
Failed to create the drivers for the various platforms: Failed to create driver for revive-dev-node-polkavm-resolc: Failed to initialize the execution state of the platform: Failed to produce the pre-linking compiled contracts: Compilation callback failed (cache miss path): Encountered an error in the compilation: Error: LLVM IR generator: 306:17 The `EXTCODECOPY` instruction is not supported --> /__w/polkadot-sdk/polkadot-sdk/revive-differential-tests/resolc-compiler-tests/fixtures/solidity/translated_semantic_tests/shanghai/evmone_support/evmone_support.sol |
Differential Tests Results (REVM)
Specified Tests
-
simple -
complex -
translated_semantic_tests
Counts
- Total Number of Test Cases: 26447
- Total Number of Successes: 19175
- Total Number of Failures: 1
- Total Number of Ignores: 7271
Failures
The test specifiers seen in this section have the format 'path::case_idx::compilation_mode' and they're compatible with the revive differential tests framework and can be specified to it directly in the same way that they're provided through the --test argument of the framework.
The failures are provided in an expandable section to ensure that the PR does not get polluted with information. Please click on the section below for more information
Detailed Differential Tests Failure Information
| Test Specifier | Failure Reason | Note |
|---|---|---|
simple/gas_value/gas_value_order1.sol::0::E- |
Failed to execute all of the steps on the driver: Failure on step 0: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("") |
This test case succeeded with other compilation modes: {'Y+', 'E+', 'Y-'} |
/cmd prdoc --audience runtime_dev --bump patch
/cmd bench --runtime dev --pallet pallet_revive
Command "bench --runtime dev --pallet pallet_revive" has started 🚀 See logs here
Command "bench --runtime dev --pallet pallet_revive" has finished ✅ See logs here
| File | Extrinsic | Old | New | Change [%] |
|---|---|---|---|---|
| substrate/frame/revive/src/weights.rs | evm_instantiate | 1.23ms | 1.43ms | +16.51 |
| substrate/frame/revive/src/weights.rs | seal_origin | 343.00ns | 395.00ns | +15.16 |
| substrate/frame/revive/src/weights.rs | seal_call_data_load | 310.00ns | 343.00ns | +10.65 |
| substrate/frame/revive/src/weights.rs | seal_balance | 13.41us | 14.24us | +6.17 |
| substrate/frame/revive/src/weights.rs | rollback_transient_storage | 1.26us | 1.34us | +6.02 |
| substrate/frame/revive/src/weights.rs | seal_caller | 382.00ns | 403.00ns | +5.50 |
| substrate/frame/revive/src/weights.rs | seal_contains_transient_storage | 3.63us | 3.82us | +5.40 |
| substrate/frame/revive/src/weights.rs | seal_call_data_size | 314.00ns | 330.00ns | +5.10 |
| substrate/frame/revive/src/weights.rs | get_storage_empty | 34.63us | 32.86us | -5.11 |
| substrate/frame/revive/src/weights.rs | caller_is_root | 1.25us | 1.19us | -5.19 |
| substrate/frame/revive/src/weights.rs | seal_get_immutable_data | 35.83us | 33.90us | -5.41 |
| substrate/frame/revive/src/weights.rs | seal_terminate | 1.14us | 1.07us | -5.54 |
| substrate/frame/revive/src/weights.rs | seal_get_storage | 37.44us | 35.23us | -5.89 |
| substrate/frame/revive/src/weights.rs | seal_block_hash | 33.21us | 31.20us | -6.05 |
| substrate/frame/revive/src/weights.rs | seal_base_fee | 1.24us | 1.06us | -14.41 |
| substrate/frame/revive/src/weights.rs | seal_ref_time_left | 6.24us | 1.93us | -69.06 |
| substrate/frame/revive/src/weights.rs | seal_gas_limit | 1.89us | 339.00ns | -82.06 |
Command output:
✅ Successful benchmarks of runtimes/pallets: -- dev: ['pallet_revive']
@TorstenStueber is this in a state where we could use it in anvil to run our integration tests to ensure compatibility? (after rebasing on top of latest master and fixing the conflicts)
@TorstenStueber is this in a state where we could use it in anvil to run our integration tests to ensure compatibility? (after rebasing on top of latest master and fixing the conflicts)
@alindima Yes, it is now!
All GitHub workflows were cancelled due to failure one of the required jobs. Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/19728822752 Failed job name: test-linux-stable
@TorstenStueber is this in a state where we could use it in anvil to run our integration tests to ensure compatibility? (after rebasing on top of latest master and fixing the conflicts)
@alindima Yes, it is now!
fyi @mokita-j created a branch in foundry polkadot that compile against this branch
I will merge this now as it is required for the audit. I will address the two outstanding points in a follow-up PR: