Code Monkey home page Code Monkey logo

Comments (13)

turbolay avatar turbolay commented on July 1, 2024 1

The suspicious while was changed by @molnard in this commit: 5ea5805

Maybe some kind of leftover? I believe the thing to do is to remove it.

from walletwasabi.

molnard avatar molnard commented on July 1, 2024

Probably pls do it

from walletwasabi.

molnard avatar molnard commented on July 1, 2024

This is mysterious indeed, let's find out who was the murderer.

where the while is suspicious as there is also break.

The while makes no sense - it is left over by me. I assumed that if an exception is thrown here it is a fatal one - we won't try anything again.

The case of P2P interaction throwing an exception

Not all BlockProvider.GetBlockAsync makes sense to retry. Retrying should be done on a lower level. If it throws that means there is no way to get the block.

from walletwasabi.

kiminuo avatar kiminuo commented on July 1, 2024

The case of P2P interaction throwing an exception

Not all BlockProvider.GetBlockAsync makes sense to retry. Retrying should be done on a lower level. If it throws that means there is no way to get the block.

My concern here is only:

  1. You start WW and log in to your wallet
  2. A block cannot be downloaded because, say, your Internet connection is down.

Now what does happen next? Do we recover from this once the Internet connection is up again? I guess we will perform synchronization as usually. Is it the idea?

from walletwasabi.

turbolay avatar turbolay commented on July 1, 2024

I'm concerned by "doing nothing" in case of an exception because failing to get a block would mean releasing HandleFiltersLock so new filters will be processed on all keys without finishing the synchronization.

from walletwasabi.

turbolay avatar turbolay commented on July 1, 2024

The only way to have an exception right now is when RemoveAndStopAllAsync from the WalletManager is called

CancelAllTasks?.Cancel();

So this is not really an issue. There is no other way because the P2PBlockProvider never returns null, so TryGetBlockAsync never returns null when GetBlockAsync is called from the SmartBlockProvider, therefore GetBlockAsync can't throw.

from walletwasabi.

molnard avatar molnard commented on July 1, 2024

Do we recover from this once the Internet connection is up again?

No. The wallet sync stops at that point and will never continue again.

Is it the idea?

There is no current idea for this case. We put a log message, that is all.

from walletwasabi.

molnard avatar molnard commented on July 1, 2024

I'm concerned by "doing nothing" in case of an exception because failing to get a block would mean releasing HandleFiltersLock so new filters will be processed on all keys without finishing the synchronization.

What if we go to an infinite loop until the sync can be finished actually? Maybe this was @turbolay your original intention?

from walletwasabi.

turbolay avatar turbolay commented on July 1, 2024

Maybe this was @turbolay your original intention?

Yes this was my original solution.

from walletwasabi.

molnard avatar molnard commented on July 1, 2024

@turbolay can you add that back?

  • Keep the design of PerformFinalSynchronizationAsync cannot throw just log - this is to avoid UnboservedTaskException.
  • Add an infinite loop around PerformWalletSynchronizationAsync.
    • Consequence: in case of an error we won't be able to process new filters but the wallet cannot get into a broken state.

WDYT?

from walletwasabi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.