Skip to content
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

Prepare pallets for async backing #471

Open
wants to merge 1 commit into
base: 03-14-upgrade_to_stable2412-2
Choose a base branch
from

Conversation

dastansam
Copy link

@dastansam dastansam commented Mar 14, 2025

What?

Introduces BlockNumberProvider type for pallets

Why?

So that we can use a more reliable, consistent notion of block number, since with async backing system block number becomes nondeterministic

How?

Relay chain's block number is used where possible, i.e funding, linear-release, and we rely on system block number in other cases

Testing?

Changes were made to Instantiator so that it works for both integration and unit tests, since now integration tests Runtime uses relay chain's block number instead of chain's

Screenshots (optional)

Anything Else?

#469

Copy link
Author

dastansam commented Mar 14, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dastansam dastansam marked this pull request as ready for review March 14, 2025 08:13
@dastansam dastansam self-assigned this Mar 14, 2025
@dastansam dastansam requested a review from lrazovic March 14, 2025 08:13
Copy link

graphite-app bot commented Mar 14, 2025

Graphite Automations

"Auto-assign PRs to author" took an action on this PR • (03/14/25)

1 assignee was added to this PR based on Juan Ignacio Rios's automation.

@dastansam dastansam force-pushed the 03-14-prepare_pallets_for_async_backing branch from a021c92 to e07c1a9 Compare March 14, 2025 08:40
@dastansam dastansam force-pushed the 03-14-prepare_pallets_for_async_backing branch from e07c1a9 to cbc803c Compare March 17, 2025 09:14
@dastansam dastansam force-pushed the 03-14-upgrade_to_stable2412-2 branch from 0ca5002 to 891799a Compare March 19, 2025 14:37
@dastansam dastansam force-pushed the 03-14-prepare_pallets_for_async_backing branch from cbc803c to 4317213 Compare March 19, 2025 14:37
@dastansam dastansam force-pushed the 03-14-upgrade_to_stable2412-2 branch from 891799a to d116e92 Compare March 19, 2025 15:17
@dastansam dastansam force-pushed the 03-14-prepare_pallets_for_async_backing branch from 4317213 to 8c9017b Compare March 19, 2025 15:17
@dastansam dastansam force-pushed the 03-14-upgrade_to_stable2412-2 branch from d116e92 to 2828880 Compare March 19, 2025 15:18
@dastansam dastansam force-pushed the 03-14-prepare_pallets_for_async_backing branch from 8c9017b to d1e02ed Compare March 19, 2025 15:18
Copy link
Member

@lrazovic lrazovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 2 nits, but the approach seems straightforward!


#[frame_support::pallet]
pub mod pallet {
use super::BlockNumberFor;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this also part of the use super::*; two lines below?

@@ -115,6 +115,9 @@ pub mod pallet {
/// The Whitelisted policy for the dispenser. Users' credentials should have the same
/// policy to be eligible for token dispensing.
type WhitelistedPolicy: Get<Cid>;

// /// Block number provider.
// type BlockNumberProvider: BlockNumberProvider<BlockNumber = BlockNumberFor<Self>>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants