-
Notifications
You must be signed in to change notification settings - Fork 181
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
Remove protocol.Params.ProtocolVersion
field
#6955
base: feature/efm-recovery
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -23,11 +23,14 @@ import ( | |||||
) | ||||||
|
||||||
var ( | ||||||
flagRootChain string | ||||||
flagRootParent string | ||||||
flagRootHeight uint64 | ||||||
flagRootTimestamp string | ||||||
flagProtocolVersion uint | ||||||
flagRootChain string | ||||||
flagRootParent string | ||||||
flagRootHeight uint64 | ||||||
flagRootTimestamp string | ||||||
// Deprecated: Replaced by ProtocolState KVStore version | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. following up on my suggestion for the previous PR #6953:
Suggested change
|
||||||
// Historically, this flag set a spork-scoped version number, by convention equal to the major software version. | ||||||
// Now that we have HCUs which change the major software version mid-spork, this is no longer useful. | ||||||
deprecatedFlagProtocolVersion uint | ||||||
flagFinalizationSafetyThreshold uint64 | ||||||
flagEpochExtensionViewCount uint64 | ||||||
flagCollectionClusters uint | ||||||
|
@@ -92,14 +95,13 @@ func addRootBlockCmdFlags() { | |||||
rootBlockCmd.Flags().StringVar(&flagRootParent, "root-parent", "0000000000000000000000000000000000000000000000000000000000000000", "ID for the parent of the root block") | ||||||
rootBlockCmd.Flags().Uint64Var(&flagRootHeight, "root-height", 0, "height of the root block") | ||||||
rootBlockCmd.Flags().StringVar(&flagRootTimestamp, "root-timestamp", time.Now().UTC().Format(time.RFC3339), "timestamp of the root block (RFC3339)") | ||||||
rootBlockCmd.Flags().UintVar(&flagProtocolVersion, "protocol-version", flow.DefaultProtocolVersion, "major software version used for the duration of this spork") | ||||||
rootBlockCmd.Flags().UintVar(&deprecatedFlagProtocolVersion, "protocol-version", 0, "deprecated: this flag will be ignored and remove in a future release") | ||||||
rootBlockCmd.Flags().Uint64Var(&flagFinalizationSafetyThreshold, "finalization-safety-threshold", 500, "defines finalization safety threshold") | ||||||
rootBlockCmd.Flags().Uint64Var(&flagEpochExtensionViewCount, "epoch-extension-view-count", 100_000, "length of epoch extension in views, default is 100_000 which is approximately 1 day") | ||||||
|
||||||
cmd.MarkFlagRequired(rootBlockCmd, "root-chain") | ||||||
cmd.MarkFlagRequired(rootBlockCmd, "root-parent") | ||||||
cmd.MarkFlagRequired(rootBlockCmd, "root-height") | ||||||
cmd.MarkFlagRequired(rootBlockCmd, "protocol-version") | ||||||
cmd.MarkFlagRequired(rootBlockCmd, "finalization-safety-threshold") | ||||||
cmd.MarkFlagRequired(rootBlockCmd, "epoch-extension-view-count") | ||||||
|
||||||
|
@@ -134,6 +136,9 @@ func rootBlock(cmd *cobra.Command, args []string) { | |||||
log.Fatal().Msg("cannot use both --partner-stakes and --partner-weights flags (use only --partner-weights)") | ||||||
} | ||||||
} | ||||||
if deprecatedFlagProtocolVersion != 0 { | ||||||
log.Warn().Msg("using deprecated flag --protocol-version; please remove this flag from your workflow, it is ignored and will be removed in a future release") | ||||||
} | ||||||
|
||||||
// validate epoch configs | ||||||
err := validateEpochConfig() | ||||||
|
@@ -226,7 +231,6 @@ func rootBlock(cmd *cobra.Command, args []string) { | |||||
intermediaryParamsData := IntermediaryParamsData{ | ||||||
FinalizationSafetyThreshold: flagFinalizationSafetyThreshold, | ||||||
EpochExtensionViewCount: flagEpochExtensionViewCount, | ||||||
ProtocolVersion: flagProtocolVersion, | ||||||
} | ||||||
intermediaryData := IntermediaryBootstrappingData{ | ||||||
IntermediaryEpochData: intermediaryEpochData, | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package metrics | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
@@ -14,10 +12,9 @@ type NodeInfoCollector struct { | |
} | ||
|
||
const ( | ||
sporkIDLabel = "spork_id" | ||
versionLabel = "version" | ||
commitLabel = "commit" | ||
protocolVersionLabel = "protocol_version" | ||
sporkIDLabel = "spork_id" | ||
versionLabel = "version" | ||
commitLabel = "commit" | ||
) | ||
|
||
func NewNodeInfoCollector() *NodeInfoCollector { | ||
|
@@ -32,9 +29,8 @@ func NewNodeInfoCollector() *NodeInfoCollector { | |
return collector | ||
} | ||
|
||
func (sc *NodeInfoCollector) NodeInfo(version, commit, sporkID string, protocolVersion uint) { | ||
func (sc *NodeInfoCollector) NodeInfo(version, commit, sporkID string) { | ||
sc.nodeInfo.WithLabelValues(versionLabel, version) | ||
sc.nodeInfo.WithLabelValues(commitLabel, commit) | ||
sc.nodeInfo.WithLabelValues(sporkIDLabel, sporkID) | ||
sc.nodeInfo.WithLabelValues(protocolVersionLabel, strconv.FormatUint(uint64(protocolVersion), 10)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vishalchangrani do we use this for partner tracking, or just the version? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually, nm. this isn't related to the ping service |
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -29,16 +29,3 @@ func InsertSporkRootBlockHeight(height uint64) func(*badger.Txn) error { | |||
func RetrieveSporkRootBlockHeight(height *uint64) func(*badger.Txn) error { | ||||
return retrieve(makePrefix(codeSporkRootBlockHeight), height) | ||||
} | ||||
|
||||
// InsertProtocolVersion inserts the protocol version for the present spork. | ||||
// A single database and protocol state instance spans at most one spork, and | ||||
// a spork has exactly one protocol version for its duration, so this is | ||||
// inserted exactly once, when bootstrapping the state. | ||||
func InsertProtocolVersion(version uint) func(*badger.Txn) error { | ||||
return insert(makePrefix(codeProtocolVersion), version) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel we should also Deprecate the corresponding storage code:
|
||||
} | ||||
|
||||
// RetrieveProtocolVersion retrieves the protocol version for the present spork. | ||||
func RetrieveProtocolVersion(version *uint) func(*badger.Txn) error { | ||||
return retrieve(makePrefix(codeProtocolVersion), version) | ||||
} |
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.
Should we replicate protocol state version here, or omit this field?
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.
At the moment, we are using the protocol state synonymously with the version of the protocol, so it might be useful to report it here.
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 think we should keep it and have it use the protocol state version. We should also include all other important versions here as well (e.g. execution engine version)
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.
regarding the already-existing
ProtocolVersion
, was just hoping to confirm: a version change from 37 (old versioning scheme) to 2 (new scheme) would be fine?