-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Implements try_state hook in elections and EPM pallets
#13718
Conversation
try_state hook in elections pallettry_state hook in elections and EPM pallets
try_state hook in elections and EPM palletstry_state hook in elections and EPM pallets
| // [`Snapshot`] state check. Invariants: | ||
| // - [`DesiredTargets`] exist IFF [`Snapshot`] is present. | ||
| // - [`SnapshotMetadata`] exist IFF [`Snapshot`] is present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be more thorough to check this: if Snapshot or DesiredTargets or SnapshotMetadata exist, then they must all exist?
Otherwise this check would pass if we're in a weird state like only DesiredTargets is set but Snapshot and SnapshotMetadata are not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one more check to ensure DesiredTargets and SnapshotMetadata are not set if Snapshot is not set.
|
|
||
| // [`SignedSubmissionsMap`] state check. Invariants: | ||
| // - All [`SignedSubmissionIndices`] are present in [`SignedSubmissionsMap`], and no more; | ||
| // - [`SignedSubmissionNextIndex`] is not present in [`SignedSubmissionsMap`]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can be more specific with this invariant. Should SignedSubmissionNextIndex be equal to the size of SignedSubmissionsMap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
SignedSubmissionNextIndexbe equal to the size ofSignedSubmissionsMap?
Not necessarily, that is the reason why we keep the index in storage (also to avoid iterating over the map).
Co-authored-by: Liam Aharon <[email protected]>
Co-authored-by: Liam Aharon <[email protected]>
* chore(sc-cli): improve runner and signals * Update client/cli/src/runner.rs * fmt --------- Co-authored-by: Bastian Köcher <[email protected]>
* Fix the Referenda confirming alarm * Add minimal regression test This fails on bf395c8 since the downwards rounding voids the curve delay. Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]>
* reward pool migration fix * comment * remove generic * rm max * foramtting * Add note to V4 migration Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add more asserts to the V5 migration Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Make compile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update frame/nomination-pools/src/migration.rs Co-authored-by: Gonçalo Pestana <[email protected]> * Make V4 migration re-usable Otherwise it wont chain together with the V5. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add MigrateV3ToV5 wrapper Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Gonçalo Pestana <[email protected]>
* Change node-template license from Unlicense to MIT-0 * Change frame examples license from Unlicense to MIT-0 * Update bin/node-template/LICENSE --------- Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: parity-processbot <>
* updating labels descriptions * delete milestones * Update docs/CONTRIBUTING.adoc Co-authored-by: Bastian Köcher <[email protected]> * link to label docs * Update docs/CONTRIBUTING.adoc Co-authored-by: Oliver Tale-Yazdi <[email protected]> --------- Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: parity-processbot <> Co-authored-by: Oliver Tale-Yazdi <[email protected]>
…orker (#13730) * Remove `HeaderBackend` requirement from `NetworkWorker` * Remove HeaderBackend from authority-discovery
Co-authored-by: parity-processbot <>
* refactor: inconsistent BalanceConversion fn * Revert "refactor: inconsistent BalanceConversion fn" This reverts commit 1177877. * refactor: rename BalanceConversion trait * feat: add ConversionFromAssetBalance
This removes the deprecated batch verification. This was actually never really activated. Nevertheless, we need to keep the host functions around to support old runtimes which may import these host functions. However, we do not give access to these functions anymore. This means that any new runtime can not call them anymore. The host function implementations we keep will not do batch verification and will instead fall back to the always existing option of directly verifying the passed signature. `finish_batch_verification` will return the combined result of all the batch verify calls. This removes the `TaskExecutorExt` which only existed to support the batch verification. So, any code that used this extension can just remove the registration of them. It also removes `SignatureBatching` that was used by `frame-executive` to control the batch verification. However, there wasn't any `Verify` implementation that called the batch verification functions.
* Use proc-macro-warning crate Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fixup Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix pallet_ui tests Also renamed some of the odd-named ones. Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update dep Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Ignore hardcoded weight warning To be fixed in https://github.com/paritytech/substrate/issues/13813 Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix test pallet Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix more tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: parity-processbot <>
…es to collections and items in the Uniques pallet in order to follow the commonly accepted NFTs terminology.) (#13322) * Update documentation for uniques The documentation was outdated after merge of #11389 Using the widely spread term collections and item instead of the previous class and instance. * Update README.md --------- Co-authored-by: Jegor Sidorenko <[email protected]> Co-authored-by: Jegor Sidorenko <[email protected]>
* Implement #[pallet::hold_reason] * Appease clippy * cargo fmt * Update test expectations * Update test expectations * Support composite_enum attribute instead * Update test expectations * Change hold_reason to composite_enum * Add UI test for unsupported identifier when using composite_enum * Fix comment * Add documentation for pallet::composable_enum * More docs * cargo fmt
* Expose WASM extensions in executor semantics * Fix benches * Remove redundant extensions
* Remove deprecated pallet calls Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Deprecate old weight Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update Runtime API Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Delete shitty code Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix doctest Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update frame/alliance/src/lib.rs Co-authored-by: Koute <[email protected]> * Add doc Signed-off-by: Oliver Tale-Yazdi <[email protected]> * contracts: Use u64 as old weight type Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Update frame/contracts/src/lib.rs Co-authored-by: Alexander Theißen <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Koute <[email protected]> Co-authored-by: Alexander Theißen <[email protected]> Co-authored-by: parity-processbot <>
…13820) Instead of registering `ReadRuntimeVersionExt` in `sp-state-machine` it is moved to `ExecutionExtension` which provides the default extensions.
* Adds on_idle round-robin logic to trait Hooks docs * Makes the docs more concise * Update frame/support/src/traits/hooks.rs Co-authored-by: Bastian Köcher <[email protected]> * fmt --------- Co-authored-by: Bastian Köcher <[email protected]>
* TrieRecorder: Start adding support for transactions * Adds `transactions` functions and some test * More tests * Docs * Ensure that we rollback failed transactions in the storage proof * FMT * Update primitives/trie/src/recorder.rs Co-authored-by: Dmitry Markin <[email protected]> * Review comments * Update primitives/trie/src/recorder.rs Co-authored-by: Sebastian Kunert <[email protected]> * ".git/.scripts/commands/fmt/fmt.sh" * For the holy clippy! * Update primitives/trie/src/recorder.rs Co-authored-by: Anton <[email protected]> --------- Co-authored-by: Dmitry Markin <[email protected]> Co-authored-by: Sebastian Kunert <[email protected]> Co-authored-by: command-bot <> Co-authored-by: Anton <[email protected]>
* Add HoldReason to the NIS pallet * Rename composable_enum to composite_enum * Add encoding test * Add more doc comments
…test utils (#13794) * new test for try-runtime tuple stuff * fix * remove development comment * formatting * remove todo comment * follow-chain working test * refactor common cli testing utils * fix comment * revert Cargo.lock changes * update Cargo.lock * improve doc comment * fix error typo * update Cargo.lock * feature gate try-runtime test * build_substrate cli test util * feature gate follow_chain tests * move fn start_node to test-utils * improve test pkg name * use tokio Child and Command * remove redundant import * fix ci * fix ci * don't leave hanging processes * improved child process cleanup * use existing KillChildOnDrop * remove redundant comment * Update test-utils/cli/src/lib.rs Co-authored-by: Koute <[email protected]> --------- Co-authored-by: kianenigma <[email protected]> Co-authored-by: Koute <[email protected]>
* benchmarking to generate weights file * add the calculated weights in the extrinsics * use benchmarking v2 syntax to generate the weights * minor syntax change when benchmarking * added WeightInfo in the mock to pass tests * minor cargo fmt format changes
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
bot rebase |
|
Branch is already up-to-date |
|
Closing in lieu of #13979 |
This PR implements the
try_statehook in elections and EPM pallets and uses it in the tests. An improvement to this PR would be to work on paritytech/polkadot-sdk#210 to automatically include calling thetry_statehook in all tests.Related to paritytech/polkadot-sdk#239