-
Notifications
You must be signed in to change notification settings - Fork 710
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
Update Treasury to Support Relay Chain Block Number Provider #3970
Merged
muharem
merged 38 commits into
paritytech:master
from
shawntabrizi:shawntabrizi-treasury
Nov 1, 2024
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
d7678db
add block number provider
shawntabrizi a8b649d
logic for handling multiple spend periods passed
shawntabrizi 757c7f4
update for new associated type
shawntabrizi 0f74c0c
add and fix tests
shawntabrizi 2b1bd39
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi b0cc89d
fix bug!
shawntabrizi f01f0e6
introduce `update_last_spend_period`
shawntabrizi 904dd96
remove test feature flag
shawntabrizi 1add90c
Update substrate/frame/treasury/src/lib.rs
shawntabrizi 7ee9a4b
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi a45e506
Update mod.rs
shawntabrizi 6a0becc
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi ad5d05a
Merge branch 'master' into shawntabrizi-treasury
bkchr 64ceef4
Create pr_3970.prdoc
shawntabrizi e3a06a8
Update substrate/frame/treasury/src/lib.rs
bkchr e61e0f2
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi d0027d1
Update pr_3970.prdoc
shawntabrizi ea02217
Merge branch 'shawntabrizi-treasury' of https://github.com/shawntabri…
shawntabrizi 874db2a
Update mod.rs
shawntabrizi e155ee6
fix bounties test
shawntabrizi 53a1a2e
update child bounties tests for consistency
shawntabrizi b1f3407
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi be1d7d0
Merge branch 'master' into shawntabrizi-treasury
bkchr aceda46
Merge remote-tracking branch 'upstream/master' into shawntabrizi-trea…
shawntabrizi e1f25b3
more fixes
shawntabrizi cc80522
fix `on_initialize(0)` which is invalid
shawntabrizi b383500
fix up child bounties for block number
shawntabrizi bf6b8d2
choose a more specific name
shawntabrizi ee8ce2b
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi 93418c5
Merge remote-tracking branch 'upstream/master' into shawntabrizi-trea…
shawntabrizi bac943d
Merge remote-tracking branch 'upstream/master' into shawntabrizi-trea…
shawntabrizi a4f2732
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi 554eac1
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi 2ef0ce3
Update prdoc/pr_3970.prdoc
shawntabrizi fa68d86
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi b90bf4a
Merge branch 'master' into shawntabrizi-treasury
muharem 471cb2b
Merge branch 'master' into shawntabrizi-treasury
shawntabrizi b0d7d52
Merge branch 'master' into shawntabrizi-treasury
muharem 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
There are no files selected for viewing
This file contains 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: Update Treasury to Support Block Number Provider | ||
|
||
doc: | ||
- audience: Runtime Dev | ||
description: | | ||
The goal of this PR is to have the treasury pallet work on a parachain which does not produce blocks on a regular schedule, thus can use the relay chain as a block provider. Because blocks are not produced regularly, we cannot make the assumption that block number increases monotonically, and thus have new logic to handle multiple spend periods passing between blocks. To migrate existing treasury implementations, simply add `type BlockNumberProvider = System` to have the same behavior as before. | ||
|
||
crates: | ||
- name: pallet-treasury | ||
bump: major | ||
- name: pallet-bounties | ||
bump: minor | ||
- name: pallet-child-bounties | ||
bump: minor |
This file contains 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 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 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
Oops, something went wrong.
Oops, something went wrong.
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.
I imagine most of the logic breaks when a parachain migrates from
System
to theRelay
BlockNumberProvider
...Not sure what can be done about it without re-writing the pallet to use timepoints. Maybe we can use this as first step and advise to still use
System
.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 transition from system to relay will always require a migration due to the nature of the code.
you think we should be transitioning to use timestamps for all of these various pallet logic? I have always suggested against this, but perhaps due to the nature of Polkadot, it might be the right thing to do.
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.
I think in the long term we need some kind of block-number-abstraction like #3268, but its a bit stale now as low-prio. That is not necessarily timestamps, but could be implemented with Relay blocknumber or something else.