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

Mock relay block number in dev service. #453

Merged
merged 5 commits into from
May 28, 2021

Conversation

JoshOrndorff
Copy link
Contributor

Currently the dev service always injects the relay chain block number of 0. This is fine for many purposes, but the more our para logic depends on the relay block number the less suitable this becomes.

We now have at least three concrete cases that could benefit from a more realistically-mocked block number.

  1. Crowdloan rewards are vested based on relay block number.
  2. Runtime upgrades are allowed (or not) based on relay block number
  3. Nimbus slots are triggered based on relay block number.

Checklist

  • Does it require a purge of the network?
  • You bumped the runtime version if there are breaking changes in the runtime ?
  • Does it require changes in documentation/tutorials ?

node/service/src/inherents.rs Outdated Show resolved Hide resolved
node/service/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@4meta5 4meta5 left a comment

Choose a reason for hiding this comment

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

Looks good

@JoshOrndorff JoshOrndorff merged commit a3680ad into master May 28, 2021
@JoshOrndorff JoshOrndorff deleted the joshy-mock-relay-block-number-in-dev-service branch May 28, 2021 16:27
@JoshOrndorff
Copy link
Contributor Author

It would be good to have an integration test for this too. From typescript we should ensure that para block 1 has relay block 1000 and that parablock 2 has relay block 1002.

@joelamouche
Copy link
Contributor

@JoshOrndorff Sounds good but that would mean using polkadot-launch right?

@JoshOrndorff
Copy link
Contributor Author

This PR is all about the dev service, so no need to launch a parachain.

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.

6 participants