-
Notifications
You must be signed in to change notification settings - Fork 97
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
types migration #2478
Draft
imabdulbasit
wants to merge
32
commits into
main
Choose a base branch
from
ab/leaf2-migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,842
−854
Draft
types migration #2478
Changes from 10 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
7ac8ec9
consensus storage migration
imabdulbasit d58bb1d
fix migrations and commit transaction after batch insert
imabdulbasit d1dd38e
sqlite migration fixes and fix deserialization errors
imabdulbasit dbecff3
test
imabdulbasit 27ab511
fs migration
imabdulbasit 471f7ca
fix queries and tests
imabdulbasit 00d48b5
merge main
imabdulbasit ff3d533
sequencer sqlite lock file
imabdulbasit c573ea6
fix postgres epoch migration
imabdulbasit 5802184
fix undecided_state2 migration
imabdulbasit 3885e21
bincode deserialize for migrated hashset
imabdulbasit 2d75307
Merge remote-tracking branch 'origin/main' into ab/leaf2-migration
imabdulbasit 0152568
query service leaf2 migration
imabdulbasit 28063b6
Merge branch 'main' into ab/leaf2-migration
imabdulbasit 9b80a9a
fix quorum proposal migration and storage
imabdulbasit 4745aa6
fix fetching
imabdulbasit a84549d
fix leaf from proposal
imabdulbasit a6df3db
fix import
imabdulbasit 946cd78
fix test_fetching_providers
imabdulbasit 270bf0b
use TestVersions from hotshot-example-types
imabdulbasit bc74fd8
Merge branch 'main' into ab/leaf2-migration
imabdulbasit f0e9b41
fix migration completed check
imabdulbasit f0f9f49
call v2 methods
imabdulbasit d8485e2
Merge remote-tracking branch 'origin/main' into ab/leaf2-migration
imabdulbasit 26fbdad
fix VID errors
imabdulbasit c01b8bf
lint
imabdulbasit ab4013d
cargo sort
imabdulbasit 3b42047
fix recursion
imabdulbasit d8d460c
v0 and v1 availability modules
imabdulbasit e56475f
Merge branch 'main' into ab/leaf2-migration
imabdulbasit 8fe27d1
cargo sort
imabdulbasit 04dbac0
fix tests
imabdulbasit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
CREATE TABLE anchor_leaf2 ( | ||
view BIGINT PRIMARY KEY, | ||
leaf BYTEA, | ||
qc BYTEA | ||
); | ||
|
||
|
||
CREATE TABLE da_proposal2 ( | ||
view BIGINT PRIMARY KEY, | ||
payload_hash VARCHAR, | ||
data BYTEA | ||
); | ||
|
||
CREATE TABLE vid_share2 ( | ||
view BIGINT PRIMARY KEY, | ||
payload_hash VARCHAR, | ||
data BYTEA | ||
); | ||
|
||
|
||
CREATE TABLE undecided_state2 ( | ||
-- The ID is always set to 0. Setting it explicitly allows us to enforce with every insert or | ||
-- update that there is only a single entry in this table: the latest known state. | ||
id INT PRIMARY KEY, | ||
|
||
leaves BYTEA NOT NULL, | ||
state BYTEA NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE quorum_proposals2 ( | ||
view BIGINT PRIMARY KEY, | ||
leaf_hash VARCHAR, | ||
data BYTEA | ||
); | ||
|
||
CREATE UNIQUE INDEX quorum_proposals2_leaf_hash_idx ON quorum_proposals (leaf_hash); | ||
CREATE INDEX da_proposal2_payload_hash_idx ON da_proposal (payload_hash); | ||
CREATE INDEX vid_share2_payload_hash_idx ON vid_share (payload_hash); | ||
|
||
CREATE TABLE quorum_certificate2 ( | ||
view BIGINT PRIMARY KEY, | ||
leaf_hash VARCHAR NOT NULL, | ||
data BYTEA NOT NULL | ||
); | ||
|
||
CREATE INDEX quorum_certificate2_leaf_hash_idx ON quorum_certificate (leaf_hash); | ||
|
||
CREATE TABLE epoch_migration ( | ||
table_name TEXT PRIMARY KEY, | ||
completed bool DEFAULT FALSE | ||
); | ||
|
||
INSERT INTO epoch_migration (table_name) VALUES ('anchor_leaf'), ('da_proposal'), ('vid_share'), ('undecided_state'), ('quorum_proposals'), ('quorum_certificate'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
CREATE TABLE anchor_leaf2 ( | ||
view BIGINT PRIMARY KEY, | ||
leaf BLOB, | ||
qc BLOB | ||
); | ||
|
||
|
||
CREATE TABLE da_proposal2 ( | ||
view BIGINT PRIMARY KEY, | ||
payload_hash VARCHAR, | ||
data BLOB | ||
); | ||
|
||
CREATE TABLE vid_share2 ( | ||
view BIGINT PRIMARY KEY, | ||
payload_hash VARCHAR, | ||
data BLOB | ||
); | ||
|
||
|
||
CREATE TABLE undecided_state2 ( | ||
-- The ID is always set to 0. Setting it explicitly allows us to enforce with every insert or | ||
-- update that there is only a single entry in this table: the latest known state. | ||
id INT PRIMARY KEY, | ||
|
||
leaves BLOB NOT NULL, | ||
state BLOB NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE quorum_proposals2 ( | ||
view BIGINT PRIMARY KEY, | ||
leaf_hash VARCHAR, | ||
data BLOB | ||
); | ||
|
||
CREATE UNIQUE INDEX quorum_proposals2_leaf_hash_idx ON quorum_proposals (leaf_hash); | ||
CREATE INDEX da_proposal2_payload_hash_idx ON da_proposal (payload_hash); | ||
CREATE INDEX vid_share2_payload_hash_idx ON vid_share (payload_hash); | ||
|
||
CREATE TABLE quorum_certificate2 ( | ||
view BIGINT PRIMARY KEY, | ||
leaf_hash VARCHAR NOT NULL, | ||
data BLOB NOT NULL | ||
); | ||
|
||
CREATE INDEX quorum_certificate2_leaf_hash_idx ON quorum_certificate (leaf_hash); | ||
|
||
CREATE TABLE epoch_migration ( | ||
table_name TEXT PRIMARY KEY, | ||
completed bool NOT NULL DEFAULT FALSE | ||
); | ||
|
||
INSERT INTO epoch_migration (table_name) VALUES ('anchor_leaf'), ('da_proposal'), ('vid_share'), ('undecided_state'), ('quorum_proposals'), ('quorum_certificate'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider adding a constraint for only allowing the ID to be 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can add, these tables are just copy of older ones