- Oct 08, 2020
-
-
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: Sergei 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: Sergei 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: Sergei Shulepov <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
-
- Sep 22, 2020
-
-
Bastian Köcher authored
* Rename `ModuleToIndex` to `PalletRuntimeSetup` Besides the renaming it also adds support getting the name of a pallet as configured in the runtime. * Rename it to `PalletInfo` * Remove accidentally added files
-
- Sep 16, 2020
-
-
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
-
- Sep 11, 2020
-
-
Denis_P authored
* change (ci): docs job optimized; runs every commit; fails on warnings * change (ci): rename jobs; temporary allow failing * change (ci): better warnings filtering * fix (ci): hotfix Docker release * test (ci): run docs job with flags * test (ci): pwd fails * change (ci): pass just //doc dir as an artifact; debug * change (ci): return to the previous structure; undebug * change (ci): typo * rebase on upstream 2 * fix the jobname * Fix some warnings (#7079) * Partial fix for transaction priority (#7034) * Partial fix for priority stuff. * Small fix * Fix tests. * Update frame/transaction-payment/src/lib.rs Co-authored-by: Tomasz Drwięga <[email protected]> * Better doc Co-authored-by: Tomasz Drwięga <[email protected]> * What happens if we remove wat? (#7056) * What happens if we remove wat? * Update Cargo.lock * Make SlashingSpans Public (#6961) * Make SlashingSpans Public Offchain Applications will often need to inspect this type because it is directly used in staking election, thus worthy of being `pub`. Rest of the slashing api can remain private, only this and the `fn last_non_zero_slash()` of `SlashingSpans` are of interest. * Update frame/staking/src/lib.rs * client/authority-discovery/src/service: Improve docs (#7059) * Decrease poll interval (#7063) * Remove unused code (#7027) Signed-off-by: Jimmy Chu <[email protected]> * Disambiguate `BlockNumber` type in `decl_module` (#7061) * Disambiguate `BlockNumber` type in `decl_module` * fix `frame-support-tests` * fix ui tests * fix trait order * Implement `FromStr` for `Ss58AddressFormat` (#7068) * Implement `FromStr` for `Ss58AddressFormat` * Update primitives/core/src/crypto.rs Co-authored-by: Shawn Tabrizi <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]> * Set reserved nodes with offchain worker. (#6996) * add offchain worker api to set reserved nodes. * new offchain api to get node public key. * node public key from converter * refactor set reserved nodes ocw api. * new ndoe authorization pallet * remove unnecessary clone and more. * more * tests for node authorization pallet * remove dependency * fix build * more tests. * refactor * Update primitives/core/src/offchain/testing.rs Co-authored-by: Tomasz Drwięga <[email protected]> * Update frame/node-authorization/src/lib.rs Co-authored-by: Tomasz Drwięga <[email protected]> * Update frame/node-authorization/src/lib.rs Co-authored-by: Tomasz Drwięga <[email protected]> * Update frame/node-authorization/src/lib.rs Co-authored-by: Tomasz Drwięga <[email protected]> * format code * expose NetworkService * remove NetworkStateInfo in offchain * replace NodePublicKey with PeerId. * set max length of peer id. * clear more * use BTreeSet for set of peers. * decode opaque peer id. * extract NetworkProvider for client offchain. * use OpaquePeerId in node authorization pallet. * fix test * better documentation * fix test * doc * more fix * Update primitives/core/src/offchain/mod.rs Co-authored-by: Pierre Krieger <[email protected]> * Update client/offchain/src/api.rs Co-authored-by: Pierre Krieger <[email protected]> * derive serialize and deserialize Co-authored-by: Tomasz Drwięga <[email protected]> Co-authored-by: Pierre Krieger <[email protected]> * Fix some warnings Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Tomasz Drwięga <[email protected]> Co-authored-by: Sergei Shulepov <[email protected]> Co-authored-by: Max Inden <[email protected]> Co-authored-by: s3krit <[email protected]> Co-authored-by: Jimmy Chu <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: kaichao <[email protected]> Co-authored-by: Pierre Krieger <[email protected]> * Fix more doc errors * More doc fixes * Remove subdb to make `rustdoc` happy * Make the line length check happy * Fix compilation error * Another try * Allow unused Co-authored-by: Dan Forbes <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Tomasz Drwięga <[email protected]> Co-authored-by: Sergei Shulepov <[email protected]> Co-authored-by: Max Inden <[email protected]> Co-authored-by: s3krit <[email protected]> Co-authored-by: Jimmy Chu <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: kaichao <[email protected]> Co-authored-by: Pierre Krieger <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
- Aug 10, 2020
-
-
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
-
- Aug 03, 2020
-
-
Ashley authored
-
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
-
- Jul 29, 2020
-
-
Shawn Tabrizi authored
* initial mock * add test * remove unneeded clone * Update frame/support/src/weights.rs Co-authored-by: Alexander Theißen <[email protected]> * fix compile * Update frame/support/src/weights.rs Co-authored-by: Alexander Popiak <[email protected]> * Update frame/sudo/src/lib.rs Co-authored-by: André Silva <[email protected]> * Apply suggestions from code review Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: Alexander Popiak <[email protected]> Co-authored-by: André Silva <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
Gavin Wood authored
-
Alexander Theißen authored
* seal: Fix syntax that confuses rust-analyzer * seal: Add benchmarks for Dispatchables These are only the benchmarks for the dispatchables of the pallet. Those are not listed in the Schedule because we do not want to pull the Schedule from storage before dispatching. This OK because those costs are not related to actual contract execution. Those costs (instruction costs, ext_* costs) will be benchmarked seperatly and entered into the default Schedule. * seal: Add a maximum code size * Fix comments from review * Removed SEED constant
-
- Jul 27, 2020
-
-
Alexander Theißen authored
* seal: Fail instantiate if new contract is below subsistence threshold We need each contract that exists to be above the subsistence threshold in order to keep up the guarantuee that we always leave a tombstone behind with the exception of a contract that called `ext_terminate`. * Fixup executor test * Bump runtime
-
- Jul 21, 2020
-
-
pscott authored
* Improve overall performance * Clean up code Co-authored-by: Bastian Köcher <[email protected]> * Remove needless :: Co-authored-by: Bastian Köcher <[email protected]> * Remove needless :: Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Kian Paimani <[email protected]>
-
- Jul 20, 2020
-
-
warfollowsme | ryabina.io authored
* More app-friendly event description * change origin -> owner * checked all decl_event! and changed decriptions. * annotated parameter names for remaining events
-
- Jul 17, 2020
-
-
Gavin Wood authored
* Fixes and tests * Don't set subs be re-registered. Also allow subs to de-register themselves and collect the deposit. Also allow individual registering and removal of subs. * Make it build * Update frame/identity/src/lib.rs Co-authored-by: joe petrowski <[email protected]> * Tests * Add benchmarks * Add some reasonable weights * Docs Co-authored-by: joe petrowski <[email protected]>
-
- Jul 10, 2020
-
-
Alexander Theißen authored
* seal: Do not allow transfers to bring total balance below subsistence deposit This also reworks the rent system to take the total balance into account when evaluating whether the account is above the subsistence deposit. * Fix nits from review * Fix typo * Do not enforce subsistence when called from EOA * Rename CallOrigin to TransactorKind * Add debug asserts to check the invariants of a plain account transactor * Fix typo Co-authored-by: Sergei Shulepov <[email protected]> Co-authored-by: Sergei Shulepov <[email protected]>
-
- Jul 09, 2020
-
-
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
-
- Jul 08, 2020
-
-
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
-
- Jul 07, 2020
-
-
Shaopeng Wang authored
* Use frame_system as default ident. * Remove unused 'frame_system' to 'system' renaming. * Fix construct_runtime_ui tests. * Rename system to frame_system in sudo/utility pallet test. * Bump runtime impl_version. * Update formatting.
-
- Jun 24, 2020
-
-
Alexander Theißen authored
Those are way too hard to audit and make only sense with specific chains. They shouldn't be in the core API.
-
Alexander Theißen authored
* seal: Refactor ext_gas_price * Remove seals dependency on pallet_transaction_payment * Add weight as an argument to ext_gas_price * Fixed documentation nits from review * Do not use unchecked math even in test code
-
- Jun 23, 2020
-
-
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: Alexander 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: Alexander Theißen <[email protected]> Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: Alexander Theißen <[email protected]>
-
- Jun 15, 2020
-
-
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: Kian 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: Kian Paimani <[email protected]>
-
- Jun 12, 2020
-
-
Alexander Theißen authored
* Deprecate FunctionOf and remove users * Remove unused import
-
- May 28, 2020
-
-
Sergey Pepyakin authored
* Don't store the storage size offset in the contract itself. * Clean the AccountDb code a bit * Use `storage_size: 0` when creating AliveContractInfo * Count empty storage items. * Update frame/contracts/src/account_db.rs Co-authored-by: Nikolay Volf <[email protected]> * Use more clear wording. Co-authored-by: Alexander Theißen <[email protected]> * Change the order of decrement and increment for storage size Co-authored-by: Nikolay Volf <[email protected]> Co-authored-by: Alexander Theißen <[email protected]>
-
- May 25, 2020
-
-
Sergey Pepyakin authored
-
- May 21, 2020
-
-
Demi Obenour authored
* Add notes about safe uses of twox * Update frame/grandpa/src/lib.rs Co-authored-by: Nikolay Volf <[email protected]> * Update frame/elections/src/lib.rs * Apply suggestions from code review Co-authored-by: Gavin Wood <[email protected]> Co-authored-by: Nikolay Volf <[email protected]>
-
Alexander Theißen authored
* Emit a PaymentParameters event once per block This contains per-block paramaters need to calculate fees off-chain. * Add WeightToFee trait * Add documentation to polynomial types * Ignore pseudo code snippet for doc tests * Use `Mul` implementation of Perbill * Add tests for WeightToFeePolynomial * Revert "Emit a PaymentParameters event once per block" This reverts commit 6c4763baff3d8179676a3c1660fe7063fd56a8ca. Co-authored-by: Gavin Wood <[email protected]>
-
- May 20, 2020
-
-
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
-
- Apr 25, 2020
-
-
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: Kian 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: Kian Paimani <[email protected]>
-
- Apr 24, 2020
-
-
Alexander Theißen authored
Co-Authored-By: Tomasz Drwięga <[email protected]> Co-Authored-By: Sergei Pepyakin <[email protected]>
-
- Apr 22, 2020
-
-
Kian Paimani authored
* enum Pays for PaysFee * Fix doc test * Update bin/node/executor/tests/basic.rs * Update bin/node/executor/tests/basic.rs
-
Kian Paimani authored
* Migrate away from SimpleDispatchInfo * Fix imports * Better doc * Update lib.rs Co-authored-by: Shawn Tabrizi <[email protected]>
-
- Apr 20, 2020
-
-
cheme authored
Co-Authored-By: thiolliere <[email protected]>
-
- Apr 16, 2020
-
-
Shawn Tabrizi authored
Co-Authored-By: Kian Paimani <[email protected]>
-
- Apr 08, 2020
-
-
Stanislav Tkach authored
* Move contracts wasm test code into separate files * Move crypto_hashes into a separate file * Load wasm code at runtime * Move wasm files * Fix wasm formatting * Update crypto_hashes file
-
Alexander Theißen authored
* Refactor SignedExtension * Move DispatchInfo Associated type to Dispatchable * Bound Call: Dispatchable * Pass PostDispatchInfo to post_dispatch * Pass DispatchInfo by reference to avoid clones * Whitespace fix Co-Authored-By: Tomasz Drwięga <[email protected]> * Style changes from code review Co-Authored-By: Kian Paimani <[email protected]> * Only decalre in test mod to remove warning * Deduplicate Call definition * Bound frame_system::trait::Call by Dispatchable * Introduce DispatchInfoOf type alias * Whitespace fix from review Co-Authored-By: Bastian Köcher <[email protected]> Co-authored-by: Tomasz Drwięga <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
- Mar 31, 2020
-
-
Shawn Tabrizi authored
* Don't populate runtime events in genesis * typo * Change to block zero * Fix vesting tests * Update frame/system/src/lib.rs Co-Authored-By: Bastian Köcher <[email protected]> * Update frame/system/src/lib.rs Co-Authored-By: Bastian Köcher <[email protected]> * Add test * Fix test * Fix contract tests * Fix phragmen tests * Fix Generic Assets Tests * Fix offences tests * Fix im-online * fix recovery * Fix utility tests * Shorter * Use ext Co-authored-by: Bastian Köcher <[email protected]>
-
- Mar 26, 2020
-
-
Kian Paimani authored
* Disallow default weight * Fix build and test * Fix tests * Fix another beloved ui test. * fix beloved trybuild tests * fix treasury? * Final test fix * Fix build * Fix another one * Fix * More doctest fix
-
Alexander Theißen authored
* contracts: Remove OnKilledAccount implementation Contracts now longer rely on this callback to tell them when they are removed. Instead, they can only self destruct using `ext_terminate`. * Fix account removal test * Fix account storage removal
-
- Mar 25, 2020
-
-
Sergey Pepyakin authored
-