Skip to content
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

Draft
wants to merge 2 commits into
base: feature/efm-recovery
Choose a base branch
from

Conversation

jordanschalm
Copy link
Member

This PR removes the ProtocolVersion field from the protocol.Params structure.

This field is set to the major software version during a spork; it was intended to be a spork identifier that corresponded to the software version used for that spork. (For example, for version v0.38.x, the ProtocolVersion would be set to 38.)

As part of the Params structure, it does not change during the course of a spork. However, we commonly increment the major software within sporks now, so the ProtocolVersion may not actually reflect the major software version currently being run. Also, the naming collides with the new Protocol KVStore version field, which will be used to coordinate Protocol HCUs.

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.

Project coverage is 40.74%. Comparing base (0ac15d0) to head (c95fd0c).

Files with missing lines Patch % Lines
cmd/bootstrap/cmd/rootblock.go 25.00% 2 Missing and 1 partial ⚠️
cmd/scaffold.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/efm-recovery    #6955      +/-   ##
========================================================
- Coverage                 41.14%   40.74%   -0.41%     
========================================================
  Files                      2122     1977     -145     
  Lines                    187169   173120   -14049     
========================================================
- Hits                      77011    70534    -6477     
+ Misses                   103724    96789    -6935     
+ Partials                   6434     5797     -637     
Flag Coverage Δ
unittests 40.74% <42.85%> (-0.41%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +320 to 321
// TODO: should we replicate protocol state version here, or just remove this field?
ProtocolVersion uint64
Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Contributor

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)

Copy link
Member

@AlexHentschel AlexHentschel left a comment

Choose a reason for hiding this comment

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

I have no concerns with this PR, but I am also not really knowledgeable about the broader implications of removing this Version.

Just in case there are concerns with removing it, if we wanted to retain the old counter, I think a more refined description and documentation would be good: essentially we were tracking the spork counter, so we should name it accordingly.

flagRootParent string
flagRootHeight uint64
flagRootTimestamp string
// Deprecated: Replaced by ProtocolState KVStore version
Copy link
Member

Choose a reason for hiding this comment

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

following up on my suggestion for the previous PR #6953:

Suggested change
// Deprecated: Replaced by ProtocolState KVStore version
// Deprecated: Replaced by ProtocolStateVersion

// 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)
Copy link
Member

Choose a reason for hiding this comment

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

I feel we should also Deprecate the corresponding storage code:

codeProtocolVersion = 14

sc.nodeInfo.WithLabelValues(versionLabel, version)
sc.nodeInfo.WithLabelValues(commitLabel, commit)
sc.nodeInfo.WithLabelValues(sporkIDLabel, sporkID)
sc.nodeInfo.WithLabelValues(protocolVersionLabel, strconv.FormatUint(uint64(protocolVersion), 10))
Copy link
Contributor

Choose a reason for hiding this comment

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

@vishalchangrani do we use this for partner tracking, or just the version?

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, nm. this isn't related to the ping service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants