TransactionBody's ID() method makes use of MakeID() function that calls Fingerprint()under the hood to hash data structure.
Fingerprint() is implemented on TransactionBody without capturing all necessary fields. The number of usages of this type is huge. We have to fix the Fingerprint() function, review the dependent code and tests, and make sure we did not break anything
Problem description
TransactionBody
'sID()
method makes use ofMakeID()
function that callsFingerprint()
under the hood to hash data structure.Fingerprint()
is implemented onTransactionBody
without capturing all necessary fields. The number of usages of this type is huge. We have to fix theFingerprint()
function, review the dependent code and tests, and make sure we did not break anythinghttps://github.com/onflow/flow-go/blob/edf27b03b6f809ce66cacd607a41b889c12cd2b3/model/flow/transaction.go#L13-L49 https://github.com/onflow/flow-go/blob/edf27b03b6f809ce66cacd607a41b889c12cd2b3/model/flow/transaction.go#L96-L102 https://github.com/onflow/flow-go/blob/edf27b03b6f809ce66cacd607a41b889c12cd2b3/model/flow/transaction.go#L56-L66
Proposed solution
Fix
Fingerprint()
function so that it covers all fields of a transaction body