Finality flow verifies transaction signatures twice

Description

The transaction verification logic in FinalityFlow results in transaction signatures being cryptographically verified twice (if notarisation is required). Snippet from FinalityFlow:

1 2 3 4 5 6 7 8 9 private fun verifyTx(): LedgerTransaction { logger.info("Verifying in finality flow") val notary = transaction.tx.notary // The notary signature(s) are allowed to be missing but no others. if (notary != null) transaction.verifySignaturesExcept(notary.owningKey) else transaction.verifyRequiredSignatures() val ltx = transaction.toLedgerTransaction(serviceHub, false) ltx.verify() return ltx }

The culprit is SignedTransaction.toLedgerTransaction, which automatically verifies all attached signatures before resolving a LedgerTransaction. That does make sense from a safety perspective but trades off on performance.

Status

Assignee

Unassigned

Reporter

Andrius Dagys

Labels

None

Priority

Low

Fix versions

Ported to...

None

Feature Team

Kernel Group

Severity

Low

Affects versions

Corda 4.1
Configure