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

[Pre async-backing] [Moonbase] Use relay-slot number as clocktime #2577

Merged
merged 102 commits into from
Jan 25, 2024

Conversation

Agusrodri
Copy link
Contributor

@Agusrodri Agusrodri commented Nov 24, 2023

What does it do?

Replaces the previous parachain block number that was used as a clocktime in parachain staking by the relay chain slot number.

The reason for this is that it is advised to rely on the relay chain slot number instead of the parachain's block number due to the relay slot is more stable and works better together with the future async-backing changes.

Related forum post: https://forum.polkadot.network/t/blocknumber-vs-timestamps-should-we-abandon-blocktimes-altogether/4077/2

TODO

  • Refactor migrations

@Agusrodri Agusrodri added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. breaking Needs to be mentioned in breaking changes labels Nov 24, 2023
Copy link
Contributor

github-actions bot commented Nov 27, 2023

Coverage Report

@@                     Coverage Diff                     @@
##           master   agustin-relay-clocktime      +/-   ##
===========================================================
- Coverage   80.94%                    80.90%   -0.04%     
  Files         287                       287              
+ Lines       94330                     94465     +135     
===========================================================
+ Hits        76355                     76423      +68     
+ Misses      17975                     18042      +67     
Files Changed Coverage
/pallets/parachain-staking/src/lib.rs 90.62% (+0.04%) 🔼
/pallets/parachain-staking/src/tests.rs 91.59% (+0.01%) 🔼
/precompiles/parachain-staking/src/mock.rs 97.81% (+0.08%) 🔼
/runtime/common/src/apis.rs 85.38% (+0.10%) 🔼
/runtime/common/src/migrations.rs 67.48% (-23.19%) 🔽
/runtime/moonbase/src/lib.rs 49.75% (+0.71%) 🔼
/runtime/moonbase/tests/common/mod.rs 95.64% (+0.17%) 🔼
/runtime/moonbeam/src/lib.rs 45.80% (-0.13%) 🔽
/runtime/moonriver/src/lib.rs 45.79% (-0.13%) 🔽

Coverage generated Tue Jan 23 14:21:09 UTC 2024

@noandrea noandrea added D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited and removed D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Jan 12, 2024
Copy link
Collaborator

@librelois librelois left a comment

Choose a reason for hiding this comment

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

It looks pretty good overall, but we need to understand why a collator now needs a delegation to produce blocks, it's not normal.

pallets/parachain-staking/src/lib.rs Outdated Show resolved Hide resolved
runtime/moonbeam/src/lib.rs Outdated Show resolved Hide resolved
runtime/moonriver/src/lib.rs Outdated Show resolved Hide resolved
test/suites/dev/test-staking/test-staking-consts.ts Outdated Show resolved Hide resolved
pallets/parachain-staking/src/lib.rs Show resolved Hide resolved
pallets/parachain-staking/src/mock.rs Show resolved Hide resolved
runtime/common/src/migrations.rs Show resolved Hide resolved
@Agusrodri Agusrodri changed the title [Pre async-backing] Use relay-slot number as clocktime [Pre async-backing] [Moonbase] Use relay-slot number as clocktime Jan 25, 2024
@Agusrodri Agusrodri merged commit 5326a0c into master Jan 25, 2024
28 checks passed
@Agusrodri Agusrodri deleted the agustin-relay-clocktime branch January 25, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants