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

fix(dan_layer/core): include state root in checkpoint signature #4285

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Jul 7, 2022

Description

  • includes the "real" state root in the checkpoint signature, replacing the zero state root.
  • makes fields in SignerSignature private
  • adds sign_checkpoint method to SigningService

Motivation and Context

Generates the state root for the pre-committed state and includes that in the checkpoint signatures on the commit step
instead of a dummy value for the state root.

BUG: the state root MMR only includes state updates for existing keys and does not include new keys. This was a pre-existing bug
TODO: Share a blinding factor seed between validators and derive checkpoint blinding factors. Currently, a zero commitment is included in the checkpoint signature and a random blinding factor generated by the VN wallet is used in the checkpoint output.

How Has This Been Tested?

Manually, signatures are included in the checkpoint

@aviator-app aviator-app bot merged commit bcaabf0 into tari-project:development Jul 7, 2022
@sdbondi sdbondi deleted the dan-layer-checkpoint-sig-complete branch July 7, 2022 13:49
jorgeantonio21 added a commit to jorgeantonio21/tari that referenced this pull request Jul 8, 2022
aviator-app bot pushed a commit that referenced this pull request Jul 12, 2022
Description
---
* New base layer validation of checkpoint signatures: verifies that ALL the signatures present in the checkpoint are valid
* Unified the error type for invalid signatures across all contract output types

Motivation and Context
---
The base layer needs to check if all the signatures in a checkpoint are valid.

This PR is based on previous work on checkpoints (see #4261  and #4285). The checkpoint signature is calculated as:
`e = H_1(signer_public_key || public_nonce || H_2(contract_id||commitment||merkle_root||checkpoint_number))`

But take into account that the `commitment` is still a mock value as of now we still don't have a method for creating a shared value.

How Has This Been Tested?
---
New unit test checks that invalid signatures are detected
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.

2 participants