Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
62dc0d7
New Society
gavofyork Apr 30, 2022
135009c
More logic drafting
gavofyork Apr 30, 2022
01c6834
More work
gavofyork May 3, 2022
a6577e0
Building
gavofyork May 3, 2022
feb7d6b
Some tests
gavofyork May 3, 2022
f7ce7e3
Fixes
gavofyork May 4, 2022
841c732
Improvements to the voting process
gavofyork May 4, 2022
8b997cd
More tests
gavofyork May 4, 2022
3f9fdbd
Test number 20
gavofyork May 4, 2022
98f4060
Tests
gavofyork May 4, 2022
3f6ba74
30 tests
gavofyork May 4, 2022
89c4bf6
Another test]
gavofyork May 5, 2022
db636be
All tests enabled
gavofyork May 5, 2022
d6abcb9
Minor stuff
gavofyork May 5, 2022
f8360a8
generate_storage_alias: Rewrite as proc macro attribute
bkchr May 10, 2022
43cf8c1
Maintenance operations don't pay fee
gavofyork May 10, 2022
0fbf6b5
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork May 10, 2022
287269d
Merge remote-tracking branch 'origin/bkchr-storage-alias-proc-macro' …
gavofyork May 10, 2022
b12cbb2
Fix compilation and FMT
bkchr May 10, 2022
249b664
Moare fixes
bkchr May 10, 2022
0763482
Merge remote-tracking branch 'origin/bkchr-storage-alias-proc-macro' …
gavofyork May 10, 2022
676595c
Migrations
gavofyork May 11, 2022
0fe52d8
Fix tests and add migration testing
gavofyork May 11, 2022
27abee7
Introduce lazy-cleanup and avoid unbounded prefix removal
gavofyork May 11, 2022
adccb66
Fixes
gavofyork May 18, 2022
06700bd
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork May 31, 2022
aefd6db
Fixes
gavofyork Jun 1, 2022
1bbc803
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork Jun 1, 2022
be940c1
[WIP][Society] Adding benchmarking to the v2. (#11776)
arturgontijo Dec 3, 2022
0f4f927
Merge branch 'master' into gav-society-v2
gavofyork Dec 3, 2022
3f20f36
Fix Cargo
gavofyork Dec 5, 2022
db9990f
Fixes
gavofyork Dec 7, 2022
6218e32
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork Dec 7, 2022
d9dce35
Fixes
gavofyork Dec 7, 2022
4c60eef
Spelling
gavofyork Dec 8, 2022
fc1d682
Merge branch 'master' into gav-society-v2
gavofyork Jan 21, 2023
e1214b3
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork Jun 11, 2023
3f119f1
Fix benchmarks
gavofyork Jun 12, 2023
59d1545
Merge remote-tracking branch 'origin/master' into gav-society-v2
gavofyork Jun 12, 2023
2440062
Another fix
gavofyork Jun 12, 2023
7811ac1
Remove println
gavofyork Jun 12, 2023
687d914
Society migration
gavofyork Jun 12, 2023
4841585
Merge remote-tracking branch 'origin/master' into gav-society-v2
Jun 13, 2023
1864679
Merge branch 'gav-society-v2' of github.com:paritytech/substrate into…
gavofyork Jun 13, 2023
ab1eafd
Fixes
gavofyork Jun 13, 2023
c01e8bc
Docs
gavofyork Jun 13, 2023
3d3b43c
Docs
gavofyork Jun 13, 2023
3b73c57
Remove accidental addition.
gavofyork Jun 13, 2023
e51eebf
Fixes
gavofyork Jun 13, 2023
43ea1db
Clippy
gavofyork Jun 14, 2023
bfed684
Fixes
gavofyork Jun 14, 2023
ba534a6
Docs
gavofyork Jun 14, 2023
1528a58
Improve try_runtime test
gavofyork Jun 15, 2023
af65cf7
Use pallet storage version
gavofyork Jun 15, 2023
308e646
Fix up society cargo toml file
gavofyork Jun 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into gav-society-v2
  • Loading branch information
gavofyork authored Jan 21, 2023
commit fc1d682e2cb6d99edf1836917e007e0a150bc94d
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions frame/society/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ pub mod pallet {
///
/// Key: B (len of bids), C (len of candidates), M (len of members), X (balance reserve)
/// Total Complexity: O(M + B + C + logM + logB + X)
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::bid())]
pub fn bid(origin: OriginFor<T>, value: BalanceOf<T, I>) -> DispatchResult {
let who = ensure_signed(origin)?;
Expand Down Expand Up @@ -862,6 +863,7 @@ pub mod pallet {
///
/// Key: B (len of bids), X (balance unreserve)
/// Total Complexity: O(B + X)
#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::unbid())]
pub fn unbid(origin: OriginFor<T>) -> DispatchResult {
let who = ensure_signed(origin)?;
Expand Down Expand Up @@ -894,6 +896,7 @@ pub mod pallet {
///
/// Key: B (len of bids), C (len of candidates), M (len of members)
/// Total Complexity: O(M + B + C + logM + logB + X)
#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::vouch())]
pub fn vouch(
origin: OriginFor<T>,
Expand Down Expand Up @@ -943,6 +946,7 @@ pub mod pallet {
///
/// Key: B (len of bids)
/// Total Complexity: O(B)
#[pallet::call_index(3)]
#[pallet::weight(T::WeightInfo::unvouch())]
pub fn unvouch(origin: OriginFor<T>) -> DispatchResult {
let voucher = ensure_signed(origin)?;
Expand Down Expand Up @@ -971,6 +975,7 @@ pub mod pallet {
///
/// Key: C (len of candidates), M (len of members)
/// Total Complexity: O(M + logM + C)
#[pallet::call_index(4)]
#[pallet::weight(T::WeightInfo::vote())]
pub fn vote(
origin: OriginFor<T>,
Expand Down Expand Up @@ -1006,6 +1011,7 @@ pub mod pallet {
/// Key: M (len of members)
/// Total Complexity: O(M + logM)
/// # </weight>
#[pallet::call_index(5)]
#[pallet::weight(T::WeightInfo::defender_vote())]
pub fn defender_vote(origin: OriginFor<T>, approve: bool) -> DispatchResultWithPostInfo {
let voter = ensure_signed(origin)?;
Expand Down Expand Up @@ -1038,6 +1044,7 @@ pub mod pallet {
///
/// Key: M (len of members), P (number of payouts for a particular member)
/// Total Complexity: O(M + logM + P + X)
#[pallet::call_index(6)]
#[pallet::weight(T::WeightInfo::payout())]
pub fn payout(origin: OriginFor<T>) -> DispatchResult {
let who = ensure_signed(origin)?;
Expand All @@ -1061,6 +1068,7 @@ pub mod pallet {

/// Repay the payment previously given to the member with the signed origin, remove any
/// pending payments, and elevate them from rank 0 to rank 1.
#[pallet::call_index(7)]
#[pallet::weight(T::WeightInfo::waive_repay())]
pub fn waive_repay(origin: OriginFor<T>, amount: BalanceOf<T, I>) -> DispatchResult {
Copy link
Contributor

@sam0x17 sam0x17 Jun 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we get complexity notation for this one and later ones as well since we have it on the earlier calls?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or the other way, I find most of these complexity/weight comments pretty useless. Even if they should exist, it should be in the benchmarking code, not in the call documentation (where end users will see it through metadata).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed - they're actually mostly old and incorrect. As can be seen from the weight calls, they're all O(1) now. The only caveat to that is that BoundedVecs in storage items must generally be full to ensure the maximum possible weight is determined. But I don't think that's especially useful to have in the function docs since it's a) fairly obvious; and b) as closely related to the storage item itself as it is the function.

let who = ensure_signed(origin)?;
Expand Down Expand Up @@ -1097,6 +1105,7 @@ pub mod pallet {
/// - `rules` - The rules of this society concerning membership.
///
/// Complexity: O(1)
#[pallet::call_index(8)]
#[pallet::weight(T::WeightInfo::found_society())]
pub fn found_society(
origin: OriginFor<T>,
Expand Down Expand Up @@ -1129,6 +1138,7 @@ pub mod pallet {
/// member.
///
/// Total Complexity: O(1)
#[pallet::call_index(9)]
#[pallet::weight(T::WeightInfo::dissolve())]
pub fn dissolve(origin: OriginFor<T>) -> DispatchResult {
let founder = ensure_signed(origin)?;
Expand Down Expand Up @@ -1176,6 +1186,7 @@ pub mod pallet {
///
/// Key: B (len of bids), M (len of members)
/// Total Complexity: O(M + logM + B)
#[pallet::call_index(10)]
#[pallet::weight(T::WeightInfo::judge_suspended_member())]
pub fn judge_suspended_member(
origin: OriginFor<T>,
Expand Down Expand Up @@ -1219,6 +1230,7 @@ pub mod pallet {
/// - `candidate_deposit`: The deposit required to make a bid for membership of the group.
///
/// Total Complexity: O(1)
#[pallet::call_index(11)]
#[pallet::weight(T::WeightInfo::set_parameters())]
pub fn set_parameters(
origin: OriginFor<T>,
Expand All @@ -1240,6 +1252,7 @@ pub mod pallet {

/// Punish the skeptic with a strike if they did not vote on a candidate. Callable by the
/// candidate.
#[pallet::call_index(12)]
#[pallet::weight(T::WeightInfo::punish_skeptic())]
pub fn punish_skeptic(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let candidate = ensure_signed(origin)?;
Expand All @@ -1254,6 +1267,7 @@ pub mod pallet {

/// Transform an approved candidate into a member. Callable only by the
/// the candidate, and only after the period for voting has ended.
#[pallet::call_index(13)]
#[pallet::weight(T::WeightInfo::claim_membership())]
pub fn claim_membership(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let candidate = ensure_signed(origin)?;
Expand All @@ -1268,6 +1282,7 @@ pub mod pallet {
/// Transform an approved candidate into a member. Callable only by the Signed origin of the
/// Founder, only after the period for voting has ended and only when the candidate is not
/// clearly rejected.
#[pallet::call_index(14)]
#[pallet::weight(T::WeightInfo::bestow_membership())]
pub fn bestow_membership(
origin: OriginFor<T>,
Expand All @@ -1290,6 +1305,7 @@ pub mod pallet {
/// have a clear approval.
///
/// Any bid deposit is lost and voucher is banned.
#[pallet::call_index(15)]
#[pallet::weight(T::WeightInfo::kick_candidate())]
pub fn kick_candidate(
origin: OriginFor<T>,
Expand All @@ -1312,6 +1328,7 @@ pub mod pallet {
/// Remove the candidate's application from the society. Callable only by the candidate.
///
/// Any bid deposit is lost and voucher is banned.
#[pallet::call_index(16)]
#[pallet::weight(T::WeightInfo::resign_candidacy())]
pub fn resign_candidacy(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let candidate = ensure_signed(origin)?;
Expand All @@ -1330,6 +1347,7 @@ pub mod pallet {
/// a candidate with more rejections than approvals.
///
/// The bid deposit is lost and the voucher is banned.
#[pallet::call_index(17)]
#[pallet::weight(T::WeightInfo::drop_candidate())]
pub fn drop_candidate(
origin: OriginFor<T>,
Expand All @@ -1348,6 +1366,7 @@ pub mod pallet {
/// Remove up to `max` stale votes for the given `candidate`.
///
/// May be called by any Signed origin, but only after the candidate's candidacy is ended.
#[pallet::call_index(18)]
#[pallet::weight(T::WeightInfo::cleanup_candidacy())]
pub fn cleanup_candidacy(
origin: OriginFor<T>,
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.