1. Jan 25, 2023
  2. Jan 18, 2023
  3. Jan 11, 2023
  4. Jan 05, 2023
  5. Dec 27, 2022
  6. Dec 22, 2022
  7. Dec 13, 2022
  8. Dec 06, 2022
  9. Nov 30, 2022
  10. 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
  11. 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
  12. Nov 03, 2022
  13. Oct 24, 2022
  14. Oct 11, 2022
  15. 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
  16. Sep 15, 2022
  17. Sep 13, 2022
  18. 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
  19. Sep 07, 2022
  20. 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
  21. 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
  22. Aug 08, 2022
  23. Jul 25, 2022
  24. 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
  25. May 20, 2022
  26. May 10, 2022
  27. May 04, 2022
  28. Apr 30, 2022
  29. Apr 16, 2022
  30. Mar 29, 2022
    • Sasha Gryaznov's avatar
      contracts: add `seal_code_hash` and `seal_own_code_hash` to API (#10933) · e4caf738
      Sasha Gryaznov authored
      
      
      * `seal_origin` + tests added
      
      * `seal_origin` benchmark added
      
      * `seal_code_hash` + tests added
      
      * `seal_code_hash` benchmark added
      
      * `seal_own_code_hash` + tests added
      
      * `seal_own_code_hash` benchmark added
      
      * fmt lil fix
      
      * akward accident bug fix
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      * benchmark fix
      
      * `WasmModule::getter()` to take `module_name` arg
      
      * test enhanced
      
      * fixes based on review feedback
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      * Hash left as const to return a ref to it from mock
      
      * HASH test val to local const in mock
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      * fixes to benchmarks according to review feedback
      
      * cargo run --quiet --profile=production  --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
      
      * removed `seal_origin` from API
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: default avatarParity Bot <[email protected]>
      e4caf738
  31. Mar 15, 2022
  32. Mar 04, 2022
  33. Feb 15, 2022
    • Alexander Theißen's avatar
      contracts: Fix `seal_call` weights (#10796) · b82cfbac
      Alexander Theißen authored
      
      
      * Fix call weights
      
      * Fix instantiate benchmark
      
      * cargo run --quiet --profile=production  --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
      
      * Remove stale and superflous comments
      
      * `decrement_refcount` should be infallible
      
      * Don't hardcode increment_refcount, decrement_refcount
      
      * Rename CopyIn/CopyOut
      
      * Fix warning in tests
      
      Co-authored-by: default avatarParity Bot <[email protected]>
      b82cfbac
  34. Feb 11, 2022
  35. Feb 08, 2022
    • Yarik Bratashchuk's avatar
      `seal_delegate_call` api function (support for library contracts) (#10617) · d14e1c64
      Yarik Bratashchuk authored
      * seal_call_code implementation
      
      - tests
      - benchmark
      
      * Addressing @xgreenx's comments
      
      * Fix test-linux-stable-int
      
      * Rename seal_call_code to seal_delegate_call
      
      * Pass value unchanged into lib contract
      
      * Address @athei's comments
      
      - whitespace .wat issues
      - wrong/missing .wat comments
      - redundant .wat calls/declarations
      
      - change order of functions (seal_delegate_call right after seal_call)
        in decls, tests, benchmark
      - fix comments, move doc comments to enum variants
      - remove unnecessary empty lines
      
      - rename runtime cost DelegateCall to DelegateCallBase
      - do not set CallFlags::ALLOW_REENTRY for delegate_call
      
      * Do not pass CallFlags::ALLOWS_REENTRY for delegate_call
      
      * Update comment for seal_delegate_call and CallFlags
      
      * Addressing @athei's comments (minor)
      
      * Allow reentry for a new frame after delegate_call (revert)
      
      * Same seal_caller and seal_value_transferred for lib contract
      
      - test
      - refactor frame args due to review
      - logic for seal_caller (please review)
      
      * Put caller on frame for delegate_call, minor fixes
      
      * Update comment for delegate_call
      
      * Addressing @athei's comments
      
      * Update weights generated by benchmark
      
      * Improve comments
      
      * Address @HCastano's comments
      
      * Update weights, thanks @joao-paulo-parity
      
      * Improve InvalidCallFlags error comment
      d14e1c64
  36. Feb 04, 2022
  37. Jan 24, 2022
    • Alexander Theißen's avatar
      Pre-Charge max size when contracts access storage (#10691) · dc45201a
      Alexander Theißen authored
      
      
      * Fix seal_get_storage
      
      * Fix seal_take_storage
      
      * Add more benchmarks
      
      * cargo run --quiet --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
      
      * Fix seal_set_storage
      
      * Fix seal_contains_storage and seal_clear_storage
      
      * Fix benchmarks
      
      * cargo run --quiet --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
      
      * Get rid of mem::size_of in benchmarks
      
      * Fix up code loading
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarHernando Castano <[email protected]>
      
      * Fix test to call same function twice
      
      * Replaced u32::MAX by SENTINEL const
      
      * Fix seal_contains_storage benchmark
      
      * cargo run --quiet --profile=production  --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
      
      Co-authored-by: default avatarParity Bot <[email protected]>
      Co-authored-by: default avatarHernando Castano <[email protected]>
      dc45201a
  38. Jan 17, 2022