1. Oct 29, 2020
  2. Oct 26, 2020
  3. Oct 23, 2020
  4. Oct 08, 2020
    • Alexander Theißen's avatar
      seal: Add automated weights for contract API calls (#7017) · 443725f0
      Alexander Theißen authored
      
      
      * seal: Add capability to put uninstrumented code (for benchmarks)
      
      Benchmarks should only measure the overhead of the API calls itself.
      For that reason we want to run them without instrumentation.
      
      * seal: Cap the the data length for deposited events
      
      Data used in events has storage implications for archive nodes.
      Those need to keep the events in storage forever. For that reason
      we want to limit the amount of storage that can be used inside events.
      
      * seal: Fix error reporting in the case out of bound sandbox access
      
      * seal: Refactor existing benchmarks
      
      * seal: Convert benchmark file to tabs
      
      * seal: Add benchmarks for functions called by contracts
      
      * seal: Create a default schedule from benchmark generated WeightInfo
      
      * seal: Make use of WeightInfo in extrinsic weight annotations
      
      * seal: Replace the old schedule by the benchmark generated one
      
      * Review: Fix copy paste typo in schedule construction
      
      * Review: Fix stale docs
      
      * Fix whitespace errors
      
      Co-authored-by: default avatarSergei Shulepov <[email protected]>
      
      * Review: Use checked_div in order to be more defensive
      
      * Review: Rename no_charge to already_charged
      
      * Review: Whitelist caller of extrinsics
      
      * Review: Remove trailing whitespace
      
      * Review: Remove confusing "self::" syntax
      
      * Review: Add docs for the benchmark prepration submodule
      
      * Review: Move code generation functions to own module
      
      * Review: Refactor and document benchmark helper functions
      
      * Remove additional empty line
      
      * Added missing comment on caller_funding
      
      * Update frame/contracts/src/benchmarking/code.rs
      
      Co-authored-by: default avatarSergei Shulepov <[email protected]>
      
      * Fix missing sp_std::prelude import in code.rs
      
      * cargo run --release --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark --chain dev --steps 50 --repeat 20 --extrinsic * --execution=wasm --wasm-execution=compiled --output ./bin/node/runtime/src/weights --header ./HEADER --pallet pallet_contracts --heap-pages 4096
      
      * Use weights from the benchmark machine for the substrate node
      
      * Remove prefixes from Schedule members
      
      * Data lengths in the WeightInfo Trait are specified in kilobytes
      
      * Rename ApiWeights to HostFunctionWeights
      
      Co-authored-by: default avatarSergei Shulepov <[email protected]>
      Co-authored-by: default avatarShawn Tabrizi <[email protected]>
      443725f0
  5. Sep 22, 2020
  6. Sep 16, 2020
    • Shawn Tabrizi's avatar
      WeightInfo for Vesting Pallet (#7103) · 9aa8698c
      Shawn Tabrizi authored
      * WeightInfo for Vesting Pallet
      
      * clean up weight docs
      
      * Update lib.rs
      
      * try to pipe max locks
      
      * Update for new type
      
      * add warning when locks > MaxLocks
      
      * Update lib.rs
      
      * fix compile
      
      * remove aliasing, fix trait def
      
      * Update
      9aa8698c
  7. Sep 11, 2020
  8. Aug 10, 2020
    • Alexander Theißen's avatar
      seal: Change prefix and module name from "ext_" to "seal_" for contract callable functions (#6798) · 04b185e3
      Alexander Theißen authored
      * seal: Change prefix "ext_" to "seal_" for contract callable functions
      
      The word Ext is a overloaded term in the context of substrate. It usually
      is a trait which abstracts away access to external resources usually in order
      to mock them away for the purpose of tests. The contract module has its own
      `Ext` trait in addition the the substrate `Ext` which makes things even more
      confusing.
      
      In order to differentiate the contract callable functions more clearly from
      this `Ext` concept we rename them to use the "seal_" prefix instead.
      
      This should change no behaviour at all. This is a pure renaming commit.
      
      * seal: Rename import module from "env" to "seal0"
      
      * seal: Fixup integration test
      
      * seal: Add more tests for new import module names
      04b185e3
  9. Aug 03, 2020
    • Ashley's avatar
      Convert spaces to tabs (#6799) · 07facb13
      Ashley authored
      07facb13
    • Alexander Theißen's avatar
      seal: Fix and improve error reporting (#6773) · 6671d017
      Alexander Theißen authored
      * seal: Rework ext_transfer, ext_instantiate, ext_call error handling
      
      * Deny calling plain accounts (must use transfer now)
      * Return proper module error rather than ad-hoc strings
      * Return the correct error codes from call,instantiate (documentation was wrong)
      * Make ext_transfer fallible again to make it consistent with ext_call
      
      * seal: Improve error messages on memory access failures
      
      * seal: Convert contract trapped to module error
      
      * seal: Add additional tests for transfer, call, instantiate
      
      These tests verify that those functions return the error types
      which are declared in its docs.
      
      * Make it more pronounced that to_execution_result handles trap_reason
      
      * Improve ReturnCode docs
      
      * Fix whitespace issues in wat files
      
      * Improve ReturnCode doc
      
      * Improve ErrorOrigin doc and variant naming
      
      * Improve docs on ExecResult and ExecError
      
      * Encode u32 sentinel value as hex
      
      * with_nested_context no longer accepts an Option for trie
      
      * Fix successful typo
      
      * Rename InvalidContractCalled to NotCallable
      6671d017
  10. Jul 29, 2020
  11. Jul 27, 2020
  12. Jul 21, 2020
  13. Jul 20, 2020
  14. Jul 17, 2020
  15. Jul 10, 2020
  16. Jul 09, 2020
    • Alexander Theißen's avatar
      seal: Rework contracts API (#6573) · 25de5b5c
      Alexander Theißen authored
      * Transition getter functions to not use scratch buffer
      
      * Remove scratch buffer from ext_get_storage
      
      * Remove scratch buffer from ext_call
      
      * Remove scratch buffer from ext_instantiate
      
      * Add ext_input and remove scratch buffer
      
      * Rework error handling (changes RPC exposed data)
      
      * ext_return passes a flags field instead of a return code
      	* Flags is only for seal and not for the caller
      	* flags: u32 replaced status_code: u8 in RPC exposed type
      * API functions use a unified error type (ReturnCode)
      * ext_transfer now traps on error to be consistent with call and instantiate
      
      * Remove the no longer used `Dispatched` event
      
      * Updated inline documentation
      
      * Prevent skipping of copying the output for getter API
      
      * Return gas_consumed from the RPC contracts call interface
      
      * Updated COMPLEXTITY.md
      
      * Rename ext_gas_price to ext_weight_to_fee
      
      * Align comments with spaces
      
      * Removed no longer used `ExecError`
      
      * Remove possible panic in `from_typed_value`
      
      * Use a struct as associated data for SpecialTrap::Return
      
      * Fix nits in COMPLEXITY.md
      
      * Renamed SpecialTrap to TrapReason
      
      * Fix test
      
      * Finish renaming special_trap -> trap_reason
      
      * Remove no longer used get_runtime_storage
      
      * fixup! Remove no longer used get_runtime_storage
      
      * Removed tabs for comment aligment
      25de5b5c
  17. Jul 08, 2020
    • Shawn Tabrizi's avatar
      Add `WeightInfo` to all pallets with benchmarks. (#6575) · 2302898b
      Shawn Tabrizi authored
      * Start adding weight info
      
      * More weightinfo
      
      * finish weight info
      
      * more fixes
      
      * inital update of node runtime
      
      * fix the rest of the compilation
      
      * update balances
      
      * add docs
      
      * fix balances tests
      
      * Fix more tests
      
      * Fix compile
      
      * Fix pallet-evm tests
      2302898b
  18. Jul 07, 2020
  19. Jun 24, 2020
  20. Jun 23, 2020
    • Sergey Pepyakin's avatar
      pallet-contracts: migrate to nested storage transaction mechanism (#6382) · f36b7857
      Sergey Pepyakin authored
      
      
      * Add a simple direct storage access module
      
      * WIP
      
      * Completely migrate to the transactional system.
      
      * Format
      
      * Fix wasm compilation
      
      * Get rid of account_db module
      
      * Make deposit event eager
      
      * Make restore_to eager
      
      * It almost compiles.
      
      * Make it compile.
      
      * Make the tests compile
      
      * Get rid of account_db
      
      * Drop the result.
      
      * Backport the book keeping.
      
      * Fix all remaining tests.
      
      * Make it compile for std
      
      * Remove a stale TODO marker
      
      * Remove another stale TODO
      
      * Add proof for `terminate`
      
      * Remove a stale comment.
      
      * Make restoration diverging.
      
      * Remove redudnant trait: `ComputeDispatchFee`
      
      * Update frame/contracts/src/exec.rs
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      * Introduce proper errors into the storage module.
      
      * Adds comments for contract storage module.
      
      * Inline `ExecutionContext::terminate`.
      
      * Restore_to should not let sacrifice itself if the contract present on the stack.
      
      * Inline `transfer` function
      
      * Update doc - add "if succeeded"
      
      * Adapt to TransactionOutcome changes
      
      * Updates the docs for `ext_restore_to`
      
      * Add a proper assert.
      
      * Update frame/contracts/src/wasm/runtime.rs
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      Co-authored-by: default avatarAlexander Theißen <[email protected]>
      f36b7857
  21. Jun 15, 2020
    • thiolliere's avatar
      Introduce in-origin filtering (#6318) · c2ad2727
      thiolliere authored
      
      
      * impl filter in origin
      
      * remove IsCallable usage. Breaking: utility::batch(root, calls) no longer bypass BasicCallFilter
      
      * rename BasicCallFilter -> BaseCallFilter
      
      * refactor code
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      
      * remove forgotten temporar comment
      
      * better add suggestion in another PR
      
      * refactor: use Clone instead of mem::replace
      
      * fix tests
      
      * fix tests
      
      * fix tests
      
      * fix benchmarks
      
      * Make root bypass filter in utility::batch
      
      * fix unused imports
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      c2ad2727
  22. Jun 12, 2020
  23. May 28, 2020
  24. May 25, 2020
  25. May 21, 2020
  26. May 20, 2020
    • Tomasz Drwięga's avatar
      Maximum extrinsic weight limit (#6067) · f74a7171
      Tomasz Drwięga authored
      * Only check single extrinsics weight limit in validate_transaction.
      
      * Add missing parameter to all pallets.
      
      * Add tests, fix default configuration.
      
      * Bump spec version.
      
      * Use AvailableBlockRation to calculate MaxExtrinsicWeight
      f74a7171
  27. Apr 25, 2020
    • Shawn Tabrizi's avatar
      Introduce `BlockExecutionWeight` and `ExtrinsicBaseWeight` (#5722) · 8a33c297
      Shawn Tabrizi authored
      
      
      * Introduce `BlockExectionWeight` and `ExtrinsicBaseWeight`
      
      * Add new traits everywhere
      
      * Missed one update
      
      * fix tests
      
      * Update `check_weight` logic
      
      * introduce `max_extrinsic_weight` function
      
      * fix + add tests
      
      * format nits
      
      * remove println
      
      * make test a bit more clear
      
      * Remove minimum weight
      
      * newlines left over from find/replace
      
      * Fix test, improve clarity
      
      * Fix executor tests
      
      * Extrinsic base weight same as old `MINIMUM_WEIGHT`
      
      * fix example test
      
      * Expose constants
      
      * Add test for full block with operational and normal
      
      * Initiate test environment with `BlockExecutionWeight` weight
      
      * format nit
      
      * Update frame/system/src/lib.rs
      
      Co-Authored-By: default avatarKian Paimani <[email protected]>
      
      * Replace `TransactionBaseFee` with `ExtrinsicBaseWeight` (#5761)
      
      * Replace `TransactionBaseFee` with `ExtrinsicBaseFee`
      
      * Fix stuff
      
      * Fix and make tests better
      
      * Forgot to update this test
      
      * Fix priority number in test
      
      * Remove minimum weight from merge
      
      * Fix weight in contracts
      
      * remove `TransactionBaseFee` from contract tests
      
      * Let `register_extra_weight_unchecked` go past `MaximumBlockWeight`
      
      * address feedback
      
      Co-authored-by: default avatarKian Paimani <[email protected]>
      8a33c297
  28. Apr 24, 2020
  29. Apr 22, 2020
  30. Apr 20, 2020
  31. Apr 16, 2020
  32. Apr 08, 2020
  33. Mar 31, 2020