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: add metadata signature check #5411

Merged

Conversation

hansieodendaal
Copy link
Contributor

Description

Added metadata signature check when verifying the revealed value proofs, just to be sure that the basis of the balance calculation check will have integrity.

Motivation and Context

See above.

How Has This Been Tested?

Added a new unit test.

What process can a PR reviewer use to test or verify this change?

Inspection

Breaking Changes

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

Added metadata signature check when verifying the revealed value proofs,
just to be sure that the basis of the balance calculation check will have
integrity.
@AaronFeickert
Copy link
Collaborator

This supersedes #5412, which merely adds scary warning comments about verification.

@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 25, 2023
assert!(output.verify_metadata_signature().is_ok());
assert!(output.revealed_value_range_proof_check().is_ok());

output.features.maturity += 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this overflow and fail the test? I know we've seen this elsewhere in tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the test, it does not matter if it overflows, as long as it is changed, so that the features committed to in the metadata signature is different.

Copy link
Collaborator

@AaronFeickert AaronFeickert May 25, 2023

Choose a reason for hiding this comment

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

Right, I had been concerned that an overflow could panic and intermittently fail the test, depending on how the value was originally set. Looks like it's originally set to zero, so this can't happen. I'd do output.features.maturity = 1 instead anyway; seems more elegant!

@github-actions
Copy link

github-actions bot commented May 25, 2023

Test Results (CI)

1 148 tests  +1   1 148 ✔️ +1   10m 6s ⏱️ -7s
     37 suites ±0          0 💤 ±0 
       1 files   ±0          0 ±0 

Results for commit eb3ae1f. ± Comparison against base commit ff7fb6d.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 25, 2023

Test Results (Integration tests)

  2 files  ±0  12 suites  ±0   16m 11s ⏱️ - 9m 48s
29 tests ±0  29 ✔️ +2  0 💤 ±0  0  - 2 
29 runs   - 2  29 ✔️ ±0  0 💤 ±0  0  - 2 

Results for commit eb3ae1f. ± Comparison against base commit ff7fb6d.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@AaronFeickert AaronFeickert left a comment

Choose a reason for hiding this comment

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

utACK

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.

Ack

@SWvheerden SWvheerden merged commit 9c2bf41 into tari-project:development May 26, 2023
@hansieodendaal hansieodendaal deleted the ho_add_metadata_sg_check branch May 26, 2023 07:04
SWvheerden added a commit that referenced this pull request May 29, 2023
##
[0.50.0-pre.2](v0.50.0-pre.1...v0.50.0-pre.2)
(2023-05-29)

### ⚠ BREAKING CHANGES

* add optional range proof types (5372)

### Features

* add metadata signature check
([5411](#5411))
([9c2bf41](9c2bf41))
* add optional range proof types
([5372](#5372))
([f24784f](f24784f))
* added burn feature to the console wallet
([5322](#5322))
([45685b9](45685b9))
* improved base node monitoring
([5390](#5390))
([c704890](c704890))


### Bug Fixes

* **comms:** only set final forward address if configured to port 0
([5406](#5406))
([ff7fb6d](ff7fb6d))
* deeplink to rfc spec
([5342](#5342))
([806d3b8](806d3b8))
* don't use in memory datastores for chat client dht in integration
tests ([#5399](#5399))
([cbdca6f](cbdca6f))
* fix panic when no public addresses
([5367](#5367))
([49be2a2](49be2a2))
* loop on mismatched passphrase entry
([5396](#5396))
([ed120b2](ed120b2))
* use domain separation for wallet message signing
([5400](#5400))
([7d71f8b](7d71f8b))
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 P-reviews_required Process - Requires a review from a lead maintainer to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants