Fix kStructurallyValidValue validation downgrade after reboot#5348
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a restart-related SCP validation bug where a value that is structurally valid (but references a missing/invalid tx set) could be reclassified as invalid after reboot due to loss of in-memory tx set fetch state. The fix makes structural validity depend on protocol capability (empty-tx-set support) rather than tx set request/waiting-time state, and adds a regression test covering SCP state restore with a missing tx set.
Changes:
- Update
HerderSCPDriver::validateValueAgainstLocalStateso missing tx sets are treated askStructurallyValidValuewhenever the protocol supports empty-tx-set values (instead of depending on tx set fetch waiting-time state). - Clarify the comment in
BallotProtocol::maybeReplaceValueWithEmptyTxSetabout why values without an active download wait can be converted to empty-tx-set values. - Add a new herder test that persists SCP state referencing a fake/missing tx set, restarts, and verifies the node treats the value as structurally valid and can advance by switching to the empty-tx-set value.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/scp/BallotProtocol.cpp | Clarifies rationale when replacing a structurally-valid-but-unavailable value with an empty-tx-set value. |
| src/herder/HerderSCPDriver.cpp | Removes dependence on tx set fetch waiting-time state when determining structural validity for missing tx sets. |
| src/herder/test/HerderTests.cpp | Adds regression coverage for SCP state restore when a referenced tx set is missing after restart. |
marta-lokhova
previously approved these changes
Jul 23, 2026
Closes stellar#5339. Fixes a bug by which values that were considered "structurally valid" could be downgraded to "invalid" on a reboot due to the loss of the in-memory state tracking of whether transaction sets were requested or not. The solution is simple: value validation should not depend on tx set request status. That is, whether a value is "structurally valid" or "invalid" should not change based on whether the node has requested a referenced transaction set or not.
marta-lokhova
approved these changes
Jul 23, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Jul 23, 2026
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.
Closes #5339.
Fixes a bug by which values that were considered "structurally valid" could be downgraded to "invalid" on a reboot due to the loss of the in-memory state tracking of whether transaction sets were requested or not.
The solution is simple: value validation should not depend on tx set request status. That is, whether a value is "structurally valid" or "invalid" should not change based on whether the node has requested a referenced transaction set or not.