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

Feat: Deletion / Recovery #598

Merged
merged 47 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
51b87ff
updated existing tables, added new tables for recoveries, deletions
0xKitsune Aug 28, 2023
f97fc89
updated schemas
0xKitsune Aug 28, 2023
e437aa8
updated schemas
0xKitsune Aug 28, 2023
f00b8b3
updated tables, added db functions to insert deletions and recoveries
0xKitsune Aug 28, 2023
386eb4a
added eligibility_timestamp to UnprocessedCommitment, added method to…
0xKitsune Aug 28, 2023
ddfd9ff
chore: remove dbg
0xKitsune Aug 28, 2023
6b563a3
updated deletions table, added type to represent deletion and recover…
0xKitsune Aug 28, 2023
b8e4d5d
updated deletion table, updated insert deletion test
0xKitsune Aug 28, 2023
080c24a
updated get_unprocessed_commitments to only get entries that are elig…
0xKitsune Aug 28, 2023
75ad181
Merge pull request #583 from worldcoin/0xkitsune/db-updates
0xKitsune Aug 29, 2023
9324bc0
Feat: Deletion/Recovery API Updates (#586)
0xKitsune Aug 31, 2023
e7c9abd
chore: removing unused whitespace
0xKitsune Aug 31, 2023
3f043a2
removed redundant deletion prover check
0xKitsune Aug 31, 2023
f5e7090
Deletion/recovery task monitor updates (#589)
0xKitsune Sep 6, 2023
68125ec
fixed tests
0xKitsune Sep 6, 2023
490f790
Deletion proof padding (#593)
0xKitsune Sep 11, 2023
a45cafe
Deletion / Recovery Tests (#596)
0xKitsune Sep 18, 2023
6520795
updated existing tables, added new tables for recoveries, deletions
0xKitsune Aug 28, 2023
c9b6177
updated schemas
0xKitsune Aug 28, 2023
221f718
updated schemas
0xKitsune Aug 28, 2023
eacb089
updated tables, added db functions to insert deletions and recoveries
0xKitsune Aug 28, 2023
64782bb
added eligibility_timestamp to UnprocessedCommitment, added method to…
0xKitsune Aug 28, 2023
f76a161
chore: remove dbg
0xKitsune Aug 28, 2023
2eb9f15
updated deletions table, added type to represent deletion and recover…
0xKitsune Aug 28, 2023
cdb88f8
updated deletion table, updated insert deletion test
0xKitsune Aug 28, 2023
eaef3ae
updated get_unprocessed_commitments to only get entries that are elig…
0xKitsune Aug 28, 2023
6771ceb
Feat: Deletion/Recovery API Updates (#586)
0xKitsune Aug 31, 2023
1acfbea
chore: removing unused whitespace
0xKitsune Aug 31, 2023
a45edef
removed redundant deletion prover check
0xKitsune Aug 31, 2023
04134f8
Deletion/recovery task monitor updates (#589)
0xKitsune Sep 6, 2023
c3e8648
fixed tests
0xKitsune Sep 6, 2023
dcbd113
Deletion proof padding (#593)
0xKitsune Sep 11, 2023
261ac81
Deletion / Recovery Tests (#596)
0xKitsune Sep 18, 2023
97c381d
chore: fixed merge conflicts
0xKitsune Sep 18, 2023
3058bec
patched validate_proof_with_age
0xKitsune Sep 18, 2023
5a0b575
chore: cargo fmt
0xKitsune Sep 18, 2023
5944bd0
chore: cargo clippy, fixed validate_proof_with_age test
0xKitsune Sep 18, 2023
fededf8
updated logic to process roots by id instead of leaf_index
0xKitsune Sep 18, 2023
fb1bff6
patched deletion and recovery tests
0xKitsune Sep 18, 2023
611d060
chore: cargo fmt
0xKitsune Sep 18, 2023
c3c0608
chore: cargo clippy
0xKitsune Sep 18, 2023
da3cfe5
Dzejkop/deletion-recovery-dedup-mining (#599)
Dzejkop Sep 18, 2023
d5e5d51
Minor fixes (#600)
Dzejkop Sep 19, 2023
a1f2e86
fix: compare timestamps for database tests
0xKitsune Sep 19, 2023
2d5bc88
fix: patched test_latest_deletion_root
0xKitsune Sep 19, 2023
8beeabc
fix: timestamp comparison for test
0xKitsune Sep 19, 2023
4fc0ac8
fix: updated timestamp comparison for test_get_eligible_unprocessed_c…
0xKitsune Sep 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions schemas/database/004_identities.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- Add the new 'id' column
ALTER TABLE identities ADD COLUMN id BIGSERIAL;

-- Set the new 'id' column as NOT NULL
ALTER TABLE identities ALTER COLUMN id SET NOT NULL;

-- Drop the unique commitment constraint to allow for 0x00 to be inserted for deletions
ALTER TABLE identities DROP CONSTRAINT identities_commitment_key;

-- Set the id to be unique
ALTER TABLE identities ADD CONSTRAINT id_unique UNIQUE(id);

-- Drop the existing primary key
ALTER TABLE identities DROP CONSTRAINT identities_pkey;

-- Set the new 'id' column as the primary key
ALTER TABLE identities ADD PRIMARY KEY (id);
1 change: 1 addition & 0 deletions schemas/database/005_add_eligibility_timestamp.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE unprocessed_identities ADD COLUMN eligibility TIMESTAMPTZ;
4 changes: 4 additions & 0 deletions schemas/database/006_deletions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE TABLE deletions (
leaf_index BIGINT NOT NULL PRIMARY KEY,
commitment BYTEA NOT NULL UNIQUE
)
4 changes: 4 additions & 0 deletions schemas/database/007_recoveries.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE TABLE recoveries (
existing_commitment BYTEA NOT NULL UNIQUE,
new_commitment BYTEA NOT NULL UNIQUE
)
17 changes: 17 additions & 0 deletions schemas/database/008_prover_type.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- Create ENUM for prover type
CREATE TYPE prover_enum AS ENUM('Insertion', 'Deletion');

-- Add new column with the enum
ALTER TABLE provers ADD COLUMN prover_type prover_enum;

-- Update the new column, setting all existing provers as insertions
UPDATE provers SET prover_type = 'Insertion' WHERE prover_type IS NULL;

-- Make the column NOT NULL
ALTER TABLE provers ALTER COLUMN prover_type SET NOT NULL;

-- Drop batch size as the primary key
ALTER TABLE provers DROP CONSTRAINT provers_pkey;

-- Drop the url uniqueness constraint
ALTER TABLE provers DROP CONSTRAINT IF EXISTS provers_url_key;
6 changes: 6 additions & 0 deletions schemas/database/009_latest_deletion_root.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE latest_deletion_root (
Lock char(1) NOT NULL DEFAULT 'X',
deletion_timestamp TIMESTAMPTZ,
constraint PK_T1 PRIMARY KEY (Lock),
constraint CK_T1_Locked CHECK (Lock='X')
)
Loading
Loading