-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Do not allow any crowdloan contributions during the VRF period #3346
Conversation
LGTM - the changes are a nice QoL improvement |
@@ -855,6 +863,12 @@ mod tests { | |||
fn bids() -> Vec<BidPlaced> { | |||
BIDS_PLACED.with(|p| p.borrow().clone()) | |||
} | |||
fn vrf_delay() -> u64 { |
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.
unfortunately no one ever uses them 😁 but I added some pretty convenient ways to create all of these thread local stuff with parameter_types!
with getter and setters https://crates.parity.io/frame_support/macro.parameter_types.html
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.
Actually i do normally use it, but copy paste from local code is faster than looking up the syntax lol
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.
Looks good to me!
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
bot merge |
Trying merge. |
* patch `is_ending` logic for sampling * Create AuctionStatus abstraction * clean up apis * fix docs * Add check for contributions during vrf * custom error for this * fix benchmark * opening -> starting * Apply suggestions from code review Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update runtime/common/src/auctions.rs * avoid divide by zero stuff Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
* master: (21 commits) cleanup stream polls (#3397) Staking Miner (#3141) Companion for Substrate#8953 (#3140) Bump version, specs & substrate in prep for v0.9.8 (#3387) Fix busy loops. (#3392) Minor refactor (#3386) add simnet tests (#3381) BEEFY: adjust gossip (#3372) Companion for #9193 (#3376) Companion for Decouple Staking and Election - Part 3: Signed Phase (#2793) Ensure that we fetch another collation if the first collation was invalid (#3362) Only send one collation per relay parent at a time to validators (#3360) disable approval-checking-grandpa on dev chain (#3364) Use associated constant for max (#3375) Use wasm-builder from git (#3354) Squashed 'bridges/' changes from b2099c5..23dda62 (#3369) Bump versions & spec_versions (#3368) Don't allow bids for a ParaId where there is an overlapping lease period (#3361) Companion for upgrade of transaction-payment to pallet macro (#3267) Do not allow any crowdloan contributions during the VRF period (#3346) ...
After the ending period of an auction, there is a delay needed to select the random block used to win the auction.
During this time, a crowdloan could receive contributions which would not help win the auction whatsoever.
Because we cannot identify which crowdloans would win a current auction, we must stop all crowdloans from accepting contributions during this VRF delay period.
This PR refactors the way that the Auction pallet and the
Auctioneer
trait reports the status of an auction, making it easy to detect these scenarios, and improving the overall code structure and readability.This PR also repairs a small bug where the
EndingsCount
was being incremented multiple times per auction. No harm done here, but this is a proper fix for that behavior.