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

Deprecate frame_system::block_number #6245

Open
gupnik opened this issue Oct 26, 2024 · 2 comments
Open

Deprecate frame_system::block_number #6245

gupnik opened this issue Oct 26, 2024 · 2 comments
Assignees
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@gupnik
Copy link
Contributor

gupnik commented Oct 26, 2024

With the addition of BlockNumberProvider to all pallets as being tracked in #3268, we should deprecate frame_system::block_number as suggested by @kianenigma in #5723 (comment)

@gupnik gupnik added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Oct 26, 2024
@gupnik gupnik self-assigned this Oct 26, 2024
@kianenigma kianenigma changed the title Depricate frame_system::block_number Deprecate frame_system::block_number Oct 28, 2024
@kianenigma
Copy link
Contributor

kianenigma commented Oct 29, 2024

Reading my comment in #5723 (comment) again, I wonder if a unified type BlockNumber: trait BlockNumberProvider

with

trait BlockNumberProvider {
    fn current_block_number() -> u32;
    /// None if solochain, Some(_) if para. 
    fn relay_block_number() -> Option<u32>;
}

Is acceptable? This would remove the need to alter every single pallet.

we're def leaking the idea of "relay" chain to all solo chains, but our aim is to make polkadot-sdk parachain-first anyways.

@gui1117
Copy link
Contributor

gui1117 commented Nov 13, 2024

I wonder if we actually want to use the relay chain block number that often.

If we want a number that increments regularly, we probably actually want to use the time.
If we want a number that increments related to the chain progress then we want the chain block number.

The only reason to use the relay chain block number instead of the time would be if the relay chain don't produce block for a while, and so the parachain can't push its task on time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

No branches or pull requests

3 participants