Skip to content

Fix ledger_viz.py and split_ledger.py for COSE-only ledgers#7868

Open
Copilot wants to merge 11 commits intomainfrom
copilot/fix-cose-only-signing-issue
Open

Fix ledger_viz.py and split_ledger.py for COSE-only ledgers#7868
Copilot wants to merge 11 commits intomainfrom
copilot/fix-cose-only-signing-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

*UPD. I did a lot than this locally, but the idea holds

  • Fix python/src/ccf/ledger_viz.py to detect signatures in public:ccf.internal.cose_signatures
  • Fix python/src/ccf/split_ledger.py to recognise COSE-only signatures (both for splitting at a sig seqno and looking for the next signature)
  • Make split_all_ledger_files_in_dir (test infra) recognise COSE-only signature tables
  • Add an offline run_ledger_viz_test that calls ccf.ledger_viz.visualise() in-process on a checked-in Dual->COSE upgraded ledger and matches against a golden output file
  • Add an offline run_split_ledger_test that runs split_ledger on the same checked-in ledger and verifies the result still reads cleanly
  • Update CHANGELOG.md

Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/57569acb-add7-4ca7-a68f-63c35d9f5f62

Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Comment thread python/src/ccf/ledger_viz.py Outdated
Comment thread python/src/ccf/ledger_viz.py Outdated
Comment thread python/src/ccf/ledger_viz.py
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/4a1b51ee-47fa-4600-be59-305962f4f3c0

Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Comment thread tests/e2e_operations.py Outdated
Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/3e219460-4cef-42e9-a66f-115fdcc79b23

Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Comment thread CHANGELOG.md Outdated
Copilot AI requested a review from maxtropets May 8, 2026 14:35
@maxtropets maxtropets changed the title Fix ledger_viz.py to color COSE-only signed ledgers Fix ledger_viz.py and split_ledger.py for COSE-only ledgers May 8, 2026
@maxtropets maxtropets marked this pull request as ready for review May 8, 2026 14:44
@maxtropets maxtropets requested a review from a team as a code owner May 8, 2026 14:44
Copilot AI review requested due to automatic review settings May 8, 2026 14:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_viz and split_ledger to treat transactions containing COSE_SIGNATURE_TX_TABLE_NAME as signature transactions.
  • Update test infra ledger-splitting logic and add offline tests to validate ledger_viz output and split_ledger behavior 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 thread CHANGELOG.md
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).

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.

3 participants