Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@mxinden
Copy link
Contributor

@mxinden mxinden commented Sep 26, 2019

Previously srml/authority-discovery depended on the srml/im-online
session key type directly. With this patch srml/authority-discovery is
generic over the session key type it is going to use, as long as it
implements the RuntimeAppPublic trait.

With this patch one can use the srml/authority-discovery module
without the srml/im-online module.

Next to the above, this patch configures node/runtime to use the babe
session keys for the authority discovery module.

Previously `srml/authority-discovery` dependet on the `srml/im-online`
session key type directly. With this patch `srml/authority-discovery` is
generic over the session key type it is going to use, as long as it
implements the RuntimeAppPublic trait.

With this patch one can use the `srml/authority-discovery` module
without the `srml/im-online` module.

Next to the above, this patch configures `node/runtime` to use the babe
session keys for the authority discovery module.
@mxinden mxinden added the A0-please_review Pull request needs code review. label Sep 26, 2019

[dependencies]
app-crypto = { package = "substrate-application-crypto", path = "../../core/application-crypto", default-features = false }
babe-primitives = { package = "substrate-consensus-babe-primitives", path = "../../core/consensus/babe/primitives", default-features = false }
Copy link
Member

Choose a reason for hiding this comment

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

This needs to go into dev-dependencies. You don't need it for the normal build.

Copy link
Member

Choose a reason for hiding this comment

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

.

Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

One change required, otherwise looks good.


[dependencies]
app-crypto = { package = "substrate-application-crypto", path = "../../core/application-crypto", default-features = false }
babe-primitives = { package = "substrate-consensus-babe-primitives", path = "../../core/consensus/babe/primitives", default-features = false }
Copy link
Member

Choose a reason for hiding this comment

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

.

@mxinden
Copy link
Contributor Author

mxinden commented Sep 27, 2019

@bkchr thanks for the review! Can you take another look?

type AuthoritySignatureFor<T> =
<<T as im_online::Trait>::AuthorityId as RuntimeAppPublic>::Signature;
pub trait Trait: system::Trait + session::Trait {
type AuthorityId: RuntimeAppPublic + Default + Decode + Encode + PartialEq;
Copy link
Contributor

Choose a reason for hiding this comment

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

needs docs

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

lgtm

// and set impl_version to equal spec_version. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 165,
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the spec version be increased (and not impl version)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andresilva do I understand correctly that we increase the spec_version whenever we have breaking changes visible only outside of the runtime boundary?

This patch set does not touch the core/authority-discovery/primitives::AuthorityDiscoveryApi, thus as far as I can tell it is not visible outside of the runtime boundary. Am I missing something?

Copy link
Member

Choose a reason for hiding this comment

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

Given that we switch to Babe as authority id, @andresilva is right. You change the behavior of runtime and this new runtime would not be compatible with the old runtime when it comes to authority discovery.

Copy link
Contributor

Choose a reason for hiding this comment

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

My vague definition for when to increment spec_version is a bit stricter than that, since internal behavior of the module can change without any changes being introduced at the boundaries. Keeping the same spec_version means that a previous compiled blob of the runtime without these changes can be executed as is.

@rphmeier
Copy link
Contributor

can merge when passing

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

Merge master to fix CI issues and also bump spec version.

@andresilva andresilva merged commit 7fc0a91 into paritytech:master Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants