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

rpc: delete previous pending batch after receiving replacement #200

Merged
merged 1 commit into from
Jan 14, 2021
Merged

rpc: delete previous pending batch after receiving replacement #200

merged 1 commit into from
Jan 14, 2021

Conversation

wpaulino
Copy link
Contributor

This change was mostly motivated by the following scenario:

  1. Trader accepts and signs a batch proposal, and stores it to disk.
  2. Auctioneer send a new batch proposal due to another trader within the batch bailing out.
  3. The trader who signed above rejects the new batch proposal.
  4. The same trader attempts an account modification (deposit, withdrawal, renewal, etc.).
  5. The spend handling logic as part of the account modification commits the staged batch proposal which was replaced, leaving the account state invalid.

This is addressed by removing the staged batch proposal upon any replacements, regardless of whether they are accepted or not. This change also falls in line with the existing work done to clear any artifacts as the result of a previously accepted batch proposal.

This change was mostly motivated by the following scenario:

1. Trader accepts and signs a batch proposal, and stores it to disk.
2. Auctioneer send a new batch proposal due to another trader within the
   batch bailing out.
3. The trader who signed above rejects the new batch proposal.
4. The same trader attempts an account modification (deposit,
   withdrawal, renewal, etc.).
5. The spend handling logic as part of the account modification commits
   the staged batch proposal which was replaced, leaving the account
   state invalid.

This is addressed by removing the staged batch proposal upon any
replacements, regardless of whether they are accepted or not. This
change also falls in line with the existing work done to clear any
artifacts as the result of a previously accepted batch proposal.
@wpaulino wpaulino requested review from Roasbeef and guggero January 12, 2021 22:29
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Nice catch, LGTM!

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🥦

@Roasbeef Roasbeef merged commit 2ee7d8a into lightninglabs:master Jan 14, 2021
@wpaulino wpaulino deleted the delete-pending-batch-after-replacement branch January 15, 2021 22:30
positiveblue pushed a commit to positiveblue/pool that referenced this pull request Oct 11, 2022
auctioneer test: ensure auctioneer shutdown
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