Skip to content

Conversation

@0xRVE
Copy link
Contributor

@0xRVE 0xRVE commented Nov 13, 2025

fixes paritytech/contract-issues#216

When an EVM contract writes an all-zero 32-byte storage word, remove the corresponding child‑trie entry so storage-deposit accounting sees bytes/items removed and a refund can be applied.

@0xRVE
Copy link
Contributor Author

0xRVE commented Nov 13, 2025

/cmd prdoc --audience runtime_dev --bump patch

@0xRVE 0xRVE added the T7-smart_contracts This PR/Issue is related to smart contracts. label Nov 13, 2025
interpreter.ext.gas_meter_mut().adjust_gas(
charged_amount,
adjust_cost(if value_to_store.is_some() { 32 } else { 0 }, write_outcome.old_len()),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pgherveou @xermicus

is it OK to do this for transient storage too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I guess it should be consistent

nit

- if value_to_store.is_some() { 32 } else { 0 },
+ value_to_store.unwrap_or_default().len()

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

Differential Tests Results (PolkaVM)

Specified Tests

  • simple
  • complex
  • translated_semantic_tests

Counts

  • Total Number of Test Cases: 26447
  • Total Number of Successes: 5796
  • Total Number of Failures: 65
  • 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("")
complex/solidity_by_example/simple/inheritance/test.json::1::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: Code upload failed: Failed to execute transaction: Transaction inclusion watching timeout for 0x06c885bdb590ae87b1c7051923b01de4bebff37b5e414415792351f12d32ce3a: transaction was not confirmed within the timeout This test case succeeded with other compilation modes: {'Y+'}
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 267555 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/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/blockhash.sol::3::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("$BLOCK_HASH:256")]) but got 0x6e19b0dc44dcadc89595e1a6a7594aea6e3f6f4089a142a235ab8bfba71efc6f
simple/yul_instructions/blockhash.sol::3::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("$BLOCK_HASH:256")]) but got 0xaf6cf80046c2d7a747ce2e8dae64f5334d784bbf4cf65f1f2568871a8f7fa8a0
simple/yul_instructions/blockhash.sol::4::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("$BLOCK_HASH:255")]) but got 0x94bca7734ca2a1fa8968ed1b7284a723a0d42be2af2e3497073d817703c5eac9
simple/yul_instructions/blockhash.sol::4::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("$BLOCK_HASH:255")]) but got 0x77732f6298568b0b13013d5e5fa8158acce230beb6a38e790ec6b4d03733aa7b
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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

Differential Tests Results (REVM)

Specified Tests

  • simple
  • complex
  • translated_semantic_tests

Counts

  • Total Number of Test Cases: 26447
  • Total Number of Successes: 19161
  • Total Number of Failures: 19
  • Total Number of Ignores: 7267

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::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("OutOfGas")
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("OutOfGas")
complex/create/create_many/test.json::1::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("OutOfGas")
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("OutOfGas")
complex/yul_instructions/calldatasize/test_evm.json::11::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("OutOfGas")
complex/yul_instructions/calldatasize/test_evm.json::11::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")
complex/yul_instructions/calldatasize/test_evm.json::11::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")
complex/yul_instructions/calldatasize/test_evm.json::11::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("OutOfGas")
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::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: 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/try_catch/unbalanced_gas_limit.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: Output assertion failed - Expected Compound([CalldataItem("0"), CalldataItem("1"), CalldataItem("0"), CalldataItem("0")]) but got 0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
translated_semantic_tests/array/array_storage_index_access/test.json::0::E- Failed to execute all of the steps on the driver: Failure on step 6: 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/array_storage_length_access/test.json::0::E- Failed to execute all of the steps on the driver: Failure on step 5: 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/array_storage_push_empty_length_address/test.json::0::E- Failed to execute all of the steps on the driver: Failure on step 6: 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/array_storage_push_pop/test.json::0::E- Failed to execute all of the steps on the driver: Failure on step 5: 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/functionCall/gas_and_value_basic/test.json::0::E- Failed to execute all of the steps on the driver: Failure on step 2: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected false but got true. Revert reason: None
translated_semantic_tests/various/selfdestruct_post_cancun/test.json::0::E- Failed to execute all of the steps on the driver: Failure on step 2: Function call step Failed: Failed to handle function call assertions: Transaction status assertion failed - Expected true but got false. Revert reason: Some("panic: assertion failed (0x01)")
translated_semantic_tests/various/selfdestruct_post_cancun_multiple_beneficiaries/test.json::0::E- Failed to execute all of the steps on the driver: Failure on step 7: Balance Assertion Step Failed: Balance assertion failed - Expected 1000000000000000000 but got 0 for 0x1111111111111111111111111111111111111111 resolved to 0x1111111111111111111111111111111111111111

#[test_case(FixtureType::Solc, FixtureType::Resolc; "solc->resolc")]
#[test_case(FixtureType::Resolc, FixtureType::Solc; "resolc->solc")]
#[test_case(FixtureType::Resolc, FixtureType::Resolc; "resolc->resolc")]
fn storage_item_zero_shall_refund_deposit(caller_type: FixtureType, callee_type: FixtureType) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again do we need to to a nested call for testing this scenario here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it a nested call to make sure the caller_type does not matter. Maybe I was being overzealous, tell me what you think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah let's keep it simple please, we can have it aon both Solc and Resolc but we dont need a caller & callee

Copy link
Contributor Author

@0xRVE 0xRVE Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep it this way, it is not that complicated. And there is value in testing the delegatecall here because the storage is owned by Caller.sol while the code is owned by Host.sol.

EDIT.
added the simple test and it turns out that delegatecall and direct call behave differently:

  • delegatecall PVM does not refund storage deposit
  • direct call PVM refunds storage deposit

Copy link
Contributor Author

@0xRVE 0xRVE Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now both PVM and EVM refund storage deposit when writing all zeros to a storage item.
This changed since c9d82a0, on this commit PVM did not refund storage deposit.
I did not change the code since then (only added tests).

Unable to reproduce this issue (locally or in CI). Even after making a local checkout of c9d82a0 I cannot reproduce.

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/19532739887
Failed job name: test-linux-stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T7-smart_contracts This PR/Issue is related to smart contracts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EVM: remove contract storage slot when setting to 0

3 participants