Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
eacb017
added [unstable][seal2] call()
agryaznov Mar 7, 2023
b3c9265
updated test to cover new seal_call proof_limit
agryaznov Mar 7, 2023
e226add
docs updated
agryaznov Mar 7, 2023
aba8782
add [seal2][unstable] instantiate() and test
agryaznov Mar 7, 2023
53d8fde
add [seal2][unstable] weight_to_fee() + docs and test
agryaznov Mar 7, 2023
09d1df6
add [seal2][unstable] gas_left() + docs and test
agryaznov Mar 8, 2023
c644fa1
update benchmarks
agryaznov Mar 8, 2023
2cb30c7
add DefaultDepositLimit to pallet Config
agryaznov Mar 8, 2023
a968b29
specify deposit limit for nested call
agryaznov Mar 9, 2023
45b48c2
specify deposit limit for nested instantiate
agryaznov Mar 13, 2023
ec58346
Merge branch 'master' into ag-proof_limit
agryaznov Mar 14, 2023
edf1aac
update benchmarks
agryaznov Mar 14, 2023
2bfb866
added missing fixtures
agryaznov Mar 16, 2023
1ff3f16
fix benches
agryaznov Mar 16, 2023
b0f3103
pass explicit deposit limit to storage bench
agryaznov Mar 16, 2023
3af8712
explicit deposit limit for another set_storage bench
agryaznov Mar 16, 2023
825a6bc
add more deposit limit for storage benches
agryaznov Mar 16, 2023
8f9ea17
moving to simplified benchmarks
agryaznov Mar 16, 2023
6ac5355
Merge branch 'master' into ag-proof_limit
agryaznov Mar 16, 2023
04ead1b
moved to simplified benchmarks
agryaznov Mar 16, 2023
7d1023d
fix seal_weight_to_fee bench
agryaznov Mar 16, 2023
8e6c6d2
fix seal_instantiate benchmark
agryaznov Mar 16, 2023
d618957
Merge branch 'master' into ag-proof_limit
agryaznov Mar 30, 2023
16f0994
doc typo fix
agryaznov Mar 31, 2023
24dcd0e
default dl for benchmarking
agryaznov Mar 31, 2023
d7eab4a
max_runtime_mem to Schedule limits
agryaznov Apr 3, 2023
91fd102
Merge branch 'master' into ag-proof_limit
agryaznov Apr 3, 2023
af1b353
add default deposit limit fallback check to test
agryaznov Apr 12, 2023
04bea78
weight params renaming
agryaznov Apr 12, 2023
c01f166
Merge branch 'master' into ag-proof_limit
agryaznov Apr 12, 2023
50c96da
fmt
agryaznov Apr 12, 2023
95c83ea
Update frame/contracts/src/benchmarking/mod.rs
agryaznov Apr 25, 2023
22c5794
prettify inputs in tests
agryaznov Apr 25, 2023
418aa50
Merge branch 'ag-proof_limit' of github.com:paritytech/substrate into…
agryaznov Apr 25, 2023
0dac6f6
typestate param refactored
agryaznov Apr 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update benchmarks
  • Loading branch information
agryaznov committed Mar 8, 2023
commit c644fa169fe105f5f69850190dcb6575b1071dcb
43 changes: 21 additions & 22 deletions frame/contracts/src/benchmarking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ benchmarks! {
seal_gas_left {
let r in 0 .. API_BENCHMARK_BATCHES;
let instance = Contract::<T>::new(WasmModule::getter(
"seal0", "seal_gas_left", r * API_BENCHMARK_BATCH_SIZE
"seal1", "gas_left", r * API_BENCHMARK_BATCH_SIZE
), vec![])?;
let origin = RawOrigin::Signed(instance.caller.clone());
}: call(origin, instance.addr, 0u32.into(), Weight::MAX, None, vec![])
Expand Down Expand Up @@ -610,9 +610,9 @@ benchmarks! {
let code = WasmModule::<T>::from(ModuleDefinition {
memory: Some(ImportedMemory::max::<T>()),
imported_functions: vec![ImportedFunction {
module: "seal0",
name: "seal_weight_to_fee",
params: vec![ValueType::I64, ValueType::I32, ValueType::I32],
module: "seal1",
name: "weight_to_fee",
params: vec![ValueType::I64,ValueType::I64, ValueType::I32, ValueType::I32],
return_type: None,
}],
data_segments: vec![DataSegment {
Expand All @@ -621,6 +621,7 @@ benchmarks! {
}],
call_body: Some(body::repeated(r * API_BENCHMARK_BATCH_SIZE, &[
Instruction::I64Const(500_000),
Instruction::I64Const(300_000),
Instruction::I32Const(4),
Instruction::I32Const(0),
Instruction::Call(0),
Expand Down Expand Up @@ -1617,17 +1618,17 @@ benchmarks! {
let callee_bytes = callees.iter().flat_map(|x| x.account_id.encode()).collect();
let value: BalanceOf<T> = 0u32.into();
let value_bytes = value.encode();
let value_len = value_bytes.len();
let value_len = BalanceOf::<T>::max_encoded_len() as u32;
let code = WasmModule::<T>::from(ModuleDefinition {
memory: Some(ImportedMemory::max::<T>()),
imported_functions: vec![ImportedFunction {
module: "seal0",
name: "seal_call",
module: "seal2",
name: "call",
params: vec![
ValueType::I32,
ValueType::I32,
ValueType::I64,
ValueType::I32,
ValueType::I64,
ValueType::I32,
ValueType::I32,
ValueType::I32,
Expand All @@ -1642,16 +1643,16 @@ benchmarks! {
value: value_bytes,
},
DataSegment {
offset: value_len as u32,
offset: value_len,
value: callee_bytes,
},
],
call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![
Counter(value_len as u32, callee_len as u32), // callee_ptr
Regular(Instruction::I32Const(callee_len as i32)), // callee_len
Regular(Instruction::I64Const(0)), // gas
Regular(Instruction::I32Const(0)), // flags
Counter(4, callee_len as u32), // callee_ptr
Regular(Instruction::I64Const(0)), // ref_time weight
Regular(Instruction::I64Const(0)), // proof_size weight
Regular(Instruction::I32Const(0)), // value_ptr
Regular(Instruction::I32Const(value_len as i32)), // value_len
Regular(Instruction::I32Const(0)), // input_data_ptr
Regular(Instruction::I32Const(0)), // input_data_len
Regular(Instruction::I32Const(SENTINEL as i32)), // output_ptr
Expand Down Expand Up @@ -1803,7 +1804,7 @@ benchmarks! {
let value = Pallet::<T>::min_balance();
assert!(value > 0u32.into());
let value_bytes = value.encode();
let value_len = value_bytes.len();
let value_len = BalanceOf::<T>::max_encoded_len();
let addr_len = T::AccountId::max_encoded_len();

// offsets where to place static data in contract memory
Expand All @@ -1815,13 +1816,12 @@ benchmarks! {
let code = WasmModule::<T>::from(ModuleDefinition {
memory: Some(ImportedMemory::max::<T>()),
imported_functions: vec![ImportedFunction {
module: "seal0",
name: "seal_instantiate",
module: "seal2",
name: "instantiate",
params: vec![
ValueType::I32,
ValueType::I32,
ValueType::I64,
ValueType::I32,
ValueType::I64,
ValueType::I32,
ValueType::I32,
ValueType::I32,
Expand Down Expand Up @@ -1850,18 +1850,17 @@ benchmarks! {
],
call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE, vec![
Counter(hashes_offset as u32, hash_len as u32), // code_hash_ptr
Regular(Instruction::I32Const(hash_len as i32)), // code_hash_len
Regular(Instruction::I64Const(0)), // gas
Regular(Instruction::I64Const(0)), // ref_time weight
Regular(Instruction::I64Const(0)), // proof_size weight
Regular(Instruction::I32Const(value_offset as i32)), // value_ptr
Regular(Instruction::I32Const(value_len as i32)), // value_len
Regular(Instruction::I32Const(0)), // input_data_ptr
Regular(Instruction::I32Const(0)), // input_data_len
Regular(Instruction::I32Const(addr_offset as i32)), // address_ptr
Regular(Instruction::I32Const(addr_len_offset as i32)), // address_len_ptr
Regular(Instruction::I32Const(SENTINEL as i32)), // output_ptr
Regular(Instruction::I32Const(0)), // output_len_ptr
Regular(Instruction::I32Const(0)), // salt_ptr
Regular(Instruction::I32Const(0)), // salt_ptr_len
Regular(Instruction::I32Const(0)), // salt_len_ptr
Regular(Instruction::Call(0)),
Regular(Instruction::Drop),
])),
Expand Down
3 changes: 1 addition & 2 deletions frame/contracts/src/wasm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1476,8 +1476,7 @@ pub mod env {
/// # Note
///
/// The values `_code_hash_len` and `_value_len` are ignored because the encoded sizes
/// of those types are fixed through
/// [`codec::MaxEncodedLen`]. The fields exist
/// of those types are fixed through [`codec::MaxEncodedLen`]. The fields exist
/// for backwards compatibility. Consider switching to the newest version of this function.
#[prefixed_alias]
fn instantiate(
Expand Down