Skip to content

test: Introduce TestingFramework struct#532

Merged
0xVolosnikov merged 44 commits intodevfrom
vv-testing-setup-refactoring
Feb 25, 2026
Merged

test: Introduce TestingFramework struct#532
0xVolosnikov merged 44 commits intodevfrom
vv-testing-setup-refactoring

Conversation

@0xVolosnikov
Copy link
Contributor

@0xVolosnikov 0xVolosnikov commented Feb 24, 2026

What ❔

Additional layer of abstraction between tests and Chain. This is an intermediate step - in following PRs I will better separate concerns between Chain and TestingFramework. Additionally this separation will make RevmRunner integration easier and more effective.

Note that in this PR we'll change how testing works in general - by default locally RISC-V simulation will be disabled, it will be enabled in CI. This change makes testing setup a bit more friendly for AI agents.

Why ❔

Is this a breaking change?

  • Yes
  • No

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted.

@0xVolosnikov 0xVolosnikov changed the base branch from main to dev February 24, 2026 19:07
@0xVolosnikov 0xVolosnikov changed the title test: Testing setup refactoring test: Introduce TestingFramework struct Feb 25, 2026
@0xVolosnikov 0xVolosnikov marked this pull request as ready for review February 25, 2026 01:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a higher-level TestingFramework abstraction in the rig test harness to decouple tests from Chain, while also changing default test execution behavior so RISC-V simulation/proving runs are disabled locally by default and enabled in CI.

Changes:

  • Added rig::TestingFramework with builder-style configuration and convenience helpers for executing/simulating blocks and inspecting results.
  • Refactored many test crates to construct/use TestingFramework (and pass ZKsyncTxEnvelope directly) instead of manually wiring Chain + encoded transactions.
  • Updated RunConfig semantics from only_forward to do_riscv_run, and adjusted CI to enable proving runs by default.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
zk_ee/src/oracle/usize_serialization/tests.rs Removes unused variable binding in a unit serialization test.
tests/rig/src/testing_utils.rs Updates install_system_contracts to accept generic Chain<const RANDOMIZED_TREE>.
tests/rig/src/lib.rs Introduces TestingFramework, tx helpers, and common test utilities (tx_succeeded/failed, signer_from_key, etc.).
tests/rig/src/chain.rs Refactors oracle factory trait, adds RunConfig defaulting based on env, renames only_forwarddo_riscv_run, adds set_chain_id, updates oracle factory dispatch.
tests/instances/unit/src/validator/tx_validator_filtering.rs Migrates validator tests to TestingFramework and disables RISC-V run where validator behavior must be observed.
tests/instances/unit/src/tracer/tracer_storage_hooks.rs Migrates storage tracer test to TestingFramework and adjusts address conversions.
tests/instances/unit/src/tracer/tracer_event_hook.rs Migrates event tracer test to TestingFramework and adjusts address conversions.
tests/instances/unit/src/tracer/mod.rs Migrates tracer harness helper to TestingFramework and uses block context setter.
tests/instances/unit/src/tracer/evm_opcodes_logger.rs Migrates opcode logger tests to TestingFramework.
tests/instances/unit/src/initial_slot_regression.rs Updates custom oracle factory impl to new trait shape; migrates test to TestingFramework.
tests/instances/unit/src/coinbase_regression.rs Migrates to TestingFramework and uses shared common_target_address().
tests/instances/transactions/src/native_charging.rs Migrates tx execution/simulation to TestingFramework and uses shared signer helper.
tests/instances/transactions/src/lib.rs Large migration to TestingFramework, removes bespoke run_config helper, centralizes constants and assertions.
tests/instances/transactions/src/l1_tx_resilience.rs Migrates to TestingFramework and shared target address helper.
tests/instances/system_hooks/src/lib.rs Migrates system hook tests to TestingFramework and uses shared tx helpers (tx_succeeded/failed).
tests/instances/precompiles/src/lib.rs Migrates precompile tests to TestingFramework and removes encoding step.
tests/instances/multiblock_batch/src/lib.rs Migrates multiblock proof test to TestingFramework and uses stored proof_input via last_executed_block_info.
tests/instances/header/src/lib.rs Migrates header invariant tests to TestingFramework block runners.
tests/instances/forge_tests/src/lib.rs Migrates forge-style tests to TestingFramework and ZKsyncTxEnvelope inputs.
tests/instances/evm/src/lib.rs Migrates EVM tests/benches to TestingFramework and removes repeated run config wiring.
tests/instances/eth_runner/src/single_run.rs Updates runner config field name to do_riscv_run.
tests/instances/eth_runner/src/live_run/block_execution.rs Updates runner config field name/logic to do_riscv_run: !only_forward.
tests/instances/erc20/src/lib.rs Migrates ERC20 instance tests to TestingFramework and uses with_run_config.
tests/instances/bench/src/lib.rs Migrates benchmark-style test to TestingFramework and ZKsyncTxEnvelope inputs.
tests/fuzzer/fuzz/fuzz_targets/precompiles/common/mod.rs Updates run config field name to do_riscv_run.
tests/evm_tester/src/vm/zk_ee/mod.rs Updates run config field name/logic to do_riscv_run: proof_run.
tests/common/src/zksync_tx/mod.rs Adds Clone derives for tx envelope enums to support new flows.
tests/binary_checker/src/lib.rs Marks verify_default_binaries as ignored by default (intended CI-only).
AGENTS.md Updates testing infrastructure docs for the new testing abstraction and new local test-running guidance.
.github/workflows/ci.yml Enables proving mode env vars in CI, changes test invocation, and adjusts binary checker invocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@antoniolocascio antoniolocascio left a comment

Choose a reason for hiding this comment

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

Generally LGTM, left a couple comments

@github-actions
Copy link
Contributor

Benchmark report

Benchmark Symbol Base Eff Head Eff (%) Base Raw Head Raw (%) Base Blake Head Blake (%) Base Bigint Head Bigint (%)
block_19299001 process_block 315,727,782 315,727,782 (+0.00%) 273,062,382 273,062,382 (+0.00%) 410,630 410,630 (+0.00%) 9,023,830 9,023,830 (+0.00%)
block_22244135 process_block 197,606,679 197,606,679 (+0.00%) 170,690,887 170,690,887 (+0.00%) 172,040 172,040 (+0.00%) 6,040,788 6,040,788 (+0.00%)
precompiles bn254_ecadd 53,268 53,268 (+0.00%) 47,816 47,816 (+0.00%) 0 0 (+0.00%) 1,363 1,363 (+0.00%)
precompiles bn254_ecmul 728,781 728,781 (+0.00%) 564,593 564,593 (+0.00%) 0 0 (+0.00%) 41,047 41,047 (+0.00%)
precompiles bn254_pairing 72,336,733 72,336,733 (+0.00%) 57,808,589 57,808,589 (+0.00%) 0 0 (+0.00%) 3,632,036 3,632,036 (+0.00%)
precompiles ecrecover 477,536 478,773 (+0.26%) 309,484 310,301 (+0.26%) 0 0 (+0.00%) 42,013 42,118 (+0.25%)
precompiles id 927 927 (+0.00%) 927 927 (+0.00%) 0 0 (+0.00%) 0 0 (+0.00%)
precompiles keccak 137,579 137,579 (+0.00%) 137,579 137,579 (+0.00%) 0 0 (+0.00%) 0 0 (+0.00%)
precompiles modexp 31,267,898 31,267,898 (+0.00%) 20,610,078 20,610,078 (+0.00%) 0 0 (+0.00%) 2,664,455 2,664,455 (+0.00%)
precompiles p256_verify 748,861 748,861 (+0.00%) 470,169 470,169 (+0.00%) 0 0 (+0.00%) 69,673 69,673 (+0.00%)
precompiles point_evaluation 52,918,413 52,918,413 (+0.00%) 40,570,377 40,570,377 (+0.00%) 0 0 (+0.00%) 3,087,009 3,087,009 (+0.00%)
precompiles process_block 147,553,889 147,556,297 (+0.00%) 118,084,641 118,086,077 (+0.00%) 5,160 5,160 (+0.00%) 7,346,672 7,346,915 (+0.00%)
precompiles process_transaction 73,487,782 73,489,074 (+0.00%) 58,791,774 58,786,186 (-0.01%) 160 160 (+0.00%) 3,673,362 3,675,082 (+0.05%)
precompiles ripemd 8,013 8,013 (+0.00%) 8,013 8,013 (+0.00%) 0 0 (+0.00%) 0 0 (+0.00%)
precompiles run_tx_loop 146,902,102 146,904,846 (+0.00%) 117,512,534 117,514,306 (+0.00%) 180 180 (+0.00%) 7,346,672 7,346,915 (+0.00%)
precompiles sha256 13,168 13,168 (+0.00%) 13,168 13,168 (+0.00%) 0 0 (+0.00%) 0 0 (+0.00%)
precompiles system_init 46,797 46,797 (+0.00%) 46,797 46,797 (+0.00%) 0 0 (+0.00%) 0 0 (+0.00%)
precompiles verify_and_apply_batch 145,638 146,508 (+0.60%) 109,638 110,188 (+0.50%) 2,250 2,270 (+0.89%) 0 0 (+0.00%)

@0xVolosnikov 0xVolosnikov merged commit d2184d0 into dev Feb 25, 2026
16 checks passed
@0xVolosnikov 0xVolosnikov deleted the vv-testing-setup-refactoring branch February 25, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants