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

Make contract confirmation index NOT NULL #142

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

chris124567
Copy link
Member

@chris124567 chris124567 commented Nov 19, 2024

Unlike with proofs or resolutions, a contract is guaranteed to be confirmed once it is in the database. Previously this data was stored as nullable to make it convenient to update alongside resolution index / resolution transaction ID in updateFileContractIndices/updateV2FileContractIndices. We also split the the chain index into separate fields, i.e.

-- excerpted from `last_contract_revision` / `v2_last_contract_revision`
    confirmation_height BLOB NOT NULL,
    confirmation_block_id BLOB NOT NULL REFERENCES blocks(id) ON DELETE CASCADE,

So that we can have a direct reference to the block.

Note: Base of this branch is v2 to avoid complicated rebasing once that's merged but it's not really a v2 feature so I don't think it needs to be merged into there.

@chris124567 chris124567 marked this pull request as ready for review November 21, 2024 19:01
Base automatically changed from v2 to master November 21, 2024 19:15
@n8maninger n8maninger force-pushed the make-confirmation-index-notnullable branch from 3880f3b to c34649d Compare November 21, 2024 19:15
@n8maninger n8maninger merged commit 7c8df8e into master Nov 21, 2024
8 checks passed
@n8maninger n8maninger deleted the make-confirmation-index-notnullable branch November 21, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants