8000 Sync with WebSocket by tdroxler · Pull Request #616 · alephium/explorer-backend · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Sync with WebSocket #616

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Sync with WebSocket #616

wants to merge 1 commit into from

Conversation

tdroxler
Copy link
Member
@tdroxler tdroxler commented May 1, 2025

Update of #478 using the new websocket of full node and the WsClient
This PR needs the latest version of that node PR

the strategy stay the same:

  • Sync with BlockFlowSyncService as usual
  • Once we are up-to-date: latest block is less than 30s old we move to
    websocket syncing
  • If some blocks are missed between the last sync and the opening of the websocket, it will eventually recover them
    as we always make sure the parents are downloaded before inserting new blocks.
  • If websocket messages are late: > 30s old, we close the websocket and
    move back to http syncing. This can happen in case of network issue,
    this is safer as we could suddenly receive lots of message through the
    websocket and the DB can't follow (happen once in my tests)
  • If the websocket close for anyreason we also move back to http
    syncing.

The main idea is to always rely and fall back on our BlockFlowSyncService which is well tested in production.

I tried 8000 various edge cases, like cutting my network etc.

Still require some testing and extracting some config values

@tdroxler tdroxler requested a review from h0ngcha0 May 1, 2025 14:33
@tdroxler tdroxler force-pushed the syncing-with-wsclient branch from aee9cae to 27c8d94 Compare May 1, 2025 14:40
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
0