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: transaction validation excess signature check #4314

Merged
merged 2 commits into from
Jul 20, 2022

Conversation

SWvheerden
Copy link
Collaborator

Description

Currently, only the transaction validator checks the rules that a transaction kernel must have a unique excess signature. But it only checks the first signature in the transaction. Transactions can have more than one kernel.
This check is also not currently checked in block validation checks.

This means that if a block with a duplicate excess signature is submitted, it will fail with an LMDB::error(duplicate key) and not with a validation error, although this is a validation constraint as per RFC 120.

Motivation and Context

We need to check the kernel excess signature for uniqueness because this ensures that every kernel in the blockchain is unique. By enforcing this, we ensure that replay attacks are impossible as the same kernel cannot be added to the blockchain again.

The excess signature is also used as a key index for the lookup of the kernels.

Ensures all validators check this
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 - we also have to check that duplicate kernel sigs are not in the current block. The DB should fail in that case, but the validator should have checked that before the DB layer.

@aviator-app aviator-app bot merged commit f6342a5 into tari-project:development Jul 20, 2022
@SWvheerden SWvheerden deleted the sw_fix_validation branch July 25, 2022 06:52
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