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

Restrict "prev" test to just the voting path, to allow catchup. #4198

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

graydon
Copy link
Contributor

@graydon graydon commented Feb 16, 2024

This slightly weakens the conditions on which we judge a soroban-era upgrade invalid. It is motivated by bug #4193 in which a ledger that was voted-on in the past as a valid protocol-upgrade ledger, by a node with soroban prev compiled-in, becomes no longer replayable during catchup by a node without soroban prev compiled-in.

This only applies to soroban-era stuff, so without loss of generality we can talk about his only applying to the v20->v21 upgrade (it also applies to v21->v22 and so forth but that's even less relevant currently).

  • Before this change, a node lacking a prev build will judge a v20->v21 upgrade invalid for voting or applying during catchup.

  • With this change, a node lacking a prev build will judge a v20->v21 upgrade invalid for voting-on only.

This is accomplished by moving a conditional from Upgrades::isValidForApply (which is called by both Upgrades::isValid as well as LedgerManagerImpl::closeLedger) to its voting-phase caller Upgrades::isValid.

While this does technically "change the protocol" in terms of the semantics of a given ledger -- some previously-invalid ledgers are now valid -- it does so in a very limited way that I believe does not pose any risk in the real world. Specifically: no builds currently in the field claim to support v21 yet at all, so all currently-deployed core builds will already judge all such upgrades invalid on the basis of their protocol number, regardless of prev-presence. So long as this change is made before we release anything claiming to speak v21, there should be no observable change to behaviour.

(I also added a bit more commentary to the code exploring what will happen to nodes that fail to satisfy the conditional, but get forced to accept the upgrade by a majority, which I think are actually not in a particularly bad position.)

I'd appreciate folks who know about this subsystem and set of conditions reasoning through the logic I'm presenting here for themselves and confirming that it makes sense!

Resolves #4193

src/herder/Upgrades.cpp Outdated Show resolved Hide resolved
@dmkozh
Copy link
Contributor

dmkozh commented Feb 21, 2024

r+ 6a33a51

latobarita added a commit that referenced this pull request Feb 21, 2024
…voting

Restrict "prev" test to just the voting path, to allow catchup.

Reviewed-by: dmkozh
@graydon graydon force-pushed the bug-4193-restrict-prev-test-to-voting branch from 6a33a51 to bd01b44 Compare February 21, 2024 22:39
@dmkozh
Copy link
Contributor

dmkozh commented Feb 21, 2024

r+ bd01b44

@latobarita latobarita merged commit e4992c7 into master Feb 21, 2024
15 checks passed
@MonsieurNicolas MonsieurNicolas deleted the bug-4193-restrict-prev-test-to-voting branch February 27, 2024 18:17
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.

Protocol upgrades after v20 must have the prev env build enabled
4 participants