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

Collecting validator verification key in Substrate - generic way #463

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

yahortsaryk
Copy link
Contributor

@yahortsaryk yahortsaryk commented Oct 29, 2024

Description

This PR removes the excessive set_current_validator extrinsic and applies the generic approach for collecting the verification key from the keystore as it is done in the substrate source code

Types of Changes

Please select the branch type you are merging and fill in the relevant template.

  • Hotfix
  • Release
  • Fix or Feature

Fix or Feature

Types of Changes

  • Tech Debt (Code improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Dependency upgrade (A change in substrate or any 3rd party crate version)

Migrations and Hooks

  • This change requires a runtime migration.
  • Modifies on_initialize
  • Modifies on_finalize

Checklist for Fix or Feature

  • Change has been tested locally.
  • Change adds / updates tests if applicable.
  • Changelog doc updated.
  • spec_version has been incremented.
  • network-relayer's events have been updated according to the blockchain events if applicable.
  • All CI checks have been passed successfully

Checklist for Hotfix

  • Change has been deployed to Testnet.
  • Change has been tested in Testnet.
  • Changelog has been updated.
  • Crate version has been updated.
  • spec_version has been incremented.
  • Transaction version has been updated if required.
  • Pull Request to dev has been created.
  • Pull Request to staging has been created.
  • network-relayer's events have been updated according to the blockchain events if applicable.
  • All CI checks have been passed successfully

Checklist for Release

  • Change has been deployed to Devnet.
  • Change has been tested in Devnet.
  • Change has been deployed to Qanet.
  • Change has been tested in Qanet.
  • Change has been deployed to Testnet.
  • Change has been tested in Testnet.
  • Changelog has been updated.
  • Crate version has been updated.
  • Spec version has been updated.
  • Transaction version has been updated if required.
  • All CI checks have been passed successfully

pallet_grandpa::migrations::MigrateV4ToV5<Runtime>,
pallet_ddc_verification::migrations::v1::MigrateToV1<Runtime>,
);
type Migrations = ();
Copy link
Contributor Author

@yahortsaryk yahortsaryk Oct 29, 2024

Choose a reason for hiding this comment

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

This upgrade should be merged and deployed to DEVNET after the #457 is deployed. That's why I'm removing the related migrations here.

use crate::KEY_TYPE;
app_crypto!(sr25519, KEY_TYPE);
use crate::DAC_VERIFICATION_KEY_TYPE;
app_crypto!(sr25519, DAC_VERIFICATION_KEY_TYPE);
Copy link
Member

Choose a reason for hiding this comment

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

There is a similar pattern in authority-discovery, babe, and such. But they define AuthorityId as an alias for the Public made by the macros (https://github.com/paritytech/polkadot-sdk/blob/c8d2251cafadc108ba2f1f8a3208dc547ff38901/substrate/primitives/authority-discovery/src/lib.rs#L35). Should we do the same for validators accounts or the AccountId suits for us?

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