Skip to content

Conversation

@erykwalder
Copy link
Contributor

Spend TxInputs need to contain all of the data necessary to reconstruct
output ids in order to spend them. Performing the hashing during
validation gives us cryptographic integrity that the spent output data
is correct.

In order to preserve this data, the mapping process was updated to
return additional information which is stored in the account_utxos
table. This data is then populated in a SpendCommitment type on the
TxInput structs.

1.1-stable version of #665

control_program, confirmed_in, source_id, source_pos, ref_data_hash)
SELECT unnest($1::bytea[]), unnest($2::bigint[]), unnest($3::bytea[]), unnest($4::bytea[]), unnest($5::bigint[]),
unnest($6::text[]), unnest($7::bigint[]), unnest($8::bytea[]), $9
ON CONFLICT (tx_hash, index) DO NOTHING
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we lose the ON CONFLICT clause? It's still present in #665

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added below

@bobg
Copy link
Contributor

bobg commented Mar 2, 2017

LGTM

Spend TxInputs need to contain all of the data necessary to reconstruct
output ids in order to spend them. Performing the hashing during
validation gives us cryptographic integrity that the spent output data
is correct.

In order to preserve this data, the mapping process was updated to
return additional information which is stored in the account_utxos
table. This data is then populated in a SpendCommitment type on the
TxInput structs.
@iampogo iampogo force-pushed the 1.1-spent-output branch from 431cf42 to 6b5b4a6 Compare March 2, 2017 23:13
@iampogo iampogo merged commit 07519fd into 1.1-stable Mar 2, 2017
@iampogo iampogo deleted the 1.1-spent-output branch March 2, 2017 23:16
jeffomatic added a commit that referenced this pull request Mar 6, 2017
This accounts for updates affecting validation-critical hashing
in #665 (#677 in 1.1-stable).
iampogo pushed a commit that referenced this pull request Mar 6, 2017
This accounts for updates affecting validation-critical hashing
in #665 (#677 in 1.1-stable).
iampogo pushed a commit that referenced this pull request Mar 6, 2017
This accounts for updates affecting validation-critical hashing
in #665 (#677 in 1.1-stable).

Closes #703
jeffomatic added a commit that referenced this pull request Mar 6, 2017
This accounts for updates affecting validation-critical hashing
in #665 (#677 in 1.1-stable).

This is a 1.1-stable backport of #703.
iampogo pushed a commit that referenced this pull request Mar 6, 2017
This accounts for updates affecting validation-critical hashing
in #665 (#677 in 1.1-stable).

This is a 1.1-stable backport of #703.

Closes #704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants