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

Make sure triples and presignatures are not reused #931

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

volovyks
Copy link
Collaborator

@volovyks volovyks commented Nov 19, 2024

We should be more strict on how we manage triples and presignatures. Not sure if it's causing this #924 and other issues, but we should make this change anyway. Rare occasions where we lose triples or presignatures is a low price for robustness.

Triples:

  • Mark triples used when they were taken from storage.
  • Check if triple was already used or exists in storage before adding.
  • Do not reinsert triples.

Presignatures:

  • the same
  • some of the comments were saying that we are "trashing" presignatures, but in reality, we were putting them back into storage

@@ -8,7 +8,7 @@ use near_account_id::AccountId;
type TripleResult<T> = std::result::Result<T, anyhow::Error>;

// Can be used to "clear" redis storage in case of a breaking change
const TRIPLE_STORAGE_VERSION: &str = "v1";
const TRIPLE_STORAGE_VERSION: &str = "v2";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Incrementing the storage version here to start from scratch.

@volovyks volovyks changed the title Make sure triples are not reused Make sure triples and presignatures are not reused Nov 19, 2024
@volovyks volovyks marked this pull request as ready for review November 19, 2024 19:14
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.

1 participant