1. May 02, 2023
    • juangirini's avatar
      contracts: Make Origin information available (#13708) · 5db4119f
      juangirini authored
      
      
      * contracts: allow root calls
      
      * contracts: update ContractOrigin
      
      * contracts: test allow root calls
      
      * contracts: rustfmt
      
      * contracts: test root caller traps
      
      * contracts: add Caller enum
      
      * contracts: improve some comments
      
      * contracts: improve some comments
      
      * contracts: format code with +nightly
      
      * contracts: fix failing tests
      
      * contracts: improve charte instantiate call when root origin
      
      * contract: refactor common, call and instantiate inputs
      
      * contracts: fix some failing test
      
      * contracts: trap caller when there is no account id
      
      * Update frame/contracts/src/lib.rs
      
      Co-authored-by: default avatarPG Herveou <[email protected]>
      
      * Update frame/contracts/src/exec.rs
      
      Co-authored-by: default avatarPG Herveou <[email protected]>
      
      * contracts: make `into_deposit` return zero when the origin is root
      
      * contracts: cargo fmt
      
      * contracts: charging and terminating tests refactored
      
      * contracts: improved errors
      
      * contracts: refactor & merge ContractOrigin cand Caller enums
      
      * Update frame/contracts/src/lib.rs
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * contracts: apply suggested pr changes
      
      * contracts: rename Caller to Origin
      
      * contracts: refactor run fn
      
      * contracts: cr improvements
      
      * contracts: allow root to use delegate call
      
      * contracts: add caller_is_root weight
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * contracts: add caller_is_root benchmarking
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * contracts: add caller_is_root benchmarking
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * contracts: add some minor improvements
      
      * contracts: make caller_is_root runtime fn unstable
      
      * contracts: fix failing wasm test
      
      * contracts: update benchmarking for origin_is_root
      
      * contracts: improve seal_caller_is_root benchmarking
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * contracts: add small pr improvements
      
      * contracts: fix broken tests after master merge
      
      * contracts: acknowledge the default storage deposit limit
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * contracts: move origin to CommonInput
      
      * contracts: add some extra tests
      
      * contracts: move ensure origin logic inside invokable::run_guarded
      
      * contracts: add minor improvements
      
      * contracts: fix caller_is_root benchmarking
      
      * contracts: improve function description
      
      * Update frame/contracts/src/lib.rs
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * Update frame/contracts/src/lib.rs
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * Update frame/contracts/src/wasm/runtime.rs
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * contracts: improve function description
      
      ---------
      
      Co-authored-by: parity-processbot <>
      Co-authored-by: default avatarPG Herveou <[email protected]>
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      5db4119f
  2. Apr 26, 2023
    • Sasha Gryaznov's avatar
      [contracts] Port host functions to Weight V2 and storage deposit limit (#13565) · 60310de7
      Sasha Gryaznov authored
      
      
      * 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: default avatarPG Herveou <[email protected]>
      
      * prettify inputs in tests
      
      * typestate param refactored
      
      ---------
      
      Co-authored-by: default avatarPG Herveou <[email protected]>
      60310de7
  3. Apr 13, 2023
  4. Apr 12, 2023
    • PG Herveou's avatar
      contracts: add sr25519_verify (#13724) · 03c99fe0
      PG Herveou authored
      
      
      * wip
      
      * fix
      
      * wip
      
      * fix lint
      
      * rm fixture fix
      
      * missing comment
      
      * fix lint
      
      * add comment to the wsm file
      
      * fix comment
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * wip
      
      * wip weights
      
      * wip weights
      
      * PR comment: test with return code
      
      * wip
      
      * PR review add mock test
      
      * remove
      
      * lint
      
      * Update frame/contracts/fixtures/sr25519_verify.wat
      
      * fix comments
      
      * Update frame/contracts/src/benchmarking/mod.rs
      
      * Update frame/contracts/src/wasm/runtime.rs
      
      * Update frame/contracts/fixtures/sr25519_verify.wat
      
      * Update frame/contracts/src/benchmarking/mod.rs
      
      * fix lint
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * Update frame/contracts/src/wasm/runtime.rs
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      * PR: review use unstable + remove arbitrary index 4
      
      * Add benchmark for calculating overhead of calling sr25519_verify
      
      * fix message length encoding
      
      * fix weights
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * Apply suggestions from code review
      
      * Update frame/contracts/src/wasm/runtime.rs
      
      * Update frame/contracts/src/wasm/runtime.rs
      
      * Update frame/contracts/src/benchmarking/mod.rs
      
      * Update frame/contracts/src/benchmarking/mod.rs
      
      * Update frame/contracts/src/schedule.rs
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * Update frame/contracts/src/schedule.rs
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * Update frame/contracts/src/wasm/runtime.rs
      
      * Update frame/contracts/src/wasm/runtime.rs
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * PR review
      
      ---------
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      03c99fe0
  5. Mar 27, 2023
  6. Mar 20, 2023
    • Alexander Theißen's avatar
      contracts: Upgrade to wasmi 0.28 (#13312) · 82cb6992
      Alexander Theißen authored
      * Upgrade to wasmi 0.28
      
      * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts
      
      * Update stale comment
      
      * Renamed variants of `Determinism`
      
      * Compile fix
      
      ---------
      
      Co-authored-by: command-bot <>
      82cb6992
  7. Mar 17, 2023
  8. Mar 02, 2023
  9. Feb 21, 2023
    • Vivek Pandya's avatar
      Remove years from copyright notes. (#13415) · bc53b9a0
      Vivek Pandya authored
      * Change copyright year to 2023 from 2022
      
      * Fix incorrect update of copyright year
      
      * Remove years from copy right header
      
      * Fix remaining files
      
      * Fix typo in a header and remove update-copyright.sh
      bc53b9a0
  10. Feb 20, 2023
  11. Feb 14, 2023
  12. Jan 25, 2023
  13. Jan 18, 2023
  14. Jan 11, 2023
  15. Jan 05, 2023
  16. Dec 27, 2022
  17. Dec 22, 2022
  18. Dec 13, 2022
  19. Dec 06, 2022
  20. Nov 30, 2022
  21. Nov 24, 2022
    • Alexander Theißen's avatar
      contracts: Replace `sp-sandbox` and `wasmi-validation` by newest wasmi (#12501) · 08657f14
      Alexander Theißen authored
      
      
      * Replace sp-sandbox and wasmi-validation by just wasmi
      
      * ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
      
      * Re-check original code on re-instrumentation
      
      * Fix clippy
      
      * ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarRobin Freyler <[email protected]>
      
      * Replace wasmi by ::wasmi
      
      * Bump wasmi to 0.20
      
      * Add explanation for `unreachable`
      
      * Change proof
      
      * Fixup master merge
      
      * ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
      
      * Fixup naming inconsistencies introduced by reentrancy PR
      
      * Fix `scan_imports` docs
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * Fixup suggestions
      
      * Remove unnecessary &mut
      
      * Fix test
      
      * ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
      
      * Fix benchmark merge fail
      
      * ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts
      
      * Fix docs as suggested by code review
      
      * Improve docs for `CodeRejected`
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      
      * Fix logic bug when setting `deterministic_only`
      
      * Don't panic when module fails to compile
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarRobin Freyler <[email protected]>
      
      Co-authored-by: command-bot <>
      Co-authored-by: default avatarRobin Freyler <[email protected]>
      Co-authored-by: default avatarSasha Gryaznov <[email protected]>
      08657f14
  22. Nov 15, 2022
    • Artemka374's avatar
      `seal_reentrant_count` returns contract reentrant count (#12695) · 103ea38f
      Artemka374 authored
      * Add logic, test, broken benchmark
      
      * account_entrance_count
      
      * Addressing comments
      
      * Address @agryaznov
      
      's comments
      
      * Add test for account_entrance_count, fix ci
      
      * Cargo fmt
      
      * Fix tests
      
      * Fix tests
      
      * Remove delegated call from test, address comments
      
      * Minor fixes and indentation in wat files
      
      * Update test for account_entrance_count
      
      * Update reentrant_count_call test
      
      * Delegate call test
      
      * Cargo +nightly fmt
      
      * Address comments
      
      * Update reentrant_count_works test
      
      * Apply weights diff
      
      * Add fixture descriptions
      
      * Update comments as suggested
      
      * Update reentrant_count_call test to use seal_address
      
      * add missing code
      
      * cargo fmt
      
      * account_entrance_count -> account_reentrance_count
      
      * fix tests
      
      * fmt
      
      * normalize signatures
      
      Co-authored-by: default avataryarikbratashchuk <[email protected]>
      103ea38f
  23. Nov 03, 2022
  24. Oct 24, 2022
  25. Oct 11, 2022
  26. Oct 02, 2022
    • Alexander Theißen's avatar
      Remove contracts RPCs (#12358) · bb9d2fa7
      Alexander Theißen authored
      * Remove contracts RPCs
      
      * Remove serde as RPC serialization is no longer needed
      
      * Rename folder to match crate name
      
      * Compile fix
      
      * Remove Byte wrapper
      bb9d2fa7
  27. Sep 15, 2022
  28. Sep 13, 2022
  29. Sep 12, 2022
    • Sergej Sakac's avatar
      BREAKING: Rename Call & Event (#11981) · 6e8795af
      Sergej Sakac authored
      
      
      * rename Event to RuntimeEvent
      
      * rename Call
      
      * rename in runtimes
      
      * small fix
      
      * rename Event
      
      * small fix & rename RuntimeCall back to Call for now
      
      * small fixes
      
      * more renaming
      
      * a bit more renaming
      
      * fmt
      
      * small fix
      
      * commit
      
      * prep for renaming associated types
      
      * fix
      
      * rename associated Event type
      
      * rename to RuntimeEvent
      
      * commit
      
      * merge conflict fixes & fmt
      
      * additional renaming
      
      * fix.
      
      * fix decl_event
      
      * rename in tests
      
      * remove warnings
      
      * remove accidental rename
      
      * .
      
      * commit
      
      * update .stderr
      
      * fix in test
      
      * update .stderr
      
      * TRYBUILD=overwrite
      
      * docs
      
      * fmt
      
      * small change in docs
      
      * rename PalletEvent to Event
      
      * rename Call to RuntimeCall
      
      * renamed at wrong places :P
      
      * rename Call
      
      * rename
      
      * rename associated type
      
      * fix
      
      * fix & fmt
      
      * commit
      
      * frame-support-test
      
      * passing tests
      
      * update docs
      
      * rustdoc fix
      
      * update .stderr
      
      * wrong code in docs
      
      * merge fix
      
      * fix in error message
      
      * update .stderr
      
      * docs & error message
      
      * .
      
      * merge fix
      
      * merge fix
      
      * fmt
      
      * fmt
      
      * merge fix
      
      * more fixing
      
      * fmt
      
      * remove unused
      
      * fmt
      
      * fix
      
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      6e8795af
  30. Sep 07, 2022
  31. Aug 31, 2022
    • Shawn Tabrizi's avatar
      Weight v1.5: Opaque Struct (#12138) · 30951822
      Shawn Tabrizi authored
      * initial idea
      
      * update frame_support
      
      * update a bunch more
      
      * add ord
      
      * adjust RuntimeDbWeight
      
      * frame_system builds
      
      * re-export
      
      * frame_support tests pass
      
      * frame_executive compile
      
      * frame_executive builds
      
      * frame_system tests passing
      
      * pallet-utility tests pass
      
      * fix a bunch of pallets
      
      * more
      
      * phragmen
      
      * state-trie-migration
      
      * scheduler and referenda
      
      * pallet-election-provider-multi-phase
      
      * aura
      
      * staking
      
      * more
      
      * babe
      
      * balances
      
      * bunch more
      
      * sudo
      
      * transaction-payment
      
      * asset-tx-payment
      
      * last pallets
      
      * fix alliance merge
      
      * fix node template runtime
      
      * fix pallet-contracts cc @athei
      
      * fix node runtime
      
      * fix compile on runtime-benchmarks feature
      
      * comment
      
      * fix frame-support-test
      
      * fix more tests
      
      * weight regex
      
      * frame system works
      
      * fix a bunch
      
      * more
      
      * more
      
      * more
      
      * more
      
      * more
      
      * more fixes
      
      * update templates
      
      * fix contracts benchmarks
      
      * Update lib.rs
      
      * Update lib.rs
      
      * fix ui
      
      * make scalar saturating mul const
      
      * more const functions
      
      * scalar div
      
      * refactor using constant functions
      
      * move impl
      
      * fix overhead template
      
      * use compactas
      
      * Update lib.rs
      30951822
  32. Aug 22, 2022
    • Sasha Gryaznov's avatar
      [contracts] `define_env!` re-write as a proc macro (#11888) · c930cd0d
      Sasha Gryaznov authored
      * define_env proc macro basics + can_satisfy part ready
      
      * expand_impls part done
      
      * fix of the &FunctionType bug
      
      * pallet is compiled
      
      * updated host fn definition syntax
      
      * docs comments allowed to host fn definitions
      
      * all 53 host funcs re-defined by the new macro
      
      * unstable feat fix
      
      * cleanup
      
      * legacy mbe macros cleaned up
      
      * Added Env ident to macro attribute; all tests pass!
      
      * \#[v(..)] -> \#[version(..)]
      
      * some tiny corrections
      
      * save
      
      * builds with non-magic rt; tests fail
      
      * tests pass
      
      * refactored errors + added docs
      
      * merge err fixed
      
      * fixes on @ascjones review, all except moving away from `pub mod env` syntax
      
      * debug printing cleared
      
      * clippy fix
      c930cd0d
  33. Aug 08, 2022
  34. Jul 25, 2022
  35. Jun 23, 2022
    • Sasha Gryaznov's avatar
      [contracts] Implement transparent hashing for contract storage (#11501) · 68ea2ab0
      Sasha Gryaznov authored
      
      
      * save
      
      * builds and old tests pass
      
      save:  temporary value dropped while borrowed
      
      save: finally builds
      
      test updated but still fails
      
      * type names enhanced
      
      * VarSizedKey bounded to new Config param
      
      * improved wasm runtime updated funcs
      
      * unstable-interface tests fixed
      
      * benchmarks fixed
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      * fixes on feedback
      
      * fixes on feedback applied + make it build
      
      * benchmarks build but fail (old)
      
      * "Original code too large"
      
      * seal_clear_storage bench fixed (code size workaround hack removal tbd)
      
      * bench_seal_clear_storage pass
      
      * bench_seal_take_storage ... ok
      
      * added new seal_set_storage + updated benchmarks
      
      * added new seal_get_storage + updated benchmarks
      
      * added new seal_contains_storage + updated benchmarks
      
      * added tests for _transparent exec functions
      
      * wasm test for clear_storage
      
      * wasm test for take_storage
      
      * wasm test for new set_storage
      
      * wasm test for new get_storage
      
      * wasm test for new contains_storage
      
      * CI fix
      
      * ci fix
      
      * ci fix
      
      * ci fix
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --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
      
      * fixes according to the review feedback
      
      * tests & benchmarks fixed
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --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
      
      * refactoring
      
      * fix to runtime api
      
      * ci fix
      
      * ctx.get_storage() factored out
      
      * ctx.contains_storage() factored out
      
      * number of batches reduced for transparent hashing storage benchmarks
      
      * contracts RPC & pallet::get_storage to use transparent hashing
      
      * node and rpc updated to use get_storage with VarSizedKey
      
      * refactored (more concize)
      
      * refactored contains_storage (DRYed)
      
      * refactored contains_storage (DRYed)
      
      * fix rpc
      
      * fmt fix
      
      * more fixes in rpc
      
      * rollback `Pallet:get_storage` to Vec<u8> and rpc and node parts related to it
      
      * added `KeyDecodingFailed` error
      
      * Revert weird "fmt fix"
      
      This reverts commit c582cfff4b5cb2c9929fd5e3b45519bb24aeb657.
      
      * node-executor basic test update
      
      * fix node-executor basic test
      
      * benchmarks fix
      
      * more benchmarks fix
      
      * FixedSizedKey is hidden from pub, VarSizedKey is exported as StorageKey
      
      * ci fix
      
      * set_storage benchmark fix
      
      * ci fix
      
      * ci fix
      
      * comments improved
      
      * new error code to rpc: KEY_DECODING_FAILED
      
      * Put `rusty-cachier` before PR merge into `master` for `cargo-check-benches` job
      
      * cargo run --quiet --profile=production  --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --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
      
      * minor optimization
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: default avatarParity Bot <[email protected]>
      Co-authored-by: Vladimir Istyufeev's avatarVladimir Istyufeev <[email protected]>
      Co-authored-by: command-bot <>
      68ea2ab0
  36. May 20, 2022
  37. May 10, 2022