Skip to content

Make a SDK use_case for w3c#975

Open
fbeutin-ledger wants to merge 1 commit into
developfrom
fbe/extract_w3c
Open

Make a SDK use_case for w3c#975
fbeutin-ledger wants to merge 1 commit into
developfrom
fbe/extract_w3c

Conversation

@fbeutin-ledger
Copy link
Copy Markdown
Contributor

Description

Make a SDK use_case for w3c

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Tests
  • Documentation
  • Other (for changes that might not fit in any category)

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.04%. Comparing base (fd46d04) to head (d15728b).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #975   +/-   ##
========================================
  Coverage    56.04%   56.04%           
========================================
  Files           26       26           
  Lines         2414     2414           
  Branches       323      314    -9     
========================================
  Hits          1353     1353           
+ Misses        1057      984   -73     
- Partials         4       77   +73     
Flag Coverage Δ
unittests 56.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

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 introduces a new SDK-style TLV “use-case” parser for the Web3 Check (W3C) transaction simulation descriptor and refactors the existing transaction-simulation APDU handling to delegate parsing + PKI signature verification to this shared helper.

Changes:

  • Added tlv_use_case_w3c_check (C/H) implementing W3C TLV parsing, structural validation, and PKI signature verification.
  • Refactored cmd_get_tx_simulation to call the new use-case and map its output into the existing Ethereum-specific TX_SIMULATION struct.
  • Updated tx-simulation types/constants to be backward-compatible aliases of the new W3C SDK types.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/features/provide_tx_simulation/tlv_use_case_w3c_check.h Declares W3C types, output struct, status codes, and the public parsing API.
src/features/provide_tx_simulation/tlv_use_case_w3c_check.c Implements tag handlers, progressive hashing, structural checks, and PKI signature verification for W3C TLV payloads.
src/features/provide_tx_simulation/cmd_get_tx_simulation.h Replaces legacy tx-simulation enums/sizes with aliases to the new W3C SDK definitions.
src/features/provide_tx_simulation/cmd_get_tx_simulation.c Removes bespoke TLV parsing/signature code and delegates to the new W3C use-case, then copies output into the legacy global struct.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/features/provide_tx_simulation/tlv_use_case_transaction_check.c Outdated
Comment thread src/features/provide_tx_simulation/cmd_get_tx_simulation.c Outdated
Comment thread src/features/provide_tx_simulation/cmd_get_tx_simulation.c Outdated
Comment thread src/features/provide_tx_simulation/tlv_use_case_w3c_check.h Outdated
Comment thread src/features/provide_tx_simulation/tlv_use_case_w3c_check.c Outdated
Comment thread src/features/provide_tx_simulation/tlv_use_case_w3c_check.c Outdated
@fbeutin-ledger fbeutin-ledger force-pushed the fbe/extract_w3c branch 3 times, most recently from e7d775d to 1fc2833 Compare April 1, 2026 12:25
@fbeutin-ledger fbeutin-ledger marked this pull request as ready for review April 1, 2026 12:26
Comment thread src/features/provide_tx_simulation/tlv_use_case_transaction_check.c Outdated
Comment thread src/features/provide_tx_simulation/tlv_use_case_transaction_check.h Outdated
Comment thread tests/ragger/test_tx_simulation.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

elf sizes
source = source branch fbe/extract_w3c
target = target branch develop

Device .text source .text target .text delta .bss source .bss target .bss delta max stack size source max stack size target max stack size delta
stax 180990 180478 512 21802 21794 8 15056 15064 -8
apex_p 160921 160409 512 21802 21794 8 19152 19160 -8
nanox 114003 114003 0 20520 20520 0 8192 8192 0
nanos2 114275 114275 0 20492 20492 0 20464 20464 0
flex 181069 180557 512 21802 21794 8 15056 15064 -8

Stack consumption summary (clone_app_stack_consumption)

⚠️ This summary is for informative purpose only. It may not give the application actual worst case, for example if the test coverage is low.

Device Worst case (bytes) Remaining stack (bytes) Test
apex_p 1753 38603 test_clone.py::test_clone_thundercore[apex_p]
flex 1801 34459 test_clone.py::test_clone_thundercore[flex]
nanosp 1705 38651 test_clone.py::test_clone_thundercore[nanosp]
nanox 1697 6495 test_clone.py::test_clone_thundercore[nanox]
stax 1801 34459 test_clone.py::test_clone_thundercore[stax]

Full details

Stack consumption summary

⚠️ This summary is for informative purpose only. It may not give the application actual worst case, for example if the test coverage is low.

Device Worst case (bytes) Remaining stack (bytes) Test
apex_p 3193 15959 test_eip712.py::test_eip712_batch[apex_p]
flex 3193 11863 test_eip712.py::test_eip712_batch[flex]
nanosp 3193 17271 test_eip712.py::test_eip712_batch[nanosp]
nanox 3193 4999 test_eip712.py::test_eip712_batch[nanox]
stax 3193 11863 test_eip712.py::test_eip712_batch[stax]

Full details

Copy link
Copy Markdown

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread src/features/provide_tx_simulation/cmd_get_tx_simulation.c Outdated
Comment thread src/features/provide_tx_simulation/cmd_get_tx_simulation.c Outdated
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.

4 participants