Backport 6.x: On recovery, set UVM descriptor SVN to min(existing, new)#7730
Merged
achamayou merged 4 commits intorelease/6.xfrom Mar 10, 2026
Merged
Conversation
…existing KV value and startup endorsements Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Backport changes from PR #7717 to release/6.x
Backport #7717 to release/6.x: On recovery, set UVM descriptor SVN to min(existing, new)
Mar 9, 2026
Collaborator
|
@copilot add ccf::crypto::openssl_sha256_init(); and shutdown to the internal_access test main() |
Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Contributor
Author
Done in 981987e. Changed |
achamayou
approved these changes
Mar 10, 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.
internal_tables_access_testunit testparse_svndeclarationparse_svnutility functionrecoveringparam totrust_node_uvm_endorsementsrecoveringtotrust_node_uvm_endorsementsrun_initial_uvm_descriptor_checksto bump SVN before recoveryOriginal prompt
Backport of PR #7717 to
release/6.xThis is a backport of #7717 (merged into
mainon 2026-03-06, merge commit5a41a9519f2aa1d86fbda85191dc262e97ed3f46).Original PR Description
During recovery, the node was unconditionally overwriting the UVM descriptor SVN with the value from the new node's endorsements. This could raise the SVN above what was previously stored, which is incorrect — recovery should never increase the SVN.
Changes to backport
The following files were changed in #7717 and need to be cherry-picked / applied to the
release/6.xbranch:CHANGELOG.md— Add changelog entry: "On recovery, the UVM descriptor SVN is now set to the minimum of the previously stored value in the KV and the value found in the new node's startup endorsements. On start, the behaviour is unchanged (On Recovery, the node must set the UVM descriptor SVN to the minimum of the current value in the KV and the one found in startup endorsements #7716)."CMakeLists.txt— Add the newinternal_tables_access_testunit test:src/node/uvm_endorsements.h— Add declaration for the newparse_svnutility function:src/node/uvm_endorsements.cpp— Extract aparse_svnutility function that parses an SVN string tosize_t, and refactormatches_uvm_roots_of_trustto use it instead of inlinestd::from_charscalls. The new function:src/service/internal_tables_access.h—trust_node_uvm_endorsementsnow accepts abool recoveringparameter. Whenrecoveringis true, it reads the existing SVN from the KV for the same DID/feed and writesmin(existing, new)usingparse_svn. The feed entry is merged into the existing map for the DID, preserving other feeds rather than overwriting the entire map. Achangedboolean tracks whether the map was actually modified. The KV write is skipped when nothing changed. Whenrecoveringis false, the original behavior is preserved.src/node/rpc/node_frontend.h— Passrecovering(already computed in the/createhandler) totrust_node_uvm_endorsements:InternalTablesAccess::trust_node_uvm_endorsements( ctx.tx, in.snp_uvm_endorsements, recovering);src/node/rpc/test/internal_tables_access_test.cpp— New unit test file with 5 test cases covering:tests/e2e_operations.py— Inrun_initial_uvm_descriptor_checks, after starting the network, fetch the current join policy to get UVM endorsement values, bump the SVN by 10, and propose the bumped UVM endorsement before stopping the network. This ensures recovery will encounter a higher SVN and must correctly use the minimum.Instructions
release/6.x.5a41a9519f2aa1d86fbda85191dc262e97ed3f46first. If that doesn't apply cleanly, manually apply the equivalent changes to each file listed above, adapting to any differences in therelease/6.xbranch.main).release/6.xcodebase.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Backport #7717 into release/6.x branch as a separate PR
Assistant:
Let me first look at the details of PR #7717 to understand what needs to be backported.
Assistant: I need to find the repository for PR #7717. Let me search for it.
Assistant: I need to find which repository PR #7717 belongs to. Let me search for it.
Assistant: I need to find the repository that contains PR #7717. Let me look at your repositories to identify the correct one.
Assistant: I need to find which repository PR #7717 belongs to. Could you please tell me the repository (in
owner/repoformat) where PR #7717 exists? That way I can look it up and create the backport PR to therelease/6.xbranch.User: CCF repository https://github.com/microsoft/CCF/
Assistant: Now I have all the details about PR #7717. Let me create the backport PR tar...
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.