- Feb 04, 2021
-
-
Alexander Theißen authored
* contracts: Implement refcounting for wasm code * contracts: Charge rent for code storage * contracts: Fix dispatchables erroneously refunding base costs * Fixed typos in comments. Co-authored-by: Andrew Jones <[email protected]> * Remove awkward empty line * Fix more typos in docs * Fix typos in docs Co-authored-by: Andrew Jones <[email protected]> * Split up complicated expression Co-authored-by: Andrew Jones <[email protected]> * review: Remove unused return value * Fix typos Co-authored-by: Andrew Jones <[email protected]> * review: Fix refcount being reset to one on re-instrumentation * Document evictable_code parameter * Make Executable::execute consume and store itself * Added comments about stale values * Disregard struct size in occupied_storage() Co-authored-by: Andrew Jones <[email protected]>
-
- Feb 03, 2021
-
-
Alexander Theißen authored
-
- Feb 02, 2021
-
-
Alexander Theißen authored
* contracts: Document seal_input * contracts: Improve `ReturnCode` docs. * contracts: Improve seal_restore_to docs * review: Improved wording
-
Alexander Theißen authored
* contracts: Remove redundant bool argument from the eviction event * contracts: Improve event documentation * contracts: Emit event on contract termination
-
- Feb 01, 2021
-
-
yjh authored
-
- Jan 29, 2021
-
-
thiolliere authored
* update cargo.toml * use 2.0 in mmmr
-
- Jan 20, 2021
-
-
Andrew Jones authored
* PRINT_PALLET_UPGRADE=1 cargo check -p frame-system * Copy attributes, imports, mods and type defs * Copy Config trait * Annotate constants * Tabify * Migrate hooks * Upgrade template rename interface to hooks * Migrate pallet call * Migrate Event * Migrate Error * Migrate Origin * Remove optional validate_unsigned * Remove remaining TODO_MAYBE_WHERE_CLAUSE * Overwrite original lib.rs with migrated lib2.rs. * Add required Event IsType constraint * Add disable supertrait check * Fix leftover Trait trait * Add missing pallet prefix for weight attributes * Add missing Error type parameter * Add missing Hooks type parameter * Private call visibility, restore original helper types and helpers etc * Fix hooks type parameter * Rename RawEvent to Event * Add missing storage type annotations * Remove unused imports * Add GenesisConfig helpers for compat * Fix unused import warnings * Update frame/support/procedural/src/storage/print_pallet_upgrade.rs Co-authored-by: Guillaume Thiolliere <[email protected]> * Fix test errors and warnings * Fix remaining errors and warnings * Apply review suggestion: fix formatting Co-authored-by: Guillaume Thiolliere <[email protected]> * Apply review suggestion: annotate BlockLength as constant Co-authored-by: Guillaume Thiolliere <[email protected]> * Apply review suggestion: add triling comma Co-authored-by: Guillaume Thiolliere <[email protected]> * Apply review suggestion: add triling comma Co-authored-by: Guillaume Thiolliere <[email protected]> * Apply review suggestion: add trailing comma Co-authored-by: Guillaume Thiolliere <[email protected]> * Apply review suggestion: fix storage type indentation * Apply review suggestion: remove redundant Origin type alias * Add missing codec derives for BlockLength * Restore module docs * Module -> Pallet renamel * Revert "Update frame/support/procedural/src/storage/print_pallet_upgrade.rs" This reverts commit d2a2d5b6 * Apply review suggestion: merge crate imports Co-authored-by: Alexander Theißen <[email protected]> * Revert "Upgrade template rename interface to hooks" This reverts commit 306f0239 * Single line import * Refactor generated genesis build * Import sp_io::storage * Revert previous, fully qualify sp_io::storage * Fix ui tests * Fix errors after merge, missing changes * Set UpgradedToDualRefCount to true in genesis build * Annotated Runtime version with constant, exposing it via metadata * Add metadata attribute Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: Alexander Theißen <[email protected]>
-
- Jan 14, 2021
-
-
Alexander Theißen authored
-
Alexander Theißen authored
* Add rent_payed field to the contract info * Don't pay out more as reward as was spent in rent * Make successful evictions free * Add tests to check that surcharge reward is capped by rent payed * review: Fixed docs
-
Alexander Theißen authored
-
- Jan 13, 2021
-
-
Alexander Theißen authored
* Add `len` function that can return the length of a storage item efficiently * Make use of the new len function in contracts * Fix benchmarks * cargo run --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 * Remove unused imports Co-authored-by: Parity Benchmarking Bot <[email protected]>
-
- Jan 12, 2021
-
-
thiolliere authored
-
- Jan 11, 2021
-
-
Igor Matuszewski authored
* Backport paritytech/substrate#7381 * Bring back genesis storage build in aura/timestamp To not change spec version, see https://github.com/paritytech/substrate/pull/7686#discussion_r540032743 * Backport paritytech/substrate#7238 * Backport paritytech/substrate#7395 * Bump impl_version * Fix UI tests and bump trybuild dep See https://github.com/rust-lang/rust/pull/73996 Backports: https://github.com/paritytech/substrate/pull/7764 https://github.com/paritytech/substrate/pull/7656 * Partially backport paritytech/substrate#7838 * Release frame-support with a dep compilation fix * Bump patch level for remaining crates This is done because at the time of writing cargo-unleash does not fully support partial workspace publishing and mixes both local and crates.io versions of the packages, leading to errors in the release check workflow. * Backport paritytech/substrate#7854 ...to fix compilation error when using futures-* v0.3.9. * Adding Changelog entry for patch release Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Benjamin Kampmann <[email protected]>
-
Alexander Theißen authored
* Pay first rent during instantiation * Fix and add new tests * Do not increment trie id counter on failure
-
- Jan 06, 2021
-
-
Alexander Theißen authored
* Rework rent parameters * No need for empty_pair_count any longer * Parameterize runtime
-
Stanly Johnson authored
* commented use of common * hack to pass tests * another hack * remove all commented code * fix the easy tests * temp hack * follow through comma hack until better solution * patch macro * missed one * update benchmarks * update docs * fix docs * removed too much * fix changes Co-authored-by: Shawn Tabrizi <[email protected]>
-
- Jan 05, 2021
-
-
Alexander Theißen authored
* Prevent contracts from allocating a too large buffer * Fix possible integer overflow
-
- Jan 04, 2021
-
-
Alexander Theißen authored
* Do not evict a contract from within a call stack We don't want to trigger contract eviction automatically when a contract is called. This is because those changes can be reverted due to how storage transactions are used at the moment. More Information: https://github.com/paritytech/substrate/issues/6439#issuecomment-648754324 It can be re-introduced once the linked issue is resolved. In the meantime `claim_surcharge` must be called to evict a contract. * Lazily delete storage in on_initialize instead of when removing the contract * Add missing documentation of new error * Make Module::claim_surcharge public It being the only dispatchable that is private is an oversight. * review: Add final newline * review: Simplify assert statement * Add test that checks that partial remove of a contract works * Premote warning to error * Added missing docs for seal_terminate * Lazy deletion should only take AVERAGE_ON_INITIALIZE_RATIO of the block * Added informational about the lazy deletion throughput * Avoid lazy deletion in case the block is already full * Prevent queue decoding in case of an already full block * Add test that checks that on_initialize honors block limits
-
Alexander Theißen authored
* Make host functions return TrapReason This avoids the need to manually store any trap reasons to the `Runtime` from the host function. This adds the following benefits: * It properly composes with the upcoming chain extensions * Missing to set a trap value is now a compile error * Add chain extension The chain extension is a way for the contract author to add new host functions for contracts to call. * Add tests for chain extensions * Fix regression in set_rent.wat fixture Not all offsets where properly updated when changing the fixtures for the new salt on instantiate. * Pre-charge a weight amount based off the specified length * Improve fn write docs * Renamed state to phantom * Fix typo
-
Bastian Köcher authored
* Happy new year Updates the copyright years and fixes wrong license headers. * Fix the template * Split HEADER into HEADER-APACHE & HEADER-GPL
-
- Dec 30, 2020
-
-
Alexander Theißen authored
* Add SS58Prefix type to the frame_system config trait * Remove unused chain_id runtime interface
-
- Dec 29, 2020
-
-
Jaco Greeff authored
* Hex Balance deserialize for contracts_call RPC * Avoid temporary conversion into u128 Co-authored-by: Alexander Theißen <[email protected]>
-
Alexander Theißen authored
* Make host functions return TrapReason This avoids the need to manually store any trap reasons to the `Runtime` from the host function. This adds the following benefits: * It properly composes with the upcoming chain extensions * Missing to set a trap value is now a compile error * review: Remove superflous .into()
-
- Dec 21, 2020
-
-
Bastian Köcher authored
* Make it possible to calculate the storage as often as you want So, until now each Substrate based blockchain has calculated the storage root once, at the end of the block. Now there is Frontier that wants to calculate some intermediate storage root. However this failed on block import. The problem with that was the extrinsics root. When building the block we stored `Default::default()` as extrinsics root, because yeah, we don't know the extrinsics root before finishing the block. At the end this extrinsics root was then calculated. But on block import we passed the already known extrinsics root. This was no problem, as we removed this value at the end of the block. However when you all the storage root in between, that changes the storage root between block building and block import. This pr changes this behavior. It removes the `ExtrinsicsRoot` storage entry and also doesn't pass it anymore to `System::initialize`. By doing it, we remove the difference in the storage and fix the storage root mismatch. * Fix bug with incorrectly calculating the extrinscs root * Review feedback
-
- Dec 19, 2020
-
-
Alexander Theißen authored
This is no longer necessary with storage transactions.
-
- Dec 10, 2020
-
-
thiolliere authored
* fix docs * Update frame/merkle-mountain-range/src/lib.rs Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: Alexander Theißen <[email protected]>
-
- Dec 09, 2020
-
-
Alexander Theißen authored
* Allow Backend::for_keys_in_child_storage to be aborted by the closure * Ext::kill_child_storage now takes an upper limit for backend deletion * Add Storage::storage_kill_limited() runtime interface * review: Use a new version of kill_storage instead of a new interface * review: Simplify boolean expression Co-authored-by: cheme <[email protected]> * review: Rename for_keys_in_child_storage Co-authored-by: cheme <[email protected]>
-
- Dec 08, 2020
-
-
Tomasz Drwięga authored
* Basic weights builder. * Fixing WiP * Make the tests work. * Fix weights in node/runtime. * WiP. * Update pallets with new weights parameters. * Validate returns a Result now. * Count mandatory weight separately. * DRY * BREAKING: Updating state root, because of the left-over weight-tracking stuff * Update tests affected by Mandatory tracking. * Fixing tests. * Fix defaults for simple_max * Update frame/system/src/weights.rs Co-authored-by: Kian Paimani <[email protected]> * Rework the API a bit. * Fix compilation & tests. * Apply suggestions from code review Co-authored-by: Kian Paimani <[email protected]> * Add extra docs & rename few things. * Fix whitespace in ASCII art. * Update frame/system/src/limits.rs Co-authored-by: Kian Paimani <[email protected]> * Fix max_extrinsic calculations. * Fix conflicts. * Fix compilation. * Fix new code. * re-remove generic asset * Fix usage. * Update state root. * Update proxy. * Fix tests. * Move weights validity to integrity_test * Remove redundant BlockWeights. * Add all/non_mandatory comment * Add test. * Remove fn block_weights * Make the macro prettier. * Fix some docs. * Make max_total behave more predictabily. * Add BlockWeights to metadata. * fix balances test * Fix utility test. Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]> Co-authored-by: Benjamin Kampmann <[email protected]> Co-authored-by: thiolliere <[email protected]>
-
- Nov 30, 2020
-
-
Shawn Tabrizi authored
* fix trigger fingers * more * Update frame/example-offchain-worker/README.md Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Guillaume Thiolliere <[email protected]>
-
thiolliere authored
* manual rename * renamse in README.md * fix template
-
thiolliere authored
* rename Trait to Config * add test asserting using Trait is still valid. * fix ui tests
-
- Nov 24, 2020
-
-
Alexander Theißen authored
* pallet-contracts: Fix seal_restore_to to output proper module errors Those errors where part of the decl_error for some time but where never actually returned. This allows proper debugging of failed restorations. Previously, any error did return the misleading `ContractTrapped`. * Bind UncheckedFrom<T::Hash> + AsRef<[u8]> everywhere This allows us to make assumptions about the AccoutId that are necessary for testing and in order to benchmark the module properly. This also groups free standing functions into inherent functions in order to minimize the places where the new bounds need to be specified. * Rework contract address determination * Do not allow override by runtime author * Instantiate gained a new parameter "salt" This change is done now in expecation of the upcoming code rent which needs to change the instantiation dispatchable and host function anyways. The situation in where we have only something that is like CREATE2 makes it impossible for UIs to help the user to create an arbitrary amount of instantiations from the same code. With this change we have the same functionality as ethereum with a CREATE and CREATE2 instantation semantic. * Remove TrieIdGenerator The new trait bounds allows us to remove this workaround from the configuration trait. * Remove default parameters for config trait It should be solely the responsiblity to determine proper values for these parameter. As a matter of fact most runtime weren't using these values anyways. * Fix tests for new account id type Because of the new bounds on the trait tests can't get away by using u64 as accound id. Replacing the 8 byte value by a 32 byte value creates out quite a bit of code churn. * Fix benchmarks The benchmarks need adaption to the new instantiate semantics. * Fix compile errors caused by adding new trait bounds * Fix compile errors caused by renaming storage and rent functions * Adapt host functions and dispatchables to the new salt * Add tests for instantiate host functions (was not possible before) * Add benchmark results * Adapt to the new WeightInfo The new benchmarks add a new parameter for salt "s" to the instantiate weights that needs to be applied. * Fix deploying_wasm_contract_should_work integration test This test is adapted to use the new instantiate signature. * Break overlong line * Break more long lines Co-authored-by: Parity Benchmarking Bot <[email protected]>
-
- Nov 20, 2020
-
-
Kian Paimani authored
* Thread-local parameter_types for testing. * Better docs. * Some minors * Merge'em * Update frame/support/src/lib.rs Co-authored-by: Bastian Köcher <[email protected]> * Align more to basti's trick * Update frame/support/src/lib.rs * Update frame/support/src/lib.rs Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
- Nov 12, 2020
-
-
Alexander Theißen authored
-
- Nov 09, 2020
-
-
Alexander Theißen authored
* pallet_contracts: Inline benchmark helper that is only used once * Move all max_* Schedule items into a new struct * Limit the number of globals a module can declare * The current limits are too high for wasmi to even execute * Limit the amount of parameters any wasm function is allowed to have * Limit the size the BrTable's immediate value * Add instruction benchmarks * Add new benchmarks to the schedule and make use of it * Add Benchmark Results generated by the bench bot * Add proc macro that implements `Debug` for `Schedule` * Add missing imports necessary for no_std build * Make the WeightDebug macro available for no_std In this case a dummy implementation is derived in order to not blow up the code size akin to the RuntimeDebug macro. * Rework instr_memory_grow benchmark to use only the maximum amount of pages allowed * Add maximum amount of memory when benching (seal_)call/instantiate * 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 --heap-pages=4096 --output ./bin/node/runtime/src/weights --header ./HEADER --pallet pallet_contracts * Added utility benchmark that allows pretty printing of the real schedule * review: Add missing header to the proc-macro lib.rs * review: Clarify why #[allow(dead_code)] attribute is there * review: Fix pwasm-utils line * review: Fixup rand usage * review: Fix typo * review: Imported -> Exported * cargo run --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 * contracts: Adapt to new weight structure * contracts: Fixup runtime WeightInfo * contracts: Remove unneeded fullpath of WeightInfo type * Apply suggestions from code review Co-authored-by: Andrew Jones <[email protected]> * Fix typo in schedule.rs Co-authored-by: Andrew Jones <[email protected]> * Fix docs in schedule.rs * Apply suggestions from code review Co-authored-by: Nikolay Volf <[email protected]> * Don't publish proc-macro crate until 3.0.0 is ready * Optimize imports for less repetition * Break overlong line Co-authored-by: Parity Benchmarking Bot <[email protected]> Co-authored-by: Andrew Jones <[email protected]> Co-authored-by: Nikolay Volf <[email protected]>
-
- Nov 05, 2020
-
-
Alexander Theißen authored
-
- Nov 04, 2020
-
-
Web3 Philosopher authored
* parent affbc38a author Seun Lanlege <[email protected]> 1599568164 +0100 committer Seun Lanlege <[email protected]> 1604321289 +0100 gpgsig -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEECvQ02MnjnssnSbjr3HzzEhjN254FAl+gAAkACgkQ3HzzEhjN 254soAv+KO5JA0HXSe0R0XS5TnwA3IxYsW+UvdF5dXFeC3jFdGTMvor818uoBePD dxzYEsUK6gjsNcM9+hpFhoy5JnUrUPInd2BZ7pmZiDuXmYJrHi0s7K5qL0EYDoe0 m1egPNNyRR125ozJ24M+09c3OQsi3bvTx1TJaV9Aov8hK4So8UmlJTHWpkLw97ku HuTre2IPSFbV4GwJE40V+KNuDVHxaKL7zrInYScqbr6/hOTqBCvFn4ib3CjpF5HG zDAA5S2PrcbL9NQOothVcVB/TZr3IkhglCFqEjVyCX80IL0JkNZkw8jAh0B8uqXx Ug/c1/Mssa8F1jLZMmW45Cway60txqVbcWntPJAymGJbrRErOO/++oUrV0u1C65u LW7gXAaIJWQTX9KnX0SEyejNod7ubZktBz7n5WfkJAPIzdw5wtJalhLa673YTgQ9 zyTPKiWjJj2myCq1AYrJvlK8hSsIBqbBFcUf1zX4SzZWKS+5mtp51o4gfVzcCRPd z/6/iPbB =g5tx -----END PGP SIGNATURE----- BabeConsensusDataProvider works with existing chains Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
-
- Oct 30, 2020
-
-
Alexander Theißen authored
* Implement serde::Deserialize for DispatchError if std This is needed to use this type in the contracts RPC. * contracts: Change contract_call RPC to return more information
-
- Oct 29, 2020
-
-
Alexander Theißen authored
* contracts: Make use of existing type aliases for runtime API types * contracts: Refactor the contracts call runtime API * review: Fix comment typo Co-authored-by: Andrew Jones <[email protected]> * Update frame/contracts/common/src/lib.rs Co-authored-by: Nikolay Volf <[email protected]> * Update frame/contracts/common/src/lib.rs Co-authored-by: Nikolay Volf <[email protected]> * Update frame/contracts/common/src/lib.rs Co-authored-by: Nikolay Volf <[email protected]> * Update frame/contracts/common/src/lib.rs Co-authored-by: Nikolay Volf <[email protected]> * Update frame/contracts/common/src/lib.rs Co-authored-by: Nikolay Volf <[email protected]> * Update lib.rs * review: Group crate imports Co-authored-by: Andrew Jones <[email protected]> Co-authored-by: Addie Wagenknecht <[email protected]> Co-authored-by: Nikolay Volf <[email protected]>
-
Qinxuan Chen authored
Signed-off-by: koushiro <[email protected]>
-