-
Notifications
You must be signed in to change notification settings - Fork 2.6k
grandpa: allow authority set hard forks to be forced #10444
Conversation
client/finality-grandpa/src/lib.rs
Outdated
/// The last finalized block number by the network. If defined, then the | ||
/// authority set change will be forced, i.e. the node won't wait for the | ||
/// block above to be finalized before enacting it. |
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 comment confuses me.
I mean I get what it does by reading the code, but I interpret the comment differently.
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 updated it. Let me know if it is more understandable now.
/// the node won't wait for the block above to be finalized before enacting | ||
/// the change, and the given finalized number will be used as a base for | ||
/// voting. | ||
pub last_finalized: Option<NumberFor<Block>>, |
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.
Sorry again me :P
Does this mean that block
above should be last_finalized + 1
?
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 necessarily need to be + 1
, but it needs to be a block that is higher than last_finalized
yes.
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'm completely confused now.
Let's say we set last_finalized
to 1
and block
is 3
. So, the set will be enacted at 3
, but it will already be active at 1
?
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.
In that scenario the change gets enacted when block #3 is imported, and the GRANDPA voter will act as if block #1 is finalized, i.e. this is the base it will start voting on.
(I think you are forgetting that GRANDPA needs to distinguish between best imported and best finalized, and best finalized is always lower or equal to best imported)
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.
@bkchr Cumulus will get fixed by updating polkadot. What do we do here? |
Ignore. |
* grandpa: allow authority set hard forks to be forced * grandpa: fix authority set hard forks in warp proof provider * grandpa: make AuthoritySetHardFork public * grandpa: extend comment
* grandpa: allow authority set hard forks to be forced * grandpa: fix authority set hard forks in warp proof provider * grandpa: make AuthoritySetHardFork public * grandpa: extend comment
* grandpa: allow authority set hard forks to be forced * grandpa: fix authority set hard forks in warp proof provider * grandpa: make AuthoritySetHardFork public * grandpa: extend comment
* grandpa: allow authority set hard forks to be forced * grandpa: fix authority set hard forks in warp proof provider * grandpa: make AuthoritySetHardFork public * grandpa: extend comment
* grandpa: allow authority set hard forks to be forced * grandpa: fix authority set hard forks in warp proof provider * grandpa: make AuthoritySetHardFork public * grandpa: extend comment
* grandpa: allow authority set hard forks to be forced * grandpa: fix authority set hard forks in warp proof provider * grandpa: make AuthoritySetHardFork public * grandpa: extend comment
* grandpa: allow authority set hard forks to be forced * grandpa: fix authority set hard forks in warp proof provider * grandpa: make AuthoritySetHardFork public * grandpa: extend comment
This PR extends the GRANDPA authority set hard fork functionality to allow defining the changes as forced, i.e. enacted instantly instead of waiting for finality.
polkadot companion: paritytech/polkadot#4486