Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate script challenge on the ledger #6344

Merged
merged 6 commits into from
May 20, 2024

Conversation

brianp
Copy link
Contributor

@brianp brianp commented May 16, 2024

Description

This generates the entire challenge for the script signature on the ledger.
Move signature signing functions into respective handler files.
Move hash domains into the hashing file.

Motivation and Context

The total payload size is smaller than before, and can now be done in a single message. With no batching needed I've removed the script signature context struct on the ledger side to reduce complexity, remove persisted state, and free up a bit of memory.

How Has This Been Tested?

Manually with new wallets

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

@brianp brianp requested a review from a team as a code owner May 16, 2024 23:17
@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels May 16, 2024
Copy link

github-actions bot commented May 16, 2024

Test Results (CI)

    3 files    120 suites   36m 0s ⏱️
1 280 tests 1 280 ✅ 0 💤 0 ❌
3 832 runs  3 832 ✅ 0 💤 0 ❌

Results for commit d5c9a62.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 16, 2024

Test Results (Integration tests)

 2 files  11 suites   22m 50s ⏱️
33 tests 32 ✅ 0 💤 1 ❌
34 runs  33 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit d5c9a62.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@hansieodendaal hansieodendaal left a comment

Choose a reason for hiding this comment

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

Looking nice, just a couple of comments

Copy link
Collaborator

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

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

This looks good, see if you can move the hashing to the hashing crate and that it still works.

I don't know if you want to leave the optimizations of the data types to a later pr?
We probably need to optimize all of them not just the script signature data

applications/minotari_ledger_wallet/wallet/src/hashing.rs Outdated Show resolved Hide resolved
brianp added 6 commits May 17, 2024 12:20
Make the script signature function a single payload function. We're
passing less data, and the previous multi function format wasn't as
clean as the metadata signature. Back down to one function call is more
ideal.
@brianp brianp force-pushed the refactor-script-signature branch from d42c801 to d5c9a62 Compare May 17, 2024 19:34
@brianp
Copy link
Contributor Author

brianp commented May 17, 2024

Moved the hash domains into hashing/src/. This does require making that create a no_std but that wasn't so difficult.

I looked at using rand_core instead of ledger's random impl, but it's not no_std friendly.

I'll save the byte optimizations for another PR.

@hansieodendaal
Copy link
Contributor

@brianp, please see the comment about the u64 random^

@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label May 20, 2024
@SWvheerden SWvheerden merged commit 34db82d into tari-project:development May 20, 2024
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants