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

Maker check DAO health when handling OfferAvailabilityRequest. #6546

Merged
merged 1 commit into from Feb 3, 2023
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 30, 2023

If some cases where the offer maker's DAO is out of sync, any OfferAvailabilityRequests result in a failed trade.

This PR adds a check of the DAO when handling OfferAvailabilityRequests, thus preventing unnecessary failed trades.

The maker will be shown a popup informing them to resync the DAO.

dao_not_synced

If their BTC chain is not synced, they will be shown an appropriate message.

btc_not_synced

Previously the maker was oblivious to being in a bad state.


Background info:

It was seen in production that a maker's out of sync DAO was only detected after the offer availability handshake, during trade INIT. Ideally the offer availability stage should detect early and prevent the failed trade.

jan.-21 19:03:45.036 [JavaFX Application Thread] INFO  b.c.o.OpenOfferManager: Received OfferAvailabilityRequest from rinui343p5ytt2jy6qixlxowwnwkgz4ii4gocgpuuqo7ze76rw4vcnid.onion:9999 with offerId 5671366-cbf7b333-e6b1-4c60-81a3-8b578476dafa-198 and uid d87c482c-120e-4745-86a3-3a83175a7fbc 
jan.-21 19:03:46.030 [JavaFX Application Thread] INFO  b.c.offer.Offer: Price at take-offer time: id=5671366, currency=BRL, takersPrice=1390373665, makersPrice=1390373665, deviation=0.0% 
jan.-21 19:03:46.032 [JavaFX Application Thread] INFO  b.c.o.OpenOfferManager: Send OfferAvailabilityResponse with offerId 5671366-cbf7b333-e6b1-4c60-81a3-8b578476dafa-198 and uid 5e8f34cf-dfbf-41a2-a896-4a9a91d733cd to peer rinui343p5ytt2jy6qixlxowwnwkgz4ii4gocgpuuqo7ze76rw4vcnid.onion:9999 
jan.-21 19:03:46.033 [JavaFX Application Thread] INFO  b.c.o.OpenOfferManager: Send AckMessage for OfferAvailabilityRequest to peer rinui343p5ytt2jy6qixlxowwnwkgz4ii4gocgpuuqo7ze76rw4vcnid.onion:9999 with offerId 5671366-cbf7b333-e6b1-4c60-81a3-8b578476dafa-198 and sourceUid d87c482c-120e-4745-86a3-3a83175a7fbc 
jan.-21 19:03:46.035 [JavaFX Application Thread] INFO  b.c.o.OpenOfferManager: OfferAvailabilityResponse arrived at peer: offerId=5671366-cbf7b333-e6b1-4c60-81a3-8b578476dafa-198; uid=5e8f34cf-dfbf-41a2-a896-4a9a91d733cd 
jan.-21 19:03:46.087 [JavaFX Application Thread] INFO  b.c.o.OpenOfferManager: AckMessage for OfferAvailabilityRequest arrived at takersNodeAddress rinui343p5ytt2jy6qixlxowwnwkgz4ii4gocgpuuqo7ze76rw4vcnid.onion:9999. offerId=5671366-cbf7b333-e6b1-4c60-81a3-8b578476dafa-198, sourceUid=d87c482c-120e-4745-86a3-3a83175a7fbc 
jan.-21 19:03:47.440 [JavaFX Application Thread] INFO  b.c.o.OpenOfferManager: Received AckMessage for OfferAvailabilityResponse with offerId 5671366-cbf7b333-e6b1-4c60-81a3-8b578476dafa-198 and uid 5e8f34cf-dfbf-41a2-a896-4a9a91d733cd 
jan.-21 19:03:47.693 [JavaFX Application Thread] INFO  b.c.t.TradeManager: Received inputsForDepositTxRequest from rinui343p5ytt2jy6qixlxowwnwkgz4ii4gocgpuuqo7ze76rw4vcnid.onion:9999 with tradeId 5671366-cbf7b333-e6b1-4c60-81a3-8b578476dafa-198 and uid d3affe1b-5dcf-4e6d-8481-f14abd25d2b2 
jan.-21 19:03:47.694 [JavaFX Application Thread] INFO  b.c.n.a.TradeEvents: We got a new trade. id=5671366-cbf7b333-e6b1-4c60-81a3-8b578476dafa-198 
jan.-21 19:03:47.694 [JavaFX Application Thread] INFO  b.c.t.p.FluentProtocol$Condition: We received a InputsForDepositTxRequest at phase INIT and state PREPARATION, tradeId=5671366-cbf7b333-e6b1-4c60-81a3-8b578476dafa-198 
jan.-21 19:03:47.694 [JavaFX Application Thread] INFO  b.c.t.TaskRunner: Run task: CheckIfDaoStateIsInSync 
jan.-21 19:03:47.696 [JavaFX Application Thread] ERROR b.c.t.Task: An error occurred at task: CheckIfDaoStateIsInSync
Exception message: DAO state is not in sync with seed nodes 
jan.-21 19:03:47.696 [JavaFX Application Thread] ERROR b.c.t.TaskRunner: Task failed: CheckIfDaoStateIsInSync / errorMessage: An error occurred at task: CheckIfDaoStateIsInSync
Exception message: DAO state is not in sync with seed nodes 
jan.-21 19:03:47.697 [JavaFX Application Thread] ERROR b.c.t.p.TradeProtocol: Task runner failed with error An error occurred at task: CheckIfDaoStateIsInSync
Exception message: DAO state is not in sync with seed nodes. Triggered from InputsForDepositTxRequest 

@alejandrogarcia83 alejandrogarcia83 added this to the v1.9.10 milestone Jan 31, 2023
Copy link
Contributor

@alejandrogarcia83 alejandrogarcia83 left a comment

Choose a reason for hiding this comment

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

utACK

@alejandrogarcia83 alejandrogarcia83 merged commit 27613de into bisq-network:master Feb 3, 2023
@ghost ghost mentioned this pull request Feb 9, 2023
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