Repository navigation
Add a script for converting frozen ledger key settings to hex. - #5246
Merged
Merged
Conversation
Most systems use base64 XDR encoding, so chances are the keys to freeze will be base64. However, the settings update parser expects hex encoding for the bytes fields. Instead of making the parser more sophisticated and ambiguous (as hex is technically valid base64), just use a converter script.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a helper script under scripts/ to convert frozen-ledger-key settings JSON fields from base64-encoded XDR bytes to lowercase hex, intended to match the settings upgrade JSON parser’s expected encoding.
Changes:
- Introduces
scripts/frozen_keys_base64_to_hex.py, a CLI tool that scans a settings JSON document and rewrites selected key lists to hex in-place.
anupsdf
approved these changes
Apr 24, 2026
anupsdf
left a comment
Contributor
There was a problem hiding this comment.
Looks good. I tested locally and it works.
Only possible improvement could be to guard against re-runs i.e. make it idempotent
Contributor
Author
It already is, we check for 2 leading 0 bytes - these will never be present in base64, and always be present in hex for the LedgerKey XDR. |
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.
Description
Add a script for converting frozen ledger key settings to hex.
Most systems use base64 XDR encoding, so chances are the keys to freeze will be base64. However, the settings update parser expects hex encoding for the bytes fields. Instead of making the parser more sophisticated and ambiguous (as hex is technically valid base64), just use a converter script.
Checklist
clang-formatv8.0.0 (viamake formator the Visual Studio extension)