farcaster-node
farcaster-node copied to clipboard
Discussion: Auto-Restore on startup
Instead of having the option to manually restore checkpoints on startup, farcasterd could automatically trigger a request to restore all swaps once databased is up and running.
@Lederstrumpf and @h4sh3d what are your opinions on this?
hah! sounds like someone wants to weasel out of #712 ;)
I'm in favor of having checkpoints be restored automatically on startup. I'd make that the default and leave the option to disable automatic restore and restore specific swaps manually.
The reason I currently see for still want the manual option:
- if the node's number of running swaps hits the resource constraints of the host and crashes, you'd want to only restore some of them first and work through the backlog progressively to avoid just repeating that scenario.
- if the timing of some checkpointed swaps is safety critical (Bob about to be punished), then you may want to restore those first (especially if mempool congested).
hah! sounds like someone wants to weasel out of https://github.com/farcaster-project/farcaster-node/issues/712 ;)
Ackchyually #716
The reason I currently see for still want the manual option
I am apprehensive towards allowing both. This creates quite some engineering effort and code bloat. The first reason you give though is interesting, but I am not sure if this is realistic.
I am not in favor of automatic restore, at least not yet. I'd prefer warning the user about a list of potential restore in the db than automatically restoring them.
Points @Lederstrumpf brings show how complicated it can be to do it right and I personally prefer when I am responsible for a mess up (the user) than the soft I'm using is doing something that mess up. But that's personal :)
I'd prefer warning the user about a list of potential restore in the db than automatically restoring them.
That's a compromise I can live with.
After discussing further that topic and for UX perspective I think auto-restoring swaps on startup is ok. In a perfect world we could expose a flag in config to not do it (for backends doing a lot of swaps where other tooling should manage it) but enable by default (as regular user will probably not do hundreds of swaps concurrently) .
I worked on an implementation today, and there is one glaring issue that I overlooked: We cannot report back to the user if the automatic restore was a success or failure. If indeed it was a failure, there is nothing we can do currently to recover from it, or show the user what exactly went wrong. I'll leave the PR open, but in its current form and with our current user reports, it is not easily workable in my eyes.
Auto restore is implemented and deployed.