Skip to content

Commit

Permalink
CORE-19840 Make pub_key_hash part of PK for signature table (#1631)
Browse files Browse the repository at this point in the history
Remove `signature_idx` column and use `pub_key_hash` in the primary key
instead, which simplifies the insert and `ON CONFLICT` logic, while
ensuring that we don't have issues when storing a filtered transaction
followed by a signed transaction for the same transaction id.
  • Loading branch information
lankydan authored May 3, 2024
1 parent c8de996 commit 4a16ec9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"type": "string",
"doc": "The transaction ID, derived from the root hash of its Merkle tree"
},
{
"name": "startingIndex",
"type": "int",
"doc": "The index to insert the new signatures from"
},
{
"name": "signatures",
"type": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
<column name="transaction_id"/>
</createIndex>

<dropPrimaryKey constraintName="utxo_transaction_signature_pkey"
dropIndex="true"
tableName="utxo_transaction_signature"
/>

<addPrimaryKey columnNames="transaction_id, pub_key_hash"
constraintName="utxo_transaction_signature_pkey"
tableName="utxo_transaction_signature"
/>

<dropColumn columnName="signature_idx" tableName="utxo_transaction_signature"/>

</changeSet>

</databaseChangeLog>
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cordaProductVersion = 5.3.0
# NOTE: update this each time this module contains a breaking change
## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
## a per module property in which case module versions can change independently.
cordaApiRevision = 12
cordaApiRevision = 13

# Main
kotlin.stdlib.default.dependency = false
Expand Down

0 comments on commit 4a16ec9

Please sign in to comment.