[pallet_contracts] Add support for transient storage in contracts host functions (#4566)
Introduce transient storage, which behaves identically to regular storage but is kept only in memory and discarded after every transaction. This functionality is similar to the `TSTORE` and `TLOAD` operations used in Ethereum. The following new host functions have been introduced: `get_transient_storage` `set_transient_storage` `take_transient_storage` `clear_transient_storage` `contains_transient_storage` Note: These functions are declared as `unstable` and thus are not activated. --------- Co-authored-by: command-bot <> Co-authored-by:PG Herveou <pgherveou@gmail.com> Co-authored-by:
Alexander Theißen <alex.theissen@me.com>
parent
cde2eb42
Showing
- cumulus/parachains/runtimes/contracts/contracts-rococo/src/contracts.rs 1 addition, 0 deletions...ains/runtimes/contracts/contracts-rococo/src/contracts.rs
- prdoc/pr_4566.prdoc 23 additions, 0 deletionsprdoc/pr_4566.prdoc
- substrate/bin/node/runtime/src/lib.rs 1 addition, 0 deletionssubstrate/bin/node/runtime/src/lib.rs
- substrate/frame/contracts/fixtures/contracts/create_transient_storage_and_call.rs 56 additions, 0 deletions...s/fixtures/contracts/create_transient_storage_and_call.rs
- substrate/frame/contracts/fixtures/contracts/set_transient_storage.rs 42 additions, 0 deletions...ame/contracts/fixtures/contracts/set_transient_storage.rs
- substrate/frame/contracts/fixtures/contracts/transient_storage.rs 58 additions, 0 deletions...e/frame/contracts/fixtures/contracts/transient_storage.rs
- substrate/frame/contracts/src/benchmarking/call_builder.rs 41 additions, 5 deletionssubstrate/frame/contracts/src/benchmarking/call_builder.rs
- substrate/frame/contracts/src/benchmarking/mod.rs 291 additions, 0 deletionssubstrate/frame/contracts/src/benchmarking/mod.rs
- substrate/frame/contracts/src/exec.rs 319 additions, 0 deletionssubstrate/frame/contracts/src/exec.rs
- substrate/frame/contracts/src/lib.rs 20 additions, 4 deletionssubstrate/frame/contracts/src/lib.rs
- substrate/frame/contracts/src/storage.rs 1 addition, 1 deletionsubstrate/frame/contracts/src/storage.rs
- substrate/frame/contracts/src/tests.rs 64 additions, 0 deletionssubstrate/frame/contracts/src/tests.rs
- substrate/frame/contracts/src/transient_storage.rs 698 additions, 0 deletionssubstrate/frame/contracts/src/transient_storage.rs
- substrate/frame/contracts/src/wasm/mod.rs 353 additions, 0 deletionssubstrate/frame/contracts/src/wasm/mod.rs
- substrate/frame/contracts/src/wasm/runtime.rs 225 additions, 1 deletionsubstrate/frame/contracts/src/wasm/runtime.rs
- substrate/frame/contracts/src/weights.rs 566 additions, 384 deletionssubstrate/frame/contracts/src/weights.rs
- substrate/frame/contracts/uapi/src/host.rs 83 additions, 1 deletionsubstrate/frame/contracts/uapi/src/host.rs
- substrate/frame/contracts/uapi/src/host/riscv32.rs 20 additions, 0 deletionssubstrate/frame/contracts/uapi/src/host/riscv32.rs
- substrate/frame/contracts/uapi/src/host/wasm32.rs 81 additions, 0 deletionssubstrate/frame/contracts/uapi/src/host/wasm32.rs
Please register or sign in to comment