# Gov2 Code Notes get callWeightWitness for initial call, how do you get this, look at whitelist::dispatch_whitelisted_call code * no error if propose and execute whitelist::whitelist_call from wrong origin but also no correct execution (silent error from the UI) ### Referenda Notes Outcomes of `service_referendum`: - If it's ready to be decided, start deciding - If it's not ready to be decided and non-deciding timeout has passed, fail - If it's ongoing and passing, ensure confirming; if at end of confirmation period, pass - If it's ongoing and not passing, stop confirming; if it has reached end time, fail It has to be passing && place_decision_deposit called in order to start confirming. It has to be confirming && passing for a minimum amount of time to pass and execute. As soon as confirmation period ends, it executes. #### place_decision_deposit is only signed any account extrinsic which calls `service_referendum` explain that if not passing, then just keeps it in the queue if passing, then what #### internal functions nudge_referenda, one_fewer_deciding call `service_referendum` which pushes the referenda along along Scheduler pallet calls it when the scheduled calls are executed in on_initialize automatically. `Call::nudge_referenda` is scheduled to be called `now.saturating_add(T::UndecidingTimeOut = 28 * DAYS)`. So I have to assume calls`one_fewer_deciding` is the fast path. ### Approval, Support definitions for Ongoing Referenda Tally type in pallet-conviction-voting stores info regarding an ongoing referenda: ```rust= /// Info regarding an ongoing referendum. pub struct Tally<Votes, Total> { /// The number of aye votes, expressed in terms of post-conviction lock-vote. pub ayes: Votes, /// The number of nay votes, expressed in terms of post-conviction lock-vote. pub nays: Votes, /// The basic number of aye votes, expressed pre-conviction. pub support: Votes, /// Dummy. dummy: PhantomData<Total>, } ``` > "The two passing criteria relate to approval and support...Approval is defined as the share of approval vote-weight (i.e. after adjustment for conviction) against the total number of vote-weight (for both approval and rejection). Support is the total number of votes in approval (i.e. ignoring any adjustment for conviction) compared to the total possible amount of votes that could be made in the system." https://medium.com/polkadot-network/gov2-polkadots-next-generation-of-decentralised-governance-4d9ef657d11b ## Fastrack Functionality From Shawn > Yes, there is something like FastTrack with the Whitelist pallet + a custom governance track. Basically, the normal governance track to execute a sudo function may be 28 days or something but with the whitelist origin having whitelisted some proposal, we can reduce the sudo call time to execute down to some smaller period https://github.com/paritytech/substrate/pull/10159 # Fasttrack Demo Steps 1. WhitelistOrigin = EitherOf<Root, Technical Committee 2 of 3> must dispatch `Whitelist::whitelist_call(call_hash: T::Hash)` 2. `Referenda::submit` proposal for dispatch by WhitelistedCaller of `proposal_hash: ` ```rust, ignore // pub fn submit( // origin: OriginFor<T>, // proposal_origin: Box<PalletsOriginOf<T>>, // proposal_hash: T::Hash, // enactment_moment: DispatchTime<T::BlockNumber>, // ) -> DispatchResult { assert_ok!(Referenda::submit( origin_of(AccountId::from(ALICE)), Box::new(gov_origins::WhitelistedCaller.into()), dispatch_whitelisted_set_balance_proposal_hash(1), DispatchTime::At(0), )); // The proposal hash is for the following call: // pub fn dispatch_whitelisted_call( // origin: OriginFor<T>, // call_hash: T::Hash, // call_weight_witness: Weight, // ) -> DispatchResultWithPostInfo { ``` 3. make proposal passing (via conviction voting pallet voting by technical council) 4. place_decision_deposit which will push it along if passing (TODO: see how interchangeable with (3)) # Slow Path Demo Steps 1. `Referenda::submit` proposal for dispatch by whatever origin ```rust, ignore assert_ok!(Referenda::submit( origin_of(AccountId::from(ALICE)), Box::new(gov_origins::WhitelistedCaller.into()), dispatch_whitelisted_set_balance_proposal_hash(1), DispatchTime::At(0), )); ``` 2. make proposal passing (via conviction voting pallet?) 3. place_decision_deposit which will push it along if passing (TODO: see how interchangeable with (3))