mev-commit icon indicating copy to clipboard operation
mev-commit copied to clipboard

Oracle: use WS instead of HTTP to get L1 blocks

Open Mikelle opened this issue 1 year ago • 2 comments

Currently, we are using a ticker to get new L1 blocks using an HTTP connection. It's not efficient and could confuse people, who are relying on 12s block timeframe.

Instead, we could subscribe to the headers: https://goethereumbook.org/block-subscribe/

Mikelle avatar Jun 19 '24 23:06 Mikelle

If it is a websocket how do we take care potentially missing events due to a faulty connection? with http we know where we left off by checkpointing.

kant777 avatar Jun 19 '24 23:06 kant777

During the ws connection, we could do the same as we are doing now: save the current block number. If any error occurs during the ws connection, check for any missed blocks using an HTTP connection, and then resume using the ws connection.

Mikelle avatar Jun 20 '24 16:06 Mikelle

Closing this as this is already enabled. If websocket address is provided, the oracle will use the ws listener.

aloknerurkar avatar Dec 30 '24 13:12 aloknerurkar