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: do not attempt to vote on requests more than once #968

Merged
merged 11 commits into from
Nov 28, 2024

Conversation

djordon
Copy link
Collaborator

@djordon djordon commented Nov 27, 2024

Description

Closes #684

Changes

  • Update the queries for get_pending_deposit_requests and get_pending_withdrawal_requests to ignore requests that the signer has voted on already.
  • Update the in memory implementations of both functions.
  • Add a helper query to maintain the same behavior in the load_latest_deposit_requests_persists_requests_from_past test.

Testing Information

This PR adds integration tests that check the new behavior of the updated queries.

Checklist:

  • I have performed a self-review of my code

@djordon djordon added the sbtc signer binary The sBTC Bootstrap Signer. label Nov 27, 2024
@djordon djordon self-assigned this Nov 27, 2024
Copy link
Member

@cylewitruk cylewitruk left a comment

Choose a reason for hiding this comment

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

Looks good 👍

signer/src/testing/storage/postgres.rs Outdated Show resolved Hide resolved
signer/src/testing/storage/postgres.rs Show resolved Hide resolved
Copy link
Collaborator

@matteojug matteojug left a comment

Choose a reason for hiding this comment

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

The only downside of this is that if a signer doesn't get the vote message (e.g., it's down), it will not get it anymore. As long as >=threshold signers get it we should be fine though.

signer/src/testing/storage/postgres.rs Outdated Show resolved Hide resolved
signer/tests/integration/postgres.rs Outdated Show resolved Hide resolved
signer/tests/integration/postgres.rs Show resolved Hide resolved
signer/src/storage/in_memory.rs Outdated Show resolved Hide resolved
@cylewitruk cylewitruk merged commit 10dacfd into main Nov 28, 2024
4 checks passed
@cylewitruk cylewitruk deleted the 684-do-not-attempt-to-vote-on-requests-more-than-once branch November 28, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sbtc signer binary The sBTC Bootstrap Signer.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature]: Do not attempt to vote on requests more than once
3 participants