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: contract acceptance signatures are submitted and validated #4269

Merged
merged 17 commits into from
Jul 7, 2022

Conversation

mrnaveira
Copy link
Contributor

@mrnaveira mrnaveira commented Jul 6, 2022

Description

  • feat(base_layer): added contract acceptance signature validation
  • feat(dan_layer): created a new AcceptanceManager to centralize the creation, signing and submission of contract acceptances. It's used now both for manual and auto acceptances in the validator node.
  • refactor(dan_layer): the method get_current_contract_outputs in BaseNodeClient now return UtxoMinedInfo objects. Needed for retrieving the commitment of the contract constitution, used in the acceptance signature
  • refactor(integration_test): unifying of duplicated acceptance steps
  • fix(integration_test): some fixtures files and steps are outdated

Motivation and Context

Contract acceptances need to be signed by the validator node submitting them. Also, the base layer should validate that the signature is valid.

Similar to recent PRs, the acceptance signatures follow:
e = H_1(signer_public_key || public_nonce || H_2(contract_id||constitution_commitment))

How Has This Been Tested?

  • New unit test to check the base layer validation of acceptance signatures
  • For the validation node part, the existing integration test do not raise the signature error

Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

LGTM - if we can DRY up the signature challenge construction this is g2g

Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

Looking good and thanks for DRYing up the challenge construction!

The two calls get_contract_utxos and get_current_contract_outputs that are basically the same. I suggest that you use one of them and refactor to return UtxoMinedInfo

@aviator-app aviator-app bot merged commit 414be33 into tari-project:development Jul 7, 2022
@mrnaveira mrnaveira deleted the acceptance-signatures branch July 7, 2022 11:15
aviator-app bot pushed a commit that referenced this pull request Jul 13, 2022
Description
---
* feat(base_layer): added proposal acceptance signature validation
* refactor(base_layer): DRYing the check of proposal in transaction outputs with a new `output_contains_proposal` function
* feat(dan_layer): `AcceptanceManager` now also publishes update proposals, and with the correct signature
* fix(integration_test): `proposal_id` value in fixtures is not consistent

Motivation and Context
---
Proposal acceptances need to be signed by the validator node submitting them. Also, the base layer should validate that the signature is valid.

Similar to [recent PRs](#4269), the proposal acceptance signatures follow:
`e = H_1(signer_public_key || public_nonce || H_2(contract_id||proposal_id||proposal_commitment))`

How Has This Been Tested?
---
* New unit test to check the base layer validation of proposal acceptance signatures
* For the validation node part, the existing integration test do not raise the signature error
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.

3 participants