pallet-revive: Fix the contract size related benchmarks (#7568)
Partly addresses https://github.com/paritytech/polkadot-sdk/issues/6157 The benchmarks measuring the impact of contract sizes on calling or instantiating a contract were bogus because they needed to be written in assembly in order to tightly control the basic block size. This fixes the benchmarks for: - call_with_code_per_byte - upload_code - instantiate_with_code And adds a new benchmark that accounts for the fact that the interpreter will always compile whole basic blocks: - basic_block_compilation After this PR only the weight we assign to instructions need to be addressed. --------- Co-authored-by:cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by:
PG Herveou <pgherveou@gmail.com>
Showing
- Cargo.lock 29 additions, 27 deletionsCargo.lock
- prdoc/pr_7568.prdoc 24 additions, 0 deletionsprdoc/pr_7568.prdoc
- substrate/frame/revive/Cargo.toml 4 additions, 1 deletionsubstrate/frame/revive/Cargo.toml
- substrate/frame/revive/fixtures/Cargo.toml 1 addition, 1 deletionsubstrate/frame/revive/fixtures/Cargo.toml
- substrate/frame/revive/fixtures/build/_Cargo.toml 1 addition, 1 deletionsubstrate/frame/revive/fixtures/build/_Cargo.toml
- substrate/frame/revive/fixtures/contracts/caller_contract.rs 4 additions, 5 deletionssubstrate/frame/revive/fixtures/contracts/caller_contract.rs
- substrate/frame/revive/src/benchmarking/code.rs 42 additions, 4 deletionssubstrate/frame/revive/src/benchmarking/code.rs
- substrate/frame/revive/src/benchmarking/mod.rs 50 additions, 8 deletionssubstrate/frame/revive/src/benchmarking/mod.rs
- substrate/frame/revive/src/lib.rs 1 addition, 0 deletionssubstrate/frame/revive/src/lib.rs
- substrate/frame/revive/src/limits.rs 16 additions, 8 deletionssubstrate/frame/revive/src/limits.rs
- substrate/frame/revive/src/tests.rs 4 additions, 1 deletionsubstrate/frame/revive/src/tests.rs
- substrate/frame/revive/src/wasm/mod.rs 8 additions, 0 deletionssubstrate/frame/revive/src/wasm/mod.rs
- substrate/frame/revive/src/wasm/runtime.rs 10 additions, 0 deletionssubstrate/frame/revive/src/wasm/runtime.rs
- substrate/frame/revive/src/weights.rs 506 additions, 443 deletionssubstrate/frame/revive/src/weights.rs
- substrate/frame/revive/uapi/Cargo.toml 1 addition, 1 deletionsubstrate/frame/revive/uapi/Cargo.toml
Please register or sign in to comment