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

Relax transaction isolation levels + fix insert identities constraints #795

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Dzejkop
Copy link
Contributor

@Dzejkop Dzejkop commented Oct 18, 2024

No description provided.

@Dzejkop Dzejkop requested a review from a team as a code owner October 18, 2024 13:16
/// Will return `Err` if identity is already queued for deletion, not in the
/// tree, or the queue malfunctions.
#[instrument(level = "debug", skip(self))]
pub async fn recover_identity(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First step in disabling recovery - deleting the API endpoint

);
tx.insert_pending_identity(leaf_idx, identity, &root, &pre_root)
.await
.expect("Failed to insert identity - tree will be out of sync");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most critical change in this PR is this and the other expect on line 70.

These are necessary to keep the sequencer state in sync with the db

@@ -213,76 +209,11 @@ impl App {
return Err(ServerError::IdentityAlreadyDeleted);
}

// Check if the id is already queued for deletion
if tx.identity_is_queued_for_deletion(commitment).await? {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the insert_new_deletion method has been changed to be idempotent. Therefore there's no longer a need to check if we have already accepted a deletion

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