-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
/benchmark runtime pallet pallet_contracts |
Finished benchmark for branch: at-rent-params Benchmark: Benchmark Runtime Pallet cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs ResultsPallet: "pallet_contracts", Extrinsic: "on_initialize", Lowest values: [], Highest values: [], Steps: [50], Repeat: 20
|
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.
Thank you for implementing this!
Co-authored-by: Michael Müller <michi@parity.io>
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.
LGTM
Co-authored-by: Andrew Jones <ascjones@gmail.com>
I will merge soon but I want to do some manual testing first whether the forward of the unstable feature works when running the node and then add the feature to the test. |
bot merge |
Waiting for commit status. |
* Move public functions up in rent.rs * Added RentStatus * Fix test name for consistency Co-authored-by: Michael Müller <michi@parity.io> * Mark rent functions as unstable * Add unstable interfaces to README * Fix doc typos Co-authored-by: Andrew Jones <ascjones@gmail.com> * Use DefaultNoBound * Simplify calc_share(1) * Don't output empty debug messages * Make `seal_debug_message` unstable Co-authored-by: Michael Müller <michi@parity.io> Co-authored-by: Andrew Jones <ascjones@gmail.com>
#8231 added
seal_rent_params
which exposes all the rent calculation parameters needed in order to implement custom financing models. However, this would require duplicating the rent calculation in contracts. This PR adds an easier way to implement simpler financing models by adding the functionseal_rent_status
which returns:substrate/frame/contracts/src/rent.rs
Lines 49 to 64 in 360b467
This allows to easily check whether a contract is exempt from rent payments by making sure that at the end of contract execution
*_rent == 0
.Unstable Interface
Driven by the desire to have an iterative approach in developing new contract interfaces we introduce the concept of an unstable interface. Akin to the rust nightly it allows us to add new interfaces but mark them as unstable so that contract languages can experiment with them and give feedback before we stabilize. We need to support interfaces forever and therefore need to do some testing and iterations before we lock ourselves in to one specific interface.
We introduce a new
unstable-interface
feature from thepallet-contracts
crate which makes those features available. It needs to be forwarded to the crate by the runtime. In this PR we add it to the substrate runtime ascontracts-unstable-interface
. Never run a live chain with this feature enabled.seal_debug_message
The recently introduced
seal_debug_message
is made unstable by this PR. It was never released and should go through some testing before we stabilize it. use-ink/ink#792 needs to change its import module once this is in.