-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat: contract acceptance signatures are submitted and validated #4269
Conversation
There was a problem hiding this 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
base_layer/core/src/validation/dan_validators/acceptance_validator.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
applications/tari_validator_node/src/grpc/services/base_node_client.rs
Outdated
Show resolved
Hide resolved
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
Description
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.get_current_contract_outputs
inBaseNodeClient
now returnUtxoMinedInfo
objects. Needed for retrieving thecommitment
of the contract constitution, used in the acceptance signatureMotivation 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?