Skip to content

Conversation

felipemadero
Copy link
Contributor

Why this should be merged

The previous buffer size calculation incorrectly assumed signing and change paths were stored separately in the ledger buffer. However, the ledger library deduplicates these paths, and the buffer format includes a 1-byte path count prefix. This fixes the calculation to accurately reflect the actual buffer usage.

How this works

How this was tested

Need to be documented in RELEASES.md?

The previous buffer size calculation incorrectly assumed signing and change paths were stored separately in the ledger buffer. However, the ledger library deduplicates these paths, and the buffer format includes a 1-byte path count prefix. This fixes the calculation to accurately reflect the actual buffer usage.
@Copilot Copilot AI review requested due to automatic review settings October 1, 2025 14:51
Copy link
Contributor

@Copilot 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 fixes a bug in the ledger buffer size calculation for the Sign function. The previous implementation incorrectly calculated buffer usage by assuming signing and change paths were stored separately, when in fact the ledger library deduplicates these paths.

  • Fixed buffer size calculation to account for path deduplication and proper buffer format
  • Added comprehensive documentation explaining ledger buffer limits and device compatibility
  • Updated comments to reference the correct ledger library implementation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

felipemadero and others added 4 commits October 1, 2025 13:48
Adds documentation explaining that ledgerPathSize (9 bytes) matches the serialized format produced by SerializePathSuffix in the ledger library: 1 byte for component count + 4 bytes per component for a 2-component path suffix like "0/123".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants