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

Feat: Deletion / Recovery #598

merged 47 commits into from
Sep 19, 2023

Conversation

0xKitsune
Copy link
Contributor

This PR introduces functionality to delete / recover identity commitments from the protocol.

PR Checklist

  • Added Tests
  • Added Documentation

0xKitsune and others added 30 commits August 28, 2023 01:21
Added/updated database tables to support deletion/recovery.
* added deletion and recovery endpoints, added app functions for deletion

* added deletion prover map

* added prover_type to separate deletion and insertion provers

* added prover_type during batch size removal

* moved custom middleware

* updated prover table migration

* patching tests, added get_eligible_unprocessed_commitments

* patched test_update_eligibility_timestamp

* patched dynamic_batch_sizes

* chore: cargo fmt

* updated delete_identity to check if id has already been deleted or queued for deletion

* updated recover_identity to delete existing commitment, and insert data in to recoveries table

* removed unused function

* added new tests for new database/identity manager logic

* added new tests

* fix: imported IdentityManager into test mod

* updated IdentityManager tests

* updated database tests

* patched test_remove_prover

* separated generate_proof into generate_insertion_proof and generate_deletion_proof

* patched test_insert_provers

* updated provers db schema, updated insert_prover_configuration test

* removed commented out tests, will reimplement

* removed todo
* added deletion and recovery endpoints, added app functions for deletion

* added deletion prover map

* added prover_type to separate deletion and insertion provers

* added prover_type during batch size removal

* moved custom middleware

* updated prover table migration

* patching tests, added get_eligible_unprocessed_commitments

* patched test_update_eligibility_timestamp

* patched dynamic_batch_sizes

* chore: cargo fmt

* updated delete_identity to check if id has already been deleted or queued for deletion

* updated recover_identity to delete existing commitment, and insert data in to recoveries table

* removed unused function

* added new tests for new database/identity manager logic

* added new tests

* fix: imported IdentityManager into test mod

* updated IdentityManager tests

* updated database tests

* patched test_remove_prover

* added delete_identities task

* updated DeleteIdentities methods

* updated delete identities task

* updated logic to remove deletions from table after inserting into identities table

* updated delete task

* Updated identity tree peek_next_updates to get contiguous insertion or deletion updates until max_update_count

* updated processes identities

* added deletion task to the task monitor startup

* updated commit_identities

* added helper functions for delete/insert identities, refactored commit_identities

* added logic to separate insertion/deletion inputs

* fix test

* added logic to insert recovery commitments after deletion

* added deletion indices to deletion proof input

* removed identity manager from delete_identities task

* removed unused imports, arguments and outdated comment

* removed get_unprocessed_commitments

* added peek next updates test

* updated remove_deletions, added test

* moved logic to process recoveries into mine identities task

* added logic to get dynamic eligibility timestamp

* adding logic to get time until next deletion

* added logic to update latest deletion root

* updated to track the latest deletion timestamp

* chore: typo

* removed todos, added fixme
* updated padding for deletion proof

* updated deletion padding

* packed deletion indices into bytearray

* removed unused import

* added padding for merkle proofs and commitments

* fixed import

* removed deletion index packing from deletion proof, added index packing to contract function input for delete_identities

* updated zeroed proof
* added deletion test

* added deleltion prover setup to spawn_deps

* patched test_get_unprocessed_commitments

* updated test setup, updated delete identities test, patched get_leaf fucntion for TreeVersionData

* updated deletion test

* updated identities table to drop unique commitment constraint

* added recovery test

* added a note that we need a mock deletion proof

* updated deletion test

* updated mock prover to handle deletion input

* patched prove function

* updated prove_deletion for mock prover

* Add V2 chain mocks (#594)

* updated compute_deletion_proof_input_hash

* patched mock deletion proof

* fixed id commitment population during deletion

* updated input hash computation for deletion

* updated logging

* Fix verifier for deletion

* Dzejkop/deletion-recovery-tests-fixes (#595)

* Fix deletion tests

* Remove commented out code

* updated deletion test with todo

* updated recovery test

* add padded deletion test

panicking atm

* updated recovery test

* updated pad index

* added test function to get inclusion status

* updated recovery test

* Add V2 chain mocks (#594)

* patched mock deletion proof

* fixed id commitment population during deletion

* updated input hash computation for deletion

* updated logging

* Fix verifier for deletion

* Dzejkop/deletion-recovery-tests-fixes (#595)

* Fix deletion tests

* Remove commented out code

* updated deletion test with todo

* add padded deletion test

panicking atm

* fix calculation and rebase on fix

still doesn't go through

* conflict fix

* updated BasicTreeOps to only update next leaf on non zero insertion

* updated inclusion proof assertion for recover identity

* updated inclusion proof inputs after recoveries

* updated recover_identity to check inclusion status of replacement identities

* patched recover identity test

* add padded deletion tests (#597)

* rebase on latest changes

* Fix

* rebase on latest changes

* rebase on latest deletion-recovery-branch commit

* fix merge conflict

---------

Co-authored-by: Dzejkop <jakubtrad@gmail.com>

* cargo fmt

* chore: cargo clippy

* chore: removed unused file

* chore: removed duplicate test

---------

Co-authored-by: Jakub Trąd <jakubtrad@gmail.com>
Co-authored-by: dcbuilder.eth <dcbuilder@protonmail.com>
* added deletion and recovery endpoints, added app functions for deletion

* added deletion prover map

* added prover_type to separate deletion and insertion provers

* added prover_type during batch size removal

* moved custom middleware

* updated prover table migration

* patching tests, added get_eligible_unprocessed_commitments

* patched test_update_eligibility_timestamp

* patched dynamic_batch_sizes

* chore: cargo fmt

* updated delete_identity to check if id has already been deleted or queued for deletion

* updated recover_identity to delete existing commitment, and insert data in to recoveries table

* removed unused function

* added new tests for new database/identity manager logic

* added new tests

* fix: imported IdentityManager into test mod

* updated IdentityManager tests

* updated database tests

* patched test_remove_prover

* separated generate_proof into generate_insertion_proof and generate_deletion_proof

* patched test_insert_provers

* updated provers db schema, updated insert_prover_configuration test

* removed commented out tests, will reimplement

* removed todo
* added deletion and recovery endpoints, added app functions for deletion

* added deletion prover map

* added prover_type to separate deletion and insertion provers

* added prover_type during batch size removal

* moved custom middleware

* updated prover table migration

* patching tests, added get_eligible_unprocessed_commitments

* patched test_update_eligibility_timestamp

* patched dynamic_batch_sizes

* chore: cargo fmt

* updated delete_identity to check if id has already been deleted or queued for deletion

* updated recover_identity to delete existing commitment, and insert data in to recoveries table

* removed unused function

* added new tests for new database/identity manager logic

* added new tests

* fix: imported IdentityManager into test mod

* updated IdentityManager tests

* updated database tests

* patched test_remove_prover

* added delete_identities task

* updated DeleteIdentities methods

* updated delete identities task

* updated logic to remove deletions from table after inserting into identities table

* updated delete task

* Updated identity tree peek_next_updates to get contiguous insertion or deletion updates until max_update_count

* updated processes identities

* added deletion task to the task monitor startup

* updated commit_identities

* added helper functions for delete/insert identities, refactored commit_identities

* added logic to separate insertion/deletion inputs

* fix test

* added logic to insert recovery commitments after deletion

* added deletion indices to deletion proof input

* removed identity manager from delete_identities task

* removed unused imports, arguments and outdated comment

* removed get_unprocessed_commitments

* added peek next updates test

* updated remove_deletions, added test

* moved logic to process recoveries into mine identities task

* added logic to get dynamic eligibility timestamp

* adding logic to get time until next deletion

* added logic to update latest deletion root

* updated to track the latest deletion timestamp

* chore: typo

* removed todos, added fixme
0xKitsune and others added 11 commits September 18, 2023 13:42
* updated padding for deletion proof

* updated deletion padding

* packed deletion indices into bytearray

* removed unused import

* added padding for merkle proofs and commitments

* fixed import

* removed deletion index packing from deletion proof, added index packing to contract function input for delete_identities

* updated zeroed proof
* added deletion test

* added deleltion prover setup to spawn_deps

* patched test_get_unprocessed_commitments

* updated test setup, updated delete identities test, patched get_leaf fucntion for TreeVersionData

* updated deletion test

* updated identities table to drop unique commitment constraint

* added recovery test

* added a note that we need a mock deletion proof

* updated deletion test

* updated mock prover to handle deletion input

* patched prove function

* updated prove_deletion for mock prover

* Add V2 chain mocks (#594)

* updated compute_deletion_proof_input_hash

* patched mock deletion proof

* fixed id commitment population during deletion

* updated input hash computation for deletion

* updated logging

* Fix verifier for deletion

* Dzejkop/deletion-recovery-tests-fixes (#595)

* Fix deletion tests

* Remove commented out code

* updated deletion test with todo

* updated recovery test

* add padded deletion test

panicking atm

* updated recovery test

* updated pad index

* added test function to get inclusion status

* updated recovery test

* Add V2 chain mocks (#594)

* patched mock deletion proof

* fixed id commitment population during deletion

* updated input hash computation for deletion

* updated logging

* Fix verifier for deletion

* Dzejkop/deletion-recovery-tests-fixes (#595)

* Fix deletion tests

* Remove commented out code

* updated deletion test with todo

* add padded deletion test

panicking atm

* fix calculation and rebase on fix

still doesn't go through

* conflict fix

* updated BasicTreeOps to only update next leaf on non zero insertion

* updated inclusion proof assertion for recover identity

* updated inclusion proof inputs after recoveries

* updated recover_identity to check inclusion status of replacement identities

* patched recover identity test

* add padded deletion tests (#597)

* rebase on latest changes

* Fix

* rebase on latest changes

* rebase on latest deletion-recovery-branch commit

* fix merge conflict

---------

Co-authored-by: Dzejkop <jakubtrad@gmail.com>

* cargo fmt

* chore: cargo clippy

* chore: removed unused file

* chore: removed duplicate test

---------

Co-authored-by: Jakub Trąd <jakubtrad@gmail.com>
Co-authored-by: dcbuilder.eth <dcbuilder@protonmail.com>
@0xKitsune 0xKitsune removed the request for review from dcbuild3r September 19, 2023 17:26
@0xKitsune 0xKitsune marked this pull request as ready for review September 19, 2023 17:26
@0xKitsune 0xKitsune requested a review from a team as a code owner September 19, 2023 17:26
@0xKitsune 0xKitsune merged commit 5002adf into main Sep 19, 2023
4 of 5 checks passed
@0xKitsune 0xKitsune deleted the 0xkitsune/deletion-recovery branch September 19, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants