Repository navigation
feat(validator-set)!: minimum author node version (spec 18, node/runtime 0.4.0) - #159
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root can now require block authors to run a minimum node version. Each node declares its version in every block it authors, and the runtime rejects blocks from authors below the minimum. A lagging validator loses its slots but keeps importing and voting on finality.
While no minimum is set nothing is enforced, so every existing binary keeps authoring.
How it works
note_author_version, identifier*b"nodevers"). A crate version that does not fitmajor.minor.patchin u16 fails the build.LastAuthorVersionkeeps each approved validator's last declared version and the block it declared in. An entry is dropped when:set_min_author_version(Some(v)). The call is refused withVersionQuorumNotMetunless 2/3 of the approved set declaredvor newer withinQuorumWindow(one session). An empty set is always refused, so a minimum can never halt Aura.Nonelifts the minimum with no quorum.on_finalizerejects it);Changes
pallet-validator-setauthor_version/module:-
version.rs:NodeVersionwith aconst fn parseandDisplay-
inherent.rs: the identifier and the node's inherent provider-
declarations.rs: what the runtime accepts, records and rejects, plus the quorumCalls 6 (
set_min_author_version) and 7 (note_author_version), storage, event, errors, benchmarks and estimated weights.Breaking:
ConfiggainsFindAuthorandQuorumWindow.spec_version18;transaction_versionstays 5 (calls added, none changed).FindAuthor = FindAuthorAccountId,QuorumWindow = Period.author_version.rsmodule: the compile-time version, the inherent provider wired into every inherent-provider tuple, and the startup check.tests/mod.rsandtests/author_version.rs.pallet-validator-set,orbinum-runtimeandorbinum-nodebumped to 0.4.0. Node 0.4.0 is the first binary that declares its version.docs/min-author-version.md(operator guide), the pallet CHANGELOG[0.4.0], and the spec 18 row inRUNTIME_VERSIONS.md.Rollout
v0.4.0(it must match the node crate version).setCodespec 18. Old binaries keep authoring; no new host function.validatorSet.setMinAuthorVersion(0.4.0).Security
on_finalize, andAddRemoveOriginisEnsureRoot.Testing
cargo test -p pallet-validator-setruntime-benchmarks)cargo test -p orbinum-runtimecargo fmt --check,taplo fmt --check,make clippy(CI flags)Local 4-validator network: genesis spec 17, then
setCodeto spec 18, mixing old and new binaries.noteAuthorVersion, unsigned or signedTransaction dispatch is mandatorysetMinAuthorVersionfrom a non-root accountBadOriginVersionQuorumNotMetFollow-ups
set_min_author_versionandnote_author_versionon the reference machine; their weights are estimated for now.remove_validatorandderegister_validator: each now does one more storage removal.