-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Global Disputes] Fix issues after first battery station live test #912
[Global Disputes] Fix issues after first battery station live test #912
Conversation
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.
Nice job.
I guess the fact that global-disputes
didn't rely on actually working with a market should have tipped us off sooner. No harm done, though. But I have one question regarding this pallet: I find it difficult to tell at which point a global dispute actually starts. The Winners
map tracks the status of the global-dispute
, which is initialize when the first voting outcome is pushed, correct?
I think it might be easier to expose a function start_global_dispute
which creates an object which then tracks the status of the global dispute (could be the Winners
object) and which performs all the necessary checks that need to be made in order to start the dispute (for example, there exists a market, the market has the correct state, etc.), much like create_pool
(note that create_pool
is not an extrinsic). It's definitely not ideal to combine the creation of a global dispute with push_voting_outcome
. It's a design smell, and you're also doing a lot of unnecessary work (checking the validity of the market everytime someone adds a new outcome).
@@ -221,6 +225,9 @@ mod pallet { | |||
) -> DispatchResultWithPostInfo { | |||
let owner = ensure_signed(origin)?; | |||
|
|||
let market = T::MarketCommons::market(&market_id)?; | |||
ensure!(market.matches_outcome_report(&outcome), Error::<T>::OutcomeMismatch); |
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.
It would make more sense to me to put this into push_vote_outcome
. If you call push_vote_outcome
from some other function and forget to verify that the outcome types match, then we'll have another bug.
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.
add_vote_outcome
is different to push_voting_outcome
. add_vote_outcome
is controlled by a user. So, I would be in favour of blocking a user to put in a combinatoric outcome instead of a scalar outcome.
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.
But add_vote_outcome
is implemented using push_voting_outcome
. That's why I suggested it. You have a clean API, i.e. other pallets can't accidentally push incorrect outcomes, and neither can users.
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.
now decoupled
zeitgeist/zrml/global-disputes/src/lib.rs
Lines 263 to 267 in 6611b25
Self::update_winner(&market_id, &outcome, voting_outcome_fee); | |
let possession = | |
Some(Possession::Paid { owner: owner.clone(), fee: voting_outcome_fee }); | |
let outcome_info = OutcomeInfo { outcome_sum: voting_outcome_fee, possession }; | |
<Outcomes<T>>::insert(market_id, outcome.clone(), outcome_info); |
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.
after this change I suspect time complexity of this extrinsic has changed, and perhaps weight computation is also changed.
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.
Yeah, that's true.
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.
Not sure what was done to resolve this problem.
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.
It's just I said above. add_vote_outcome
did use push_vote_outcome
, but now it's decoupled, so the logic of add_vote_outcome
is now independent from push_vote_outcome
with this
zeitgeist/zrml/global-disputes/src/lib.rs
Lines 263 to 267 in 6611b25
Self::update_winner(&market_id, &outcome, voting_outcome_fee); | |
let possession = | |
Some(Possession::Paid { owner: owner.clone(), fee: voting_outcome_fee }); | |
let outcome_info = OutcomeInfo { outcome_sum: voting_outcome_fee, possession }; | |
<Outcomes<T>>::insert(market_id, outcome.clone(), outcome_info); |
zrml/global-disputes/src/tests.rs
Outdated
GlobalDisputes::push_voting_outcome( | ||
&market_id, | ||
OutcomeReport::Scalar(0), | ||
&ALICE, | ||
10 * BASE, | ||
) | ||
.unwrap(); |
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.
This should fail. I mean... why would it be okay to push an outcome for a non-existent market?
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.
True, it is just like, that we are in full control of the private API calls like push_voting_outcome
and determine_voting_winner
. So it's not really needed, because the market
check is always inside prediction-markets
before the private API calls.
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.
Depends on what you mean by private, I guess. If you think of zrml_global_disputes
as the object, then the object exposes an API to other pallets. These pallets are now able to push different types of outcome tokens to a global dispute, which is a violation of the rules of zrml_global_disputes
. Fans of OOP will tell you that's dangerous. In general, I would agree with that sentiment.
That being said, OOP isn't always perfect. There are reasons why an API would not check the input. Sometimes its too costly, sometimes virtually impossible. It's your call.
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.
By the way, how does |
Good question. I did not think about this scenario. It seems fatal. Maybe good to have this in this PR. When a global dispute is already started and the market is destroyed afterwards, it would block zeitgeist/zrml/prediction-markets/src/lib.rs Line 2687 in 8281fbf
We can fix this by calling |
add_vote_outcome
Sorry, not quite sure what you're asking. Can you provide some context to the whole ownership thing? I just glanced over it. Looks like it might require a storage migration. Generally regarding destroying markets: It's quite possible that there's no more need to destroy markets. Markets with corrupted storage can be fixed via migration/democracy and unwanted markets will be dealt with via blacklisting. But we should wait until the proposal is done and we've had a chance to review the consequences of removing |
We have the users, who add outcomes with the extrinsic. These users pay a voting outcome fee. There can only be one owner for a particular outcome. So, we don't need to handle a list of owners. On the other hand we have outcomes from the disputes, which can have multiple owners. For one disputed outcome, there could be two disputors in the current implementation of prediction-markets.
True, it requires a storage migration. I had no time so far for this. |
&Self::reward_account(&market_id), | ||
&owner, | ||
fee, | ||
ExistenceRequirement::AllowDeath, |
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.
zeitgeist/runtime/common/src/lib.rs
Lines 192 to 202 in 97e4dcc
pallets.push(GlobalDisputesPalletId::get()); | |
if let Some(pallet_id) = frame_support::PalletId::try_from_sub_account::<u128>(ai) { | |
return pallets.contains(&pallet_id.0); | |
} | |
for pallet_id in pallets { | |
let pallet_acc: AccountId = pallet_id.into_account_truncating(); | |
if pallet_acc == *ai { | |
return true; |
@@ -221,6 +225,9 @@ mod pallet { | |||
) -> DispatchResultWithPostInfo { | |||
let owner = ensure_signed(origin)?; | |||
|
|||
let market = T::MarketCommons::market(&market_id)?; | |||
ensure!(market.matches_outcome_report(&outcome), Error::<T>::OutcomeMismatch); |
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.
It's just I said above. add_vote_outcome
did use push_vote_outcome
, but now it's decoupled, so the logic of add_vote_outcome
is now independent from push_vote_outcome
with this
zeitgeist/zrml/global-disputes/src/lib.rs
Lines 263 to 267 in 6611b25
Self::update_winner(&market_id, &outcome, voting_outcome_fee); | |
let possession = | |
Some(Possession::Paid { owner: owner.clone(), fee: voting_outcome_fee }); | |
let outcome_info = OutcomeInfo { outcome_sum: voting_outcome_fee, possession }; | |
<Outcomes<T>>::insert(market_id, outcome.clone(), outcome_info); |
} | ||
// Storage: GlobalDisputes Winners (r:1 w:1) | ||
// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:1) | ||
// Storage: GlobalDisputes Outcomes (r:3 w:2) | ||
fn purge_outcomes(k: u32, _o: u32) -> Weight { |
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.
Why is the parameter _o
ignored here?
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.
Somehow the benchmark doesn't recognise the dynamic vector of owners as significant enough..
zeitgeist/zrml/global-disputes/src/benchmarks.rs
Lines 412 to 419 in b792304
for i in 1..=o { | |
let owner = account("winners_owner", i, 0); | |
owners.push(owner); | |
} | |
let owners = BoundedVec::try_from(owners.clone()).unwrap(); | |
let winner_outcome = OutcomeReport::Scalar(0); | |
let possession = Possession::Shared { owners }; |
Although it is read here.
T: Config, | ||
{ | ||
let mut total_weight = T::DbWeight::get().reads(1); | ||
let gd_version = StorageVersion::get::<GDPallet<T>>(); |
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.
STORAGE_VERSION
was previously undefined, not sure if it returns 0
in that case (probably it does).
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.
https://paritytech.github.io/substrate/master/src/frame_support/traits/metadata.rs.html#219
get_or_default smells like using 0 if not defined
This pull request is now in conflicts. Could you fix it @Chralt98? 🙏 |
* ZIP-0 Part II (#938) * move disputes to simple-disputes * move more to simple-disputes * wip * wip * some mock preparation * wip * fix tests * taplo fmt * update court authorized mdms * add dispute bond to market storage * mdm funds flow * fix clippy * fix pm benchmarks * add migration * simplify migration * correct migration * migration fixes and call filter * correct admin_destroy_market benchmark * improve simple-disputes mock * benchmark reserve_outcome * benchmark reserve_outcome * fix weights file * fix after merge * add migration tests * add migration reserve id test * apply review suggestions * rename reserve_outcome to suggest_outcome * separate resolve_disputed_market into parts * edit exchange API documentation * slash dispute bond * add empty commit * correct admin_destroy_market test * remove gd dependency from simple disputes * Update zrml/simple-disputes/src/mock.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/simple-disputes/src/mock.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/prediction-markets/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * add doc string * add doc strings * Reduce settle_bonds LOC * cargo fmt * Update zrml/prediction-markets/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/prediction-markets/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * apply review suggestion * add correct mdm benchmarking on_dispute * use on_dispute_weight inside api * improve mdm weight technique * add mdm weights to on_resolution * add tests for pm * modify migration logs, fix try-runtime * little benchmark fix * Update zrml/authorized/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/authorized/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * use result with weight struct * improve dispute api weight system * Use accurate dispute weight instead of max * fix clippy * Update zrml/prediction-markets/src/migrations.rs Co-authored-by: Malte Kliemann <[email protected]> * add copyrights --------- Co-authored-by: Harald Heckmann <[email protected]> Co-authored-by: Malte Kliemann <[email protected]> * fix clippy * fix clippy * Update dependencies to v0.9.38 * More dependency updates * Update standalone runtimes * Fix build with feature runtime-benchmark * Update Zeitgeist parachain runtime * Update Battery Station parachain runtime * Deduplicated dependencies * Make tests succeed for parachain runtime * Partially fix Zeitgeist xcm tests * Make all runtime tests succeed * Update standalone client * Update parachain node * Add migrations * Cargo fmt * Satisfy Clippy * Cargo fmt * Taplo format * Update licenses * remove outsider bond from migration * Reduce runtime test dependencies by half * small changes * Add missing runtime-benchmark feature * Use upper case copyright name Strange, locally the copyright script says: "All copyright notices are up to date! 🍉" On GH pipeline: "error: zrml/prediction-markets/src/benchmarks.rs: no copyright notice for Forecasting Technologies LTD found" * Remove test logger * Implement Production Court (#976) * apply review suggestions * rename reserve_outcome to suggest_outcome * separate resolve_disputed_market into parts * add debug asserts * document types * modify sort check * avoid double remove * clarify docs * avoid mut * binary search by account id * Revert "binary search by account id" This reverts commit c04d5ff. * make pool item key unique * use secure random number generator * add tests * add tests * found bug in exit court * correct slashable * fix exit court * correct tests * fix bug, add tests * fix second get_winner bug * modify tests * fix draw active lock bug, add tests * rename total_slashable to consumed_stake * update config parameters, tests * modify params and add tests * add denounce tests * increase code safety * add tests * add tests * edit exchange API documentation * slash dispute bond * add empty commit * correct admin_destroy_market test * revert get_resolution_outcome to on_resolution * remove gd dependency from simple disputes * use appealed outcomes for global dispute * modify appeal bond formula * remove slash percentages * benchmark court * Update zrml/court/src/types.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/types.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/mock_storage.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/tests.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/tests.rs Co-authored-by: Malte Kliemann <[email protected]> * periods to round timing, modify tests * modify doc comments * use onunbalanced * improve RequestInterval documentation * improve consumed_stake documentation * remove court from filter * add treasury to court * correct errors * update comment * update get_pool_item comment * update get_pool_item comment * comment juror pool * improve doc comments * cargo fmt * rename constants * edit court pallet doc * update tests * rename secret to commitment * make commit reveal failsafer * outsource commitment function * update doc comments * merge punish tardy jurors reassign juror stakes * outsource get_n_random_numbers * correct logs * rename default to get * improve extrinsic comments * simplify choose_multiple_weighted * improve naming * remove back_global_dispute * unlock jurors from last draws * improve error description * shorten mock periods * document private functions * add assert to check max appeals * add stake to juror joined event * correct test * improve test * update reassigned event comment * correct test * add assert check * improve tests for draws * add reveal vote invalid salt fails test * denounce slash inside reassign_juror_stakes * improve test readibility * rename periods to cycle_ends * add select jurors test * change randomness source in court tests * fix clippy * imrpove tests * remove cccount lookup in tests * improve test setup * add API tests, add missing unlockings * add full cycle court tests * remove invalid test * add missing WeightInfo * add inflation inside court * improve benchmarking and testing * add integrity_test * Update zrml/simple-disputes/src/mock.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/simple-disputes/src/mock.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/prediction-markets/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * add doc string * add doc strings * Reduce settle_bonds LOC * cargo fmt * Update zrml/prediction-markets/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/prediction-markets/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * apply review suggestion * add GDItem integration * add delegations * improve code structure * fix benchmarks * optimize logic * add correct mdm benchmarking on_dispute * use on_dispute_weight inside api * improve mdm weight technique * add mdm weights to on_resolution * add tests for pm * modify migration logs, fix try-runtime * adjust tests for binary search * improve benchmarking * do small change * little benchmark fix * Update zrml/authorized/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/authorized/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * use result with weight struct * improve code * update benchmark and weights * improve dispute api weight system * test delegations for reassign * correct benchmarks and test * remove comment * add API benchmarks * update weights * use generic vote item instead of outcome report * update to court id and generic court * fix stuff and add documentation * add court readme, use new parameters * improve naming, weighting * Use accurate dispute weight instead of max * take random ranges without replacement * switch get_random_number algo * integrate court and reject simple disputes * update start_global_dispute bench * fix clippy * use efficient draw without replacement algorithm * small edits * round to min juror stake, use other draw algo * use partial fisher yates algorithm * improve naming and comments * update changelog for devs * improve dispute api documentation * correct call filters * add copyright notice * remove is_outcome and is_binary * remove unnecessary "Court" prefix * update copyright notices * remove front end comment * Update zrml/court/README.md Co-authored-by: Malte Kliemann <[email protected]> * npx prettier court readme * improve style of terminology * update readme * remove unnecessary impl block * update comment * remove todo * make reward_pot package private * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * update integrity test * improve join court doc * improve extrinsic documentation * update delegate doc * make some types package private * fix struct comment * update readme * update readme * remove commitment matcher * fix doc string * remove unnecessary error * improve import * improve test case * fix inflation misbehaviour * improve round timing structure * improve error names * fix get_valid_delegated_juror * remove wrong break * update weight for select jurors * allow rejoin after exit preparation * remove unnecessary apis * improve naming and docs * fix clippy * fix copyrights * update changelog for devs * Update runtime/common/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/court/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * comment benchmark components * comment benchmark component * Update zrml/court/README.md Co-authored-by: Harald Heckmann <[email protected]> * add terminology for court * Update zrml/prediction-markets/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * restructure import * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * use mul_floor and reduce indentation * safe guard inflation emission * use imbalance for minting * use saturated div * logging if inflation period mint too high * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * reduce court InflationPeriod for Battery Station * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * fmt * fix tests * fix issue tokens without burn * remove unnecessary error return * allow equal amount to previous stake --------- Co-authored-by: Malte Kliemann <[email protected]> Co-authored-by: Harald Heckmann <[email protected]> * [Global Disputes] Fix issues after first battery station live test (#912) * apply review suggestions * use keep alive * cargo fmt * use function instead of raw * improve documentation * improve 2 outcome check * start gd requires two unqiue outcomes * fix error * add empty commit * correct admin_destroy_market test * revert get_resolution_outcome to on_resolution * remove gd dependency from simple disputes * fix clippy * use appealed outcomes for global dispute * fix tests and benchmarks * modify appeal bond formula * remove slash percentages * test default toolchain * benchmark court * Update zrml/court/src/types.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/types.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/mock_storage.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/tests.rs Co-authored-by: Malte Kliemann <[email protected]> * Update zrml/court/src/tests.rs Co-authored-by: Malte Kliemann <[email protected]> * periods to round timing, modify tests * modify doc comments * use onunbalanced * improve RequestInterval documentation * improve consumed_stake documentation * remove court from filter * add treasury to court * correct errors * update comment * update get_pool_item comment * update get_pool_item comment * comment juror pool * improve doc comments * cargo fmt * rename constants * edit court pallet doc * update tests * rename secret to commitment * make commit reveal failsafer * outsource commitment function * Update scripts/tests/misc.sh * update doc comments * merge punish tardy jurors reassign juror stakes * outsource get_n_random_numbers * correct logs * rename default to get * improve extrinsic comments * simplify choose_multiple_weighted * improve naming * remove back_global_dispute * unlock jurors from last draws * improve error description * shorten mock periods * document private functions * add assert to check max appeals * add stake to juror joined event * correct test * improve test * update reassigned event comment * correct test * add assert check * improve tests for draws * add reveal vote invalid salt fails test * denounce slash inside reassign_juror_stakes * improve test readibility * rename periods to cycle_ends * add select jurors test * change randomness source in court tests * fix clippy * imrpove tests * remove cccount lookup in tests * improve test setup * add API tests, add missing unlockings * add full cycle court tests * remove invalid test * add missing WeightInfo * add inflation inside court * improve benchmarking and testing * add integrity_test * Update zrml/simple-disputes/src/mock.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/simple-disputes/src/mock.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/prediction-markets/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * add doc string * add doc strings * Reduce settle_bonds LOC * cargo fmt * Update zrml/prediction-markets/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/prediction-markets/src/migrations.rs Co-authored-by: Harald Heckmann <[email protected]> * apply review suggestion * add GDItem integration * add delegations * improve code structure * fix benchmarks * optimize logic * add correct mdm benchmarking on_dispute * use on_dispute_weight inside api * improve mdm weight technique * add mdm weights to on_resolution * add tests for pm * modify migration logs, fix try-runtime * adjust tests for binary search * improve benchmarking * do small change * little benchmark fix * Update zrml/authorized/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/authorized/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * use result with weight struct * improve code * update benchmark and weights * improve dispute api weight system * test delegations for reassign * correct benchmarks and test * remove comment * add API benchmarks * update weights * use generic vote item instead of outcome report * update to court id and generic court * fix stuff and add documentation * add court readme, use new parameters * improve naming, weighting * Use accurate dispute weight instead of max * take random ranges without replacement * add start_global_dispute tests * add test * fix typo * switch get_random_number algo * integrate court and reject simple disputes * update start_global_dispute bench * fix clippy * use efficient draw without replacement algorithm * small edits * round to min juror stake, use other draw algo * use partial fisher yates algorithm * improve naming and comments * update changelog for devs * improve dispute api documentation * correct call filters * add copyright notice * remove is_outcome and is_binary * remove unnecessary "Court" prefix * update copyright notices * remove front end comment * Update zrml/court/README.md Co-authored-by: Malte Kliemann <[email protected]> * npx prettier court readme * improve style of terminology * update readme * remove unnecessary impl block * update comment * remove todo * make reward_pot package private * Update zrml/court/src/lib.rs Co-authored-by: Malte Kliemann <[email protected]> * update integrity test * improve join court doc * improve extrinsic documentation * update delegate doc * make some types package private * fix struct comment * update readme * update readme * remove commitment matcher * fix doc string * remove unnecessary error * improve import * improve test case * fix inflation misbehaviour * improve round timing structure * improve error names * fix get_valid_delegated_juror * remove wrong break * update weight for select jurors * allow rejoin after exit preparation * remove unnecessary apis * improve naming and docs * fix clippy * correct migrations * fix copyrights * fmt * fix clippy * fix copyrights * update changelog for devs * Update runtime/common/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/court/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * comment benchmark components * comment benchmark component * Update zrml/court/README.md Co-authored-by: Harald Heckmann <[email protected]> * add terminology for court * Update zrml/prediction-markets/src/benchmarks.rs Co-authored-by: Harald Heckmann <[email protected]> * restructure import * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * use mul_floor and reduce indentation * safe guard inflation emission * use imbalance for minting * use saturated div * logging if inflation period mint too high * fix after merge * update changelog for devs * use imperative * fmt * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * reduce court InflationPeriod for Battery Station * Update zrml/court/src/lib.rs Co-authored-by: Harald Heckmann <[email protected]> * fmt * fix tests * fix issue tokens without burn * remove unnecessary error return * Update Makefile * allow equal amount to previous stake --------- Co-authored-by: Malte Kliemann <[email protected]> Co-authored-by: Harald Heckmann <[email protected]> * activate court and GD on battery station * bump storage version of market commons * Update runtime/zeitgeist/src/lib.rs * Update runtime/zeitgeist/src/lib.rs * Revert "Reduce runtime test dependencies by half" This reverts commit fe589a5. * Update weight templates * Use header option for benchmarks Also format benchmark script and moves header file into HEADER_GPL3. * Update rust-toolchain * Satisfy clippy * Use patched wasm-builder for new rustc * Format * Update licenses --------- Co-authored-by: Harald Heckmann <[email protected]> Co-authored-by: Malte Kliemann <[email protected]>
Fixes #928
possession
which can be eitherShared
orPaid
add_vote_outcome
, which is always paid with aVotingOutcomeFee
and the private API callpush_vote_outcome
, which allows multiple (shared) ownersGlobalDisputesInfo
and put the content ofWinners
inside thisWinners
doesn't suit the point of this storage item anymoreWinners
storage item removed after the runtime upgradepossession
enum fieldadd_vote_outcome
now checks for the outcome type nowNoFundsToReward
error forreward_outcome_owner
, whenadd_vote_outcome
was never called (so no funds available)AddOutcomePeriod
andVotePeriod
to allow the addition of vote outcomes only before the voting starts