- Mar 18, 2021
-
-
Shaun Wang authored
* Use 'Pallet' struct in construct_runtime. * Fix genesis and metadata macro. * Fix 'Pallet' type alias. * Replace 'Module' with 'Pallet' for all construct_runtime use cases. * Replace more deprecated 'Module' struct. * Bring back AllModules and AllPalletsWithSystem type, but deprecate them. * Replace deprecated 'Module' struct from merge master. * Minor fix. * Fix UI tests. * Revert UI override in derive_no_bound. * Fix more deprecated 'Module' use from master branch. * Fix more deprecated 'Module' use from master branch.
-
- Mar 16, 2021
-
-
Bastian Köcher authored
-
Gavin Wood authored
* Initial abstraction * Alter rest of APIs * Fixes * Some extra getters in Gilt pallet. * Refactor Gilt to avoid u128 conversions * Simplify and improve pow in per_things * Add scalar division to per_things * Renaming from_fraction -> from_float, drop _approximation * Fixes * Fixes * Fixes * Fixes * Make stuff build * Fixes * Fixes * Fixes * Fixes * Update .gitignore Co-authored-by: Kian Paimani <[email protected]> * Update frame/gilt/src/lib.rs Co-authored-by: Kian Paimani <[email protected]> * Update frame/gilt/src/mock.rs Co-authored-by: Kian Paimani <[email protected]> * Fixes * Fixes * Fixes Co-authored-by: Shawn Tabrizi <[email protected]> Co-authored-by: Kian Paimani <[email protected]>
-
- Mar 12, 2021
-
-
Alexander Theißen authored
* contracts: Expose rent parameter to contracts * 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 * Fix typos * Improve comments * Add rent parameter weights * Allow deploying a new schedule with the same version * Add storage migration for new schedule * Only decode the schedule version in storage migration * Remove confusing docs * Replace original_code_len() by aggregate_code_len() Co-authored-by: Parity Benchmarking Bot <[email protected]>
-
- Mar 10, 2021
-
-
asynchronous rob authored
* more clear randomness API for BABE * babe: move randomness utilities to its own file * node: use babe::RandomnessFromOneEpochAgo in random_seed implementation * frame-support: annotate randomness trait with block number * pallet-randomness-collective-flip: fix for new randomness trait * pallet-society: fix randomness usage * pallet-lottery: fix randomness usage * pallet-contracts: fix randomness usage * pallet-babe: fix randomness usage we need to track when the current and previous epoch started so that we know the block number by each existing on-chain was known * node: fix random_seed * node-template: fix random_seed * frame-support: extend docs * babe: add test for epoch starting block number tracking * babe: fix epoch randomness docs * frame: add todos for dealing with randomness api changes Co-authored-by: André Silva <[email protected]>
-
- Mar 05, 2021
-
-
thiolliere authored
* implement * make default pre/post_upgrade * simplify Cargo.toml * revert removal of outdated/private links * link in pallet-mmr
-
- Mar 02, 2021
-
-
Alexander Theißen authored
* contracts: Use unstable sort for topics * Add warning about non-determinism
-
- Mar 01, 2021
-
-
Bastian Köcher authored
* Init `RuntimeLogger` automatically for each runtime api call This pr change the runtime api in such a way to always and automatically enable the `RuntimeLogger`. This enables the user to use `log` or `tracing` from inside the runtime to create log messages. As logging introduces some extra code and especially increases the size of the wasm blob. It is advised to disable all logging completely with `sp-api/disable-logging` when doing the wasm builds for the on-chain wasm runtime. Besides these changes, the pr also brings most of the logging found in frame to the same format "runtime::*". * Update frame/im-online/src/lib.rs Co-authored-by: Guillaume Thiolliere <[email protected]> * Update test-utils/runtime/Cargo.toml * Fix test * Don't use tracing in the runtime, as we don't support it :D * Fixes Co-authored-by: Guillaume Thiolliere <[email protected]>
-
- Feb 26, 2021
-
-
yjh authored
-
- Feb 25, 2021
-
-
Alexander Theißen authored
* contracts: Update README * contracts: Add CHANGELOG.md * contracts: Bump version to v3.0.0 and allow publish * Typos Co-authored-by: Andrew Jones <[email protected]> * Improve wording in the changelog * contracts: Add reserved field to ContractInfoOf for future proofing * also bump frame-benchmarking * update lockfile Co-authored-by: Andrew Jones <[email protected]> Co-authored-by: Benjamin Kampmann <[email protected]>
-
- Feb 22, 2021
-
-
Shawn Tabrizi authored
* Initial piping of returning amount of keys killed * One more test for `None` limit * forgot to update * fix return value * use version 3 * Update to return `KillOutcome` * Update name to KillChildStorageResult
-
Alexander Theißen authored
* contracts: Convert to framev2 * Reduce the API surface of the crate * Remove unused import * Merge import block * Use pallet::metadata to reduce metadata diff * Remove the explicit "Null" from AccountCounter
-
Alexander Theißen authored
* contracts: Consider contract size in weights * Bump spec version * Whitespace fix Co-authored-by: Guillaume Thiolliere <[email protected]> * Correct pre-charged code weight even in the error case * Use the instrumented code size in weight calculation * Charge the cost of re-instrumentation from the gas meter * Fix benchmark * 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 * Better documentation of return types Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: Parity Benchmarking Bot <[email protected]>
-
- Feb 16, 2021
-
-
Peter Goodspeed-Niklaus authored
* Create a macro which automates creation of benchmark test suites. * bump impl_version * allow unused on test_bench_by_name * use proper doctest ignore attribute * Explicitly hand the Module to the test suite Much better practice than depending on it showing up implicitly in the namespace. * explicitly import what we need into `mod tests` * bench_module is `ident` not `tt` Co-authored-by: Guillaume Thiolliere <[email protected]> * allow end users to specify arguments for new_test_ext This turned out to be surprisingly easy. On reflection, it turns out that of course the compiler can't eagerly evaluate the function call, but needs to paste it in everywhere desired. * enable explicitly specifying the path to the benchmarks invocation also enable optional trailing commas * Revert "bump impl_version" This reverts commit 0209e4de33fd43873f8cfc6875815d0fd6151e63. * list failing benchmark tests and the errors which caused the failure * harden benchmark tests against internal panics * suppress warning about ignored profiles unfortunately, setting the profile here doesn't do anything; we'd need to set it in every leaf package anyway. However, as this was just making the default explicit anyway, I think it's safe enough to remove entirely. * impl_benchmark_test_suite for assets * impl_benchmark_test_suite for balances * impl_benchmark_test_suite for bounties * impl_benchmark_test_suite for Collective * impl_benchmark_test_suite for Contracts * impl_benchmark_test_suite for Democracy * don't impl_benchmark_test_suite for Elections-Phragmen * impl_benchmark_test_suite for Identity Note that Identity tests currently fail. They failed in an identical way before this change, so as far as I'm concerned, the status quo is good enough for now. * impl_benchmark_test_suite for ImOnline * impl_benchmark_test_suite for indices For this crate also, the test suite fails identically with and without this change, so we can say that this change is not the cause of the tests' failure to compile. * impl_benchmark_test_suite for lottery * impl_benchmark_test_suite for merkle-mountain-range * impl_benchmark_test_suite for Multisig These tests fail identically with and without the change, so the change seems unlikely to be the origin of the failures. * impl_benchmark_test_suite for offences * impl_benchmark_test_suite for Proxy Fails identically with and without this change. * impl_benchmark_test_suite for scheduler * impl_benchmark_test_suite for session It turns out to be important to be able to exclude items marked `#[extra]` sometimes. Who knew? * impl_benchmark_test_suite for staking * impl_benchmark_test_suite for system * impl_benchmark_test_suite for timestamp * impl_benchmark_test_suite for tips * impl_benchmark_test_suite for treasury * impl_benchmark_test_suite for utility Note that benchmark tests fail identically before and after this change. * impl_benchmark_test_suite for vesting * fix wrong module name in impl_benchmark_test_suite in Offences * address line length nits * enable optional keyword argument: exec_name Took a _lot_ of macro-wrangling to get the functionality that I want, but now you have the option to pass in ```rust impl_benchmark_test_suite!( Elections, crate::tests::ExtBuilder::default().desired_members(13).desired_runners_up(7), crate::tests::Test, exec_name = build_and_execute, ); ``` and have it expand out properly. A selected fragment of the expansion: ```rust fn test_benchmarks() { crate::tests::ExtBuilder::default() .desired_members(13) .desired_runners_up(7) .build_and_execute(|| { ``` * get rid of dead code Co-authored-by: Guillaume Thiolliere <[email protected]>
-
- Feb 10, 2021
-
-
Andrew Jones authored
* Initial migration of balances pallet * Fix some errors * Remove unused imports * Formatting and removing some todos * Delete Subtrait * Add genesis builder impls for tests * Fix GenesisConfig impl * Make set_balance visible to tests, rename RawEvent to Event * Fix tests with Event rename etc. * More test RawEvent renames * Even more RawEvent renames * Rename module to pallet in comments * Add PalletInfo impl to avid storage collision, fixes tests * Apply review suggestion: remove trailing a Co-authored-by: David <[email protected]> * BalancesEvent alias * Remove BalancesEvent alias * Review suggestion: remove redundant comment * Apply review suggestion: make vis super * Fis doc links * Add RawEvent alias * Add missing Instance parameter to deprecated RawEvent alias * Fix RawEvent deprecation warnings Co-authored-by: David <[email protected]>
-
- Feb 05, 2021
-
-
Alexander Theißen authored
* contracts: Remove ConfigCache * 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 * Fixup test Co-authored-by: Parity Benchmarking Bot <[email protected]>
-
- Feb 04, 2021
-
-
Andrew Jones authored
* Migrate bounties tests to use construct_runtime * Migrate contracts tests to use construct_runtime * Migrate democracy tests to use construct_runtime * review: rename TreasuryEvent -> TreasuryError
-
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 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 11, 2021
-
-
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
-
-
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]>
-