-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[contracts] Port host functions to Weight V2 and storage deposit limit #13565
Conversation
2cb30c7
to
3a35000
Compare
add test for nested call deposit limit save: separate deposit limit for nested calls
save: works with test cleaned up debugging outputs
3a35000
to
e8ce9ee
Compare
Tests are failing. |
e8ce9ee
to
2bfb866
Compare
@pgherveou your comments have been addressed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few more nits
@@ -1076,8 +1090,9 @@ pub mod env { | |||
|
|||
/// Clear the value at the given key in the contract storage. | |||
/// | |||
/// Equivalent to the newer version [`super::seal1::Api::clear_storage`] with the exception of | |||
/// the return type. Still a valid thing to call when not interested in the return value. | |||
/// Equivalent to the newer [`seal1`][`super::api_doc::Version1::clear_storage`] version with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can use Current instead of Version1 to make these links more future proof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea!
Co-authored-by: PG Herveou <pgherveou@gmail.com>
bot merge |
Error: Statuses failed for 0dac6f6 |
d167473
to
0dac6f6
Compare
bot merge force |
The CI pipeline was cancelled due to failure one of the required jobs. |
There is a failing test from this MR IIUC: |
#13565) * added [unstable][seal2] call() * updated test to cover new seal_call proof_limit * docs updated * add [seal2][unstable] instantiate() and test * add [seal2][unstable] weight_to_fee() + docs and test * add [seal2][unstable] gas_left() + docs and test * update benchmarks * add DefaultDepositLimit to pallet Config * specify deposit limit for nested call add test for nested call deposit limit save: separate deposit limit for nested calls * specify deposit limit for nested instantiate save: works with test cleaned up debugging outputs * update benchmarks * added missing fixtures * fix benches * pass explicit deposit limit to storage bench * explicit deposit limit for another set_storage bench * add more deposit limit for storage benches * moving to simplified benchmarks * moved to simplified benchmarks * fix seal_weight_to_fee bench * fix seal_instantiate benchmark * doc typo fix * default dl for benchmarking more dl for tests dl for tests to max deposit_limit fix in instantiate bench fix instantiate bench fix instantiate benchmark fix instantiate bench again remove dbg fix seal bench again fixing it still seal_instantiate zero deposit less runs to check if deposit enough try try 2 try 3 try 4 * max_runtime_mem to Schedule limits * add default deposit limit fallback check to test * weight params renaming * fmt * Update frame/contracts/src/benchmarking/mod.rs Co-authored-by: PG Herveou <pgherveou@gmail.com> * prettify inputs in tests * typestate param refactored --------- Co-authored-by: PG Herveou <pgherveou@gmail.com>
paritytech#13565) * added [unstable][seal2] call() * updated test to cover new seal_call proof_limit * docs updated * add [seal2][unstable] instantiate() and test * add [seal2][unstable] weight_to_fee() + docs and test * add [seal2][unstable] gas_left() + docs and test * update benchmarks * add DefaultDepositLimit to pallet Config * specify deposit limit for nested call add test for nested call deposit limit save: separate deposit limit for nested calls * specify deposit limit for nested instantiate save: works with test cleaned up debugging outputs * update benchmarks * added missing fixtures * fix benches * pass explicit deposit limit to storage bench * explicit deposit limit for another set_storage bench * add more deposit limit for storage benches * moving to simplified benchmarks * moved to simplified benchmarks * fix seal_weight_to_fee bench * fix seal_instantiate benchmark * doc typo fix * default dl for benchmarking more dl for tests dl for tests to max deposit_limit fix in instantiate bench fix instantiate bench fix instantiate benchmark fix instantiate bench again remove dbg fix seal bench again fixing it still seal_instantiate zero deposit less runs to check if deposit enough try try 2 try 3 try 4 * max_runtime_mem to Schedule limits * add default deposit limit fallback check to test * weight params renaming * fmt * Update frame/contracts/src/benchmarking/mod.rs Co-authored-by: PG Herveou <pgherveou@gmail.com> * prettify inputs in tests * typestate param refactored --------- Co-authored-by: PG Herveou <pgherveou@gmail.com>
Port host functions to Weight V2 and storage deposit limit
DefaultDepositLimit
pallet config parameter, to allow chains set a fallback default value when a caller doesn't setstorage_deposit_limit
to a call.call
andinstantiate
accept storage deposit limit parameter which allow to set the limit for the sub-call. This might be helpful for cross-contract calls. This limit is enforced right after execution returns from the sub-call, and the sub-call is rolled back if the limit has been exhausted during the call.Drive-by changes
max_runtime_mem
to schedule limits in order to make its configuration for integrity_test smooth.