Fix ledger_viz.py and split_ledger.py for COSE-only ledgers#7868
Open
Fix ledger_viz.py and split_ledger.py for COSE-only ledgers#7868
Conversation
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/57569acb-add7-4ca7-a68f-63c35d9f5f62 Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
maxtropets
May 7, 2026 14:52
View session
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/56ebc23a-9b1a-46c3-93da-308d29085c27 Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
maxtropets
reviewed
May 8, 2026
maxtropets
reviewed
May 8, 2026
maxtropets
reviewed
May 8, 2026
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/4a1b51ee-47fa-4600-be59-305962f4f3c0 Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
maxtropets
reviewed
May 8, 2026
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/3e219460-4cef-42e9-a66f-115fdcc79b23 Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
…com/microsoft/CCF into copilot/fix-cose-only-signing-issue
maxtropets
reviewed
May 8, 2026
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/868bb45d-f7d8-4dc6-ba50-8244ca355a64 Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Python ledger tooling and test infrastructure to correctly detect signature transactions in COSE-only ledgers (where signatures are recorded in public:ccf.internal.cose_signatures), and adds offline regression tests using checked-in upgraded-ledger testdata.
Changes:
- Teach
ledger_vizandsplit_ledgerto treat transactions containingCOSE_SIGNATURE_TX_TABLE_NAMEas signature transactions. - Update test infra ledger-splitting logic and add offline tests to validate
ledger_vizoutput andsplit_ledgerbehavior on a Dual→COSE upgraded ledger. - Add a CHANGELOG entry for the fix.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md.github/instructions/changelog.instructions.md
Reviewed changes
Copilot reviewed 5 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
python/src/ccf/ledger_viz.py |
Refactors iteration into visualise() and classifies COSE signature txs as “Signature”. |
python/src/ccf/split_ledger.py |
Recognises COSE signature txs both when splitting at a sig seqno and when searching for the next signature. |
tests/e2e_operations.py |
Updates signature detection for splitting and adds offline regression tests for ledger_viz + split_ledger. |
tests/testdata/cose_upgraded_service/expected_viz.txt |
Adds golden output for the offline ledger_viz regression test. |
tests/testdata/cose_upgraded_service/snapshots/.gitkeep |
Keeps the snapshots directory present in the checked-in testdata. |
CHANGELOG.md |
Documents the fix (but currently introduces a duplicate “Fixed” heading under 7.0.3). |
Comment on lines
+20
to
+23
| ### Fixed | ||
|
|
||
| - `ledger_viz` and `split_ledger` now recognise signature transactions in COSE-only signed ledgers (recorded in `public:ccf.internal.cose_signatures`) (#7868). | ||
|
|
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.
*UPD. I did a lot than this locally, but the idea holds
python/src/ccf/ledger_viz.pyto detect signatures inpublic:ccf.internal.cose_signaturespython/src/ccf/split_ledger.pyto recognise COSE-only signatures (both for splitting at a sig seqno and looking for the next signature)split_all_ledger_files_in_dir(test infra) recognise COSE-only signature tablesrun_ledger_viz_testthat callsccf.ledger_viz.visualise()in-process on a checked-in Dual->COSE upgraded ledger and matches against a golden output filerun_split_ledger_testthat runssplit_ledgeron the same checked-in ledger and verifies the result still reads cleanly