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

Prevent erroneous logging of 'SignaturePubKey in message does not match' #5196

Merged
merged 1 commit into from Feb 18, 2021
Merged

Conversation

ghost
Copy link

@ghost ghost commented Feb 16, 2021

The order of checks was wrong.

PRE: it was checking the SignaturePubKey for messages that were handled by other subsystems or other trades.
POST: make sure that this is a relevant message before checking that its signature matches the trade.

Fixes #5194


To reproduce the issue:

  1. Have 3 Bisq instances: Alice, Bob, and Chris.
  2. Alice creates an offer to buy.
  3. Bob and Chris both consider taking the offer => Alice receives normal "OfferAvailabilityRequest" messages from them.
  4. Bob takes the offer, initiating a trade with Alice.
  5. Alice creates another offer.
  6. Chris considers taking the offer => Alice logs 2 error messages SignaturePubKey in message does not match.
  7. Anyone other than Bob considers taking the offer => Alice logs the same error messages.
  8. Anyone other than Bob trades with Alice => Alice logs the same error messages.

Verification:

After the fix, trades can be executed simultaneously between any number of peers without the error being logged.

The order of checks was wrong.

PRE: it was checking the SignaturePubKey for messages that
were handled by other subsystems, such as OfferAvailability.

POST: make sure that this is a relevant message before checking that
its signature matches the trade.
@ghost ghost changed the title Check isPubKeyValid only if message is one we are listening for. Prevent erroneous logging of 'SignaturePubKey in message does not match' Feb 17, 2021
@ripcurlx ripcurlx added this to the v1.5.7 milestone Feb 18, 2021
Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

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

ACK - Tested it on Regtest. 👍

@ripcurlx ripcurlx merged commit 2e89e59 into bisq-network:master Feb 18, 2021
@huey735
Copy link
Contributor

huey735 commented Feb 21, 2021

There seems to be a bug in the following scenario:

  1. The mediator suggests that BTC buyer get the trade amount.
  2. The BTC buyer accepts it.
  3. The BTC seller doesn't and re-opens the ticket
  4. The mediator suggests a new resolution in which the BTC seller gets the trade amount.
  5. The BTC seller accepts this one.
  6. The BTC buyer doesn't get a chance to reject it as it's automatically accepted and the trade is closed.

@ripcurlx
Copy link
Contributor

There seems to be a bug in the following scenario:

  1. The mediator suggests that BTC buyer get the trade amount.
  2. The BTC buyer accepts it.
  3. The BTC seller doesn't and re-opens the ticket
  4. The mediator suggests a new resolution in which the BTC seller gets the trade amount.
  5. The BTC seller accepts this one.
  6. The BTC buyer doesn't get a chance to reject it as it's automatically accepted and the trade is closed.

@huey735 I don't think this is related to this PR. Would be great to open another issue for this so it can be tracked and fixed.

@ghost ghost mentioned this pull request Feb 28, 2021
@ghost ghost deleted the fix_SignaturePubKey_error branch October 18, 2023 16:02
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.

Error message repeated: SignaturePubKey in message does not match
2 participants