-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
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.
This looks great! It seems simpler
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.
lgtm!
…o compile on my machine
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.
Overall changes and logic LGTM. I still think we need to make the distinction more clear between network role and local role. Not sure if this is working properly right now due to the initial role setup.
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.
LGTM!
I think the script doesn't like the fact that it's on my fork repo. I opened #5520 instead. |
@@ -117,13 +117,7 @@ impl NetworkConfigurationParams { | |||
config.network.non_reserved_mode = NonReservedPeerMode::Deny; | |||
} | |||
|
|||
config.network.sentry_nodes.extend(self.sentry_nodes.clone()); |
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.
@tomaka is it intended that you do not set NetworkConfiguration.sentry_nodes anymore??
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.
Oh I see, you removed sentry_nodes from NetworkConfiguration. But then why is it still in the cli??
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.
Nevermind I will figure out
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.
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.
Yeah I figured out. I think sentry_nodes should have been moved to runcmd. NetworkConfigurationParams is only supposed to populate the NetworkConfiguration. I've done it while fixing merge conflicts in #5271
This PR splits the
Roles
bitfield in three:The existing
Roles
has been moved untouched into thesc_network::protocol::message
module, where it continues to represent the data that is transferred on the wire.sc_network::config
now contains a newRole
(note the lack of 's') enum whose variants areFull
,Light
,Sentry
andAuthority
. It is more robust to misuse, as one can only pass a list of sentry nodes when usingAuthority
, and a valiator when usingSentry
.The gossiping API now uses
ObservedRole
, which is an enum that can be one ofFull
,Light
,OurSentry
(for when you're a validator connecting to your sentry),OurGuardedValidator
(for when you're a sentry connecting to your validator), orAuthority
(for third-party validators).GrandPa has been adjusted to always gossip messages to nodes whose role is
OurSentry
orOurGuardedValidator
. This fixes some issues with validators not receiving GrandPa messages from their sentries. This change is the original reason for this PR.Additionally, the
--sentry
CLI option now accepts a multiaddress as parameter, representing the address of the validator we're protecting. This is a CLI breaking change.While modifying the CLI code, I encountered some issues with how to properly build a
Role::Authority
when the parameter of--sentry
is aString
.To fix that, I changed various
Strings
in the structopt structs insc_cli
to instead contain aMultiaddr
orMultiaddrWithPeerId
(a new type introduced in this PR).Some other minor changes:
client/rpc/api/system::NodeRole
now contains aSentry
variant. In other words, querying the node role from the RPC endpoint will now return "sentry" for sentries.authority_discovery
now accepts aVec<MultiaddrWithPeerId>
instead of aVec<String>
in accordance with the changes in the CLI.node_role
Prometheus metric will now contain the value3
for sentries, rather than4
(4 meaning "authority").polkadot companion: paritytech/polkadot#960