-
Notifications
You must be signed in to change notification settings - Fork 674
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
Use subnet public key diffs after Etna is activated #3502
Use subnet public key diffs after Etna is activated #3502
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.
just a nit
if !s.upgrades.IsEtnaActivated(s.persistedTimestamp) && s.upgrades.IsEtnaActivated(s.timestamp) { | ||
if err := database.PutUInt64(s.singletonDB, EtnaHeightKey, height); err != nil { | ||
return fmt.Errorf("failed to write etna height: %w", err) |
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.
nit: should we check if we have already written it? In case where we can call the commit without advancing the chain (like disconnect?).
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.
persistedTimestamp
is updated to equal timestamp
immediately after this, and both of them are monotonically increasing. So this condition can only happen once.
…va-labs/avalanchego into use-subnet-public-key-diffs-after-etna
Why this should be merged
When existing networks upgrade from Pre-Etna to Post-Etna, the nodes in that network are only guaranteed to have populated the public key diffs for subnets after the transition.
This means that we can only safely use this new index after Etna has been activated.
However, we must use the new index after Etna is activated because the public keys are not guaranteed to be inherited from the primary network after Etna.
How this works
Uses the new public key diffs after Etna is activated (but not before).
How this was tested
Added multiple new unit tests.
Need to be documented in RELEASES.md?
There are no user facing changes.