-
Notifications
You must be signed in to change notification settings - Fork 708
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
backing: move the min votes threshold to the runtime #1200
Conversation
also cache it per-session in the backing subsystem Signed-off-by: alindima <[email protected]>
also enable it for rococo/versi for testing
this dependency has been recently introduced by async backing
this is not needed, as the RuntimeAPISubsystem already takes care of versioning and will return NotSupported if the version is not right.
- parametrise backing votes runtime API with session index - remove RuntimeInfo usage in backing subsystem, as runtime API caches the min backing votes by session index anyway. - move the logic for adjusting the configured needed backing votes with the size of the backing group to a primitives helper. - move the legacy min backing votes value to a primitives helper. - mark JoinMultiple error as fatal, since the Canceled (non-multiple) counterpart is also fatal. - make backing subsystem handle fatal errors for new leaves update. - add HostConfiguration consistency check for zeroed backing votes threshold - add cumulus accompanying change
wut? the job passed.. |
I have tested the runtime upgrade locally with zombienet. it works as expected |
@@ -588,6 +588,16 @@ impl RelayChainRpcClient { | |||
.await | |||
} | |||
|
|||
/// Get the minimum number of backing votes for a candidate. | |||
pub async fn parachain_host_minimum_backing_votes( |
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.
Is this even needed in cumulus? It should not.
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.
It doesn't compile without it, I see all runtime APIs have counterparts here.
I'm not sure why they're needed though
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 had similar question some time ago, and got this suggestion from @skunert: paritytech/cumulus#2160 (comment)
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 don't fully agree with that. For UX simplicity, I think the interface should expose the bare necessities for collators.
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 we can open a separate issue to discuss this further
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.
see: #1332
@@ -588,6 +588,16 @@ impl RelayChainRpcClient { | |||
.await | |||
} | |||
|
|||
/// Get the minimum number of backing votes for a candidate. | |||
pub async fn parachain_host_minimum_backing_votes( |
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 don't fully agree with that. For UX simplicity, I think the interface should expose the bare necessities for collators.
@@ -1741,6 +1741,8 @@ pub mod migrations { | |||
|
|||
// Upgrade SessionKeys to include BEEFY key | |||
UpgradeSessionKeys, | |||
|
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.
nit: a comment describing what the migration does is useful.
* master: (25 commits) fix typos (#1339) Use bandersnatch-vrfs with locked dependencies ref (#1342) Bump bs58 from 0.4.0 to 0.5.0 (#1293) Contracts: `seal0::balance` should return the free balance (#1254) Logs: add extra debug log for negative rep changes (#1205) Added short-benchmarks for cumulus (#1183) [xcm-emulator] Improve hygiene and clean up (#1301) Bump the known_good_semver group with 1 update (#1347) Renames API (#1186) Rename `polkadot-parachain` to `polkadot-parachain-primitives` (#1334) Add README to project root (#1253) Add environmental variable to track decoded instructions (#1320) Fix polkadot-node-core-pvf-prepare-worker build with jemalloc (#1315) Sassafras primitives (#1249) Restructure `dispatch` macro related exports (#1162) backing: move the min votes threshold to the runtime (#1200) Bump zstd from 0.11.2+zstd.1.5.2 to 0.12.4 (#1326) Remove `substrate_test_utils::test` (#1321) remove disable-runtime-api (#1328) [ci] add more jobs for pipeline cancel, cleanup (#1314) ...
* move min backing votes const to runtime also cache it per-session in the backing subsystem Signed-off-by: alindima <[email protected]> * add runtime migration * introduce api versioning for min_backing votes also enable it for rococo/versi for testing * also add min_backing_votes runtime calls to statement-distribution this dependency has been recently introduced by async backing * remove explicit version runtime API call this is not needed, as the RuntimeAPISubsystem already takes care of versioning and will return NotSupported if the version is not right. * address review comments - parametrise backing votes runtime API with session index - remove RuntimeInfo usage in backing subsystem, as runtime API caches the min backing votes by session index anyway. - move the logic for adjusting the configured needed backing votes with the size of the backing group to a primitives helper. - move the legacy min backing votes value to a primitives helper. - mark JoinMultiple error as fatal, since the Canceled (non-multiple) counterpart is also fatal. - make backing subsystem handle fatal errors for new leaves update. - add HostConfiguration consistency check for zeroed backing votes threshold - add cumulus accompanying change * fix cumulus test compilation * fix tests * more small fixes * fix merge * bump runtime api version for westend and rollback version for rococo --------- Signed-off-by: alindima <[email protected]> Co-authored-by: Javier Viola <[email protected]>
Copy of paritytech/polkadot#7577
Also addresses review comments.
For previous reviewers: I maintained the list of commits from previous PR. The only unreviewed commits, are the ones starting with: e7e82bc, which address the review comments