Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

add unique indexes to votes / delegates #101

Merged
merged 1 commit into from Aug 21, 2018
Merged

add unique indexes to votes / delegates #101

merged 1 commit into from Aug 21, 2018

Conversation

dafty
Copy link
Contributor

@dafty dafty commented Aug 21, 2018

votes and delegates do not contain unique indexes, meaning a bad restore can contain duplicate entries, affecting the forging order.

The votes_uniq does allow multiple votes per transaction (although application logic would prevent this in Ark) in order for v1 bridgechains that have allowed more than one vote per transaction to continue functioning, while still providing protection against duplications.

To enforce a single vote per transaction, but at risk of breaking other chains, then the index should be changed to:

CREATE INDEX IF NOT EXISTS "votes_uniq" ON votes ("transactionId");

@faustbrian faustbrian merged commit 8d69254 into ArkEcosystemArchive:mainnet-dev Aug 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants