* Introduce efficient Hash-based RNG streamer
* Initial draft of the society module
* Introduce a test
* Dual-pot logic
* Vouching
* Use chacha
* Half way through moving to cliff payout.
* Fixes
* Add some tests
* Remove printlns
* Merge remote-tracking branch 'origin/gav-verified-id' into gav-verified-id
# Conflicts:
# frame/identity/src/lib.rs
* Merge remote-tracking branch 'origin/gav-verified-id' into gav-verified-id
# Conflicts:
# frame/identity/src/lib.rs
* Fix `slash_payout`, add test
* Test for multi-slash_payout
* Add docs to `put_bid` function and `bidding_works` test
* Add strikes to test
* Add comments to `rotate_period`
* Implement `suspend_member`
* Off chain iteration of suspended members using linked_map
* Half of suspended candidate
* Finish suspend_candidate, need tests
* Resolve mistakes and feedback, add `suspended_candidate_rejected` test
* Remove logic which increases payout time after un-suspension
* Fix error in `slash_suspended_candidates`, add member check to `vote`
* Fix vouch rewards, dont create zero payouts, add tests for vouch
* Test unvouch
* Unbid tests
* Add lifecycle events, fix `add_member` to update `MembershipChanged`
* Head cannot be removed from society
* Use `add_member` in `found` to ensure `MembershipChanged` is triggered
* Use `Judgement` enum for suspended candidate judgement
* Make society instantiable
* Implement challenges
* Remove extra text in test
* Remove `BlockNumber` return from `slash_payout`
* Add bad vote causes slash test
* Update frame/society/src/lib.rs
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>
* Add consts to module metadata
* Check `suspended_member` cant bid
* Increase strength of payout check, **must** be a member.
* Start pallet documentation
* Finish docs
* Update library names, use decl_error
* Prevent double bids, add test
* Use `map` for vouching member, and introduce banned vouchers
* Remove leftover docs
* Vouching handles removed member lifecycles w/ tests
* `take` the votes when tallying, add comprehensive checks before vouch or bid
* Check votes are cleaned up
* Check vote is for a valid candidate, add vote event
* Defender vote event
* Fix `judge_suspended_candidate`, add weight docs
* First pass fixes (blank lines, formatting, no operational)
* Bump copyright year
* Make `add_member` infallible
* More feedback updates
* Add storage access complexity
* Fix logic for AutoUnbid
* Complete weight documentation
* Optimize logic which used to result in double storage read.
* Use Bid struct rather than tuple
* Introduce `MaxMembers` configuration constant
* Add comment about fringe scenario where `MaxMembers` could go over, NBD
* Change MaxMembership to configurable storage item with ability for root to update
* Make membership challenges skew toward failure.
If no one at all votes, or the vote is tied, the user will be suspended from society. This means, that the user simply needs to vote for themselves to stay in society assuming no one else participates.
* Refactor `is_candidate`as to avoid possible double storage reads in the future.
* Blank lines
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
* Initial run and gun at `OnReapAccount`
* Fix some imports
* More fixes
* Whitespace
* More wack-a-mole
* Gotta catch em all
* Update lib.rs
* Small doc update
* Whitespace
* Make `decl_error!` errors usable
This pr implements support for returning errors of different pallets in
a pallet. These errors need to be declared with `decl_error!`.
The pr changes the following:
- Each dispatchable function now returns a `DispatchResult` which is an
alias for `Result<(), DispatchError>`.
- `DispatchError` is an enum that has 4 variants:
- `Other`: For storing string error messages
- `CannotLookup`: Variant that is returned when something returns a
`sp_runtime::LookupError`
- `BadOrigin`: Variant that is returned for any kind of bad origin
- `Module`: The error of a specific module. Contains the `index`,
`error` and the `message`. The index is the index of the module in
`construct_runtime!`. `error` is the index of the error in the error
enum declared by `decl_error!`. `message` is the message to the error
variant (this will not be encoded).
- `construct_runtime!` now creates a new struct `ModuleToIndex`. This
struct implements the trait `ModuleToIndex`.
- `frame_system::Trait` has a new associated type: `ModuleToIndex` that
expects the `ModuleToIndex` generated by `construct_runtime!`.
- All error strings returned in any module are being converted now to `DispatchError`.
- `BadOrigin` is the default error returned by any type that implements `EnsureOrigin`.
* Fix frame system benchmarks
* clean up cargo.toml syntax
* bumping versions to 2.0
* bump networking to 0.8
* move consensus down to 0.8
* bump consensus pallets to 0.8.0, too
* Upping babe and aura pallets
* add remaining, missing version definitions
* missed some
* In progress, runtime io must switch to future proof root +
child_specific (unique id) + u32 type.
* Switch interface, sr-io seems ok, rpc could use similar interface to
sr-io, genesis json broken if there is child trie in existing encoding
genesis.
* test from previous implementation.
* fix proving test.
* Restore Keyspacedb from other branch, only apply to child trie.
* Removing unneeded child_info from child root (child info are stored
if things changed, otherwhise the root does not change).
* Switch rpc to use same format as ext: more future proof.
* use root from child info for trie backend essence.
* Breaking long lines.
* Update doc and clean pr a bit.
* fix error type
* Restore removed doc on merge and update sr-io doc.
* Switch child storage api to use directly unique id, if managed id
where to be put in place, the api will change at this time.
* Clean deprecated host interface from child.
* Removing assertion on child info (can fail depending on root
memoization).
* merging child info in the overlay when possible.
* child iteration by prefix using child_info.
* Using ChainInfo in frame support. ChainInfo gets redesign to avoid
buffers allocation on every calls.
* Add length of root to the data of child info.
* comments
* Encode compact.
* Remove child info with root.
* Fix try_update condition.
* Comment Ext child root caching.
* Replace tuples by struct with field
* remove StorageTuple alias.
* Fix doc tests, and remove StorageOverlay and ChildStorageOverlay
aliases.
* Expose some of session's storage as public, as well as set_keys
Seemingly there's no reason not to do this, as anyone can always do
it the "hard way" by constructing storage keys or extrinsics.
* Use trait to expose `is_registered` function
* Missed removing a pub keyword
* Move trait to support, add docstrings
* Add `swap` and `decode_len` to `DoubleMap`
* Add tests to `swap` and `decode_len` for `DoubleMap` (WIP)
* Address review comments
* Remove function that is not in scope
* fix test
* better naming
* Adding script for rename, could be applicable for nodes on top of it, too
* add stderr and gitlab ci features
* apply script
* fix now minor details in expected stderr
* Update the Cargo.lock
* fix name: sc-transaction -> sc-tracing
* fix rename in script, too
* implement feature to record arbitrary values with span creation
* align dependency versions
* Fix formatting, refactor
* Change `Level` in decl_module from `INFO` to `DEBUG`, because we may
want to use `INFO` in spans added manually in individual pallets, in future.
* Debug for Time::Moment
Without this we cannot have a Moment parameter in dispatchable functions
* Update frame/support/src/traits.rs
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* Update traits.rs
* Implement all storage after prefix
* fix test, bump version and fix doc
* bump metadata version
* Update frame/support/procedural/src/storage/storage_struct.rs
* Move transaction pool to primitives
* move backend, errors into primitives
* remove unused client depencies
* Move rpc-api into primitives
* Move peerset back to client
* Move rpc/api back to client, move palette/support/rpc into utils
* move support-rpc into subfolder
* move system-rpc into utils
* move transaction-pool and -graph back into client
* fix broken imports
* Clean up test primitives
* Make support test utils independent of frame
* remove unnecessary node dependencies from service
* Reactivate dependency script:
- only enforce the now achieved status quo will remain
- allow for primitives to depend on /client for now without failing
- more discriptive error message so people understand, what it wants
- minor fix to differentiative between ../client and /client (which may be a subfolder)
- don't allow this to fail anylonger.
* fix doc comment
* 'Should not' rather than 'must not'.
* Revert unwanted dependency changes
* fix faulty import
* fixup derive_more version
* fix wrong import path