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

Merged
merged 11 commits into from
Oct 21, 2024

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess my only question is will the identity be completely lost here if this fails? And therein all unprocessed identities prior? Same below with tx.commit() failing. Just wondering what the flow would be after restart

@@ -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

@Dzejkop Dzejkop force-pushed the dzejkop/resolve-tx-issues branch from aaaa9d9 to 3f9b79b Compare October 21, 2024 13:14
@Dzejkop Dzejkop merged commit e5a3b2f into main Oct 21, 2024
5 checks passed
@Dzejkop Dzejkop deleted the dzejkop/resolve-tx-issues branch October 21, 2024 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.

3 participants