This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New slots/auctions architecture #2294
Merged
Merged
Changes from 1 commit
Commits
Show all changes
173 commits
Select commit
Hold shift + click to select a range
43b7dbd
TODOs
gavofyork ddb6745
Add auctions.rs, comment on changes needed.
gavofyork e4eee6e
Remove cruft from slots
gavofyork b300c84
Remove more from auctions.rs
gavofyork b2a3595
More logic drafting in slots.
gavofyork b0b1f8f
More logic in slots.rs
gavofyork 13a2a52
patch some errors
shawntabrizi 4b1b6a4
more fixes
shawntabrizi 45c2126
last nit
shawntabrizi e1a44ad
Cleanups in slots.rs
gavofyork b01561b
Cleanups in slots.rs
gavofyork 3e09a52
patches
shawntabrizi 4f6547c
make build
shawntabrizi 00985a4
crowdloan to new api
gavofyork 9470775
auction compile
shawntabrizi e7ed4ef
Use ParaId instead of FundIndex in Crowdloan (#2303)
shawntabrizi af4f8f4
Auction tests and fix build warnings.
gavofyork d9b4bf3
Configurable origin for initiating auctions
gavofyork 4a5e297
Remove on_finalize
gavofyork b93f6d7
#2303 (manual merge)
gavofyork dc5021d
Tests for Slots
gavofyork f85ac98
some registrar tests
shawntabrizi aefdf65
Merge branch 'gav-new-slots' of github.com:paritytech/polkadot into g…
gavofyork a9de7f2
Apply suggestions from code review
shawntabrizi 4e86619
Update runtime/common/src/slots.rs
shawntabrizi 5ac18ab
Slots uses Registrar for CurrentChains
shawntabrizi da04fbb
swap works test
shawntabrizi f8670bf
on swap impl
shawntabrizi addbeb2
traitify parachain cleanup
shawntabrizi 4177af7
explicit lifecycle tracking for paras
shawntabrizi ceb0bee
initial implementation of lifecycles and upgrades
shawntabrizi ca2e930
clean up a bit
shawntabrizi d5e70a4
Update runtime/common/src/slots.rs
gavofyork f03cf68
fix doc comment
shawntabrizi 8ab27f0
more rigid lifecycle checks
shawntabrizi af59148
include paras which are transitioning, and lifecycle query
shawntabrizi a154cf8
format guide
shawntabrizi bfc96a1
update api
shawntabrizi fdde35f
update guide
shawntabrizi 623746c
explicit outgoing state, fix genesis
shawntabrizi 2eb5e19
handle outgoing with transitioning paras
shawntabrizi ab3426e
Revert "explicit lifecycle tracking for paras"
shawntabrizi c9ce20b
Merge remote-tracking branch 'origin/shawntabrizi-para-lifecycle' int…
shawntabrizi 699c998
remove lifecycle tracking from registrar
shawntabrizi 80c7b64
do not include transitioning paras in identifier
shawntabrizi f253b01
Merge remote-tracking branch 'origin/shawntabrizi-para-lifecycle' int…
shawntabrizi 6119e7e
Update paras_registrar.rs
shawntabrizi 66dcec9
final patches to registrar
shawntabrizi 726a849
Fix test
gavofyork ef4d75d
Merge branch 'gav-new-slots' of github.com:paritytech/polkadot into g…
gavofyork c02732c
use noop in test
shawntabrizi 563612f
clean up pending swap on deregistration
shawntabrizi ae76154
finish registrar tests
shawntabrizi ee07f80
Update roadmap/implementers-guide/src/runtime/paras.md
gavofyork ea62e00
Update roadmap/implementers-guide/src/runtime/paras.md
gavofyork 1289e39
Update roadmap/implementers-guide/src/runtime/paras.md
gavofyork c26b42e
Apply suggestions from code review
gavofyork 26d6c99
Use matches macro
gavofyork 4f26659
Correct terms
gavofyork a785985
Apply suggestions from code review
gavofyork a4e27b5
Remove direct need for Slots and Registrar from Crowdloan
gavofyork 19c821b
Rejig things slightly
gavofyork b2e9011
actions queue
shawntabrizi f56777c
Revert "actions queue"
shawntabrizi 9364cbf
Traitify Auction interface.
gavofyork f2f737d
Merge branch 'master' into gav-new-slots
gavofyork 4b44102
Mockups and initial code for Crowdloan testing
gavofyork 94d7608
One test...
gavofyork 7455165
collapse onboarding state
shawntabrizi f96815a
Merge remote-tracking branch 'origin/shawntabrizi-para-lifecycle' int…
shawntabrizi 068c123
fix some crowdloan tests
shawntabrizi 2471c95
one more
shawntabrizi fc9f04f
Merge branch 'master' into gav-new-slots
shawntabrizi e0094aa
start benchmarks for auctions
shawntabrizi c404b23
benchmark bid
shawntabrizi 900a37f
fix more crowdloan tests
shawntabrizi 2e100fd
onboard and begin retirement no longer exist
shawntabrizi e4376af
Revert "onboard and begin retirement no longer exist"
shawntabrizi 08ac0c6
Simplify crowdloan and make it work.
gavofyork 9db725a
Merge remote-tracking branch 'origin/gav-new-slots' into gav-new-slots
gavofyork 914f343
Fixes
gavofyork 201aa5a
Merge branch 'master' into gav-new-slots
shawntabrizi c4b23d8
fix some
shawntabrizi 57c7a8b
finish merge fixes
shawntabrizi d2fce9c
fix refund bug in auctions
shawntabrizi 28a04e1
Add traits to Registrar for tests and benchmarks
shawntabrizi ff41efe
fix more auction benchmarks
shawntabrizi ad72981
Fix TestAuctioneer
shawntabrizi d6b02ff
finish crowdloan benchmarks
shawntabrizi 9b3a94c
start setting up full integration tests
shawntabrizi 17f24e1
expand integration tests
shawntabrizi 865ecf1
finish basic integration test
shawntabrizi 667c47d
add more integration tests
shawntabrizi 536e589
begin slots benchmarks
shawntabrizi b5ae29e
start paras registrar benchmarks
shawntabrizi 6e85bde
Merge branch 'master' into gav-new-slots
shawntabrizi d12293c
fix merge
shawntabrizi e399c28
Merge branch 'master' into gav-new-slots
shawntabrizi dad14c3
fix tests
shawntabrizi bb722a1
clean up paras registrar
shawntabrizi f911927
remove println
shawntabrizi 0c728f1
remove outdated cleanup config
shawntabrizi e67b365
update benchmarks
shawntabrizi f61ae56
Add WeightInfo
shawntabrizi 828e877
enable runtime-benchmarks feature flag
shawntabrizi bc270f8
complete swap benchmark
shawntabrizi ac909f2
add parachains and onboarding into westend
shawntabrizi d7cf866
add benchmarks and genesis
shawntabrizi 19c17a1
Merge remote-tracking branch 'origin/master' into gav-new-slots
2959782
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
d0d34f7
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
dfda6a8
fix benchmark execution
shawntabrizi 4613a0b
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
e41a925
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
4a0f957
Use `new_raise_len` in crowdloan on_initialize
shawntabrizi 6c606ee
Merge branch 'master' into gav-new-slots
shawntabrizi fc62e87
Merge branch 'master' into gav-new-slots
shawntabrizi f49a656
Update paras_registrar.rs
shawntabrizi 4108f6c
fix westend merge
shawntabrizi 2848f74
impl on_swap for crowdloan
shawntabrizi 480f9f4
Check fund exists before create
shawntabrizi b3004d9
Merge branch 'master' into gav-new-slots
shawntabrizi 19c69bc
update for crowdloan sig
shawntabrizi 3560dd2
Merge remote-tracking branch 'origin/master' into gav-new-slots
c8b3d2c
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
ad59d86
slots on_initialize
shawntabrizi 788fe0f
use integration tests environment for benchmarks
shawntabrizi e875243
Merge branch 'master' into gav-new-slots
shawntabrizi a798f0e
fix hrmp event
shawntabrizi 7e16ff0
auction on_initialize
shawntabrizi bc4c040
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
c1d597c
fix storage name in auctions
shawntabrizi 7d27a33
add auction_index to winning data
shawntabrizi 8f627b2
winning data takes into account current auction index
shawntabrizi 0967618
remove println
shawntabrizi eaeefcf
Merge remote-tracking branch 'origin/master' into gav-new-slots
1b5c837
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
02993bd
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
9ba4c19
Revert "add auction_index to winning data"
shawntabrizi 137d8bc
Merge branch 'master' into gav-new-slots
shawntabrizi 8ccb3ed
Merge branch 'master' into gav-new-slots
shawntabrizi b546d00
Merge remote-tracking branch 'origin/master' into gav-new-slots
gavofyork b17f4e3
PastRandomness.
gavofyork c097406
Fixes
gavofyork 531a20c
Merge branch 'master' into gav-new-slots
shawntabrizi 2c0813f
Merge branch 'master' into gav-new-slots
shawntabrizi 14bc5f2
Use new randomness
shawntabrizi de6a85c
fix use of randomness in auctions and runtime config
shawntabrizi 599ccde
expose consts
shawntabrizi 3a6034a
Merge branch 'master' into gav-new-slots
shawntabrizi d120cb6
fix auction test
shawntabrizi 832ede5
add deposit per byte for para registration
shawntabrizi eaa2bfe
basic swap integration test
shawntabrizi 661a5f9
make swap test more comprehensive
shawntabrizi c5cfc7e
Add WinningVec for easier retrieval in the front-end.
shawntabrizi bb23941
clean up `WinningVec` at the end
shawntabrizi b3a1361
Add event for when a new best bid comes in
shawntabrizi 7f95a0e
Fix propagation of winners in ending period
shawntabrizi 58702bd
fix benchmarks, refund weight in dissolve
shawntabrizi 9cf676d
fix unused
shawntabrizi 9690567
remove some TODOs
shawntabrizi 6f0c1d3
Merge remote-tracking branch 'origin/master' into gav-new-slots
6023930
setup opaque keys for paras in westend
shawntabrizi 1c8c023
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
c047de9
Merge branch 'gav-new-slots' of https://github.com/paritytech/polkado…
shawntabrizi dd6ce16
remove unused
shawntabrizi 3c0d2df
cargo run --release --features=runtime-benchmarks -- benchmark --chai…
e620289
back to regular runtime config
shawntabrizi 2f412cc
use saturating math where user input can be
shawntabrizi 30f32b1
better first slot check
shawntabrizi 1ffdf92
Update runtime/common/src/claims.rs
shawntabrizi 4cbb43e
update westend onswap impl
shawntabrizi 2884304
Merge remote-tracking branch 'origin/master' into gav-new-slots
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use new randomness
- Loading branch information
commit 14bc5f2cebaf6d6860aee51411130efdddfe27f4
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
A comment here on configuration would be helpful. When using BABE randomness we need at least 1 full session between the time the bids are collected and the time we end the auction, otherwise the auction end is predictable.
So if bids are collected in session S, we can use the current epoch randomness (
Babe::random) in session S+2. This would be configured by having this value be at leastepoch_len_in_slotsblocks, which will take at least that many slots.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.
Might even need to be S+3 as the randomness for S+2 is almost or fully determined at the end of session S. Will let @burdges elaborate.
Alternatively we can change the
Babe::randomimplementation to useNextRandomnessbut that has its own set of footguns.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.
paritytech/substrate#8180 will also help with configuration.
Uh oh!
There was an error while loading. Please reload this page.
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.
Yes, we'd only wait one full session/epoch with
RandomnessFromPreviousEpochfrom paritytech/substrate#8180 not more than one like BABE waits. Auctions happen on-chain so they do not need the extra epoch to establish finality.It's confusing because BABE waits twice "in two opposite directions in time" for different reasons:
NextRandomnessakaRandomnessFromPreviousEpochholds randomness for finality, and then BABE uses it asBabeakaRandomnessFromTwoEpochsAgo. All randomness sources require input commitments aka bids here or public keys in babe exist before determining randomness.In cases, one might use
RandomnessFromPreviousEpochright away in the epoch immediately after input commitments, but then input commitments from the end o the previous epoch might come after the randomness. In this case, I doubt anyone could obtain a pairachain for cheaper this way, since the price increases over time, but they could unfairly snipe one. Al and Samuel will be more relaxed if we wait one epoch. ;)