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

Oracle: use WS instead of HTTP to get L1 blocks #160

Open
Mikelle opened this issue Jun 19, 2024 · 2 comments
Open

Oracle: use WS instead of HTTP to get L1 blocks #160

Mikelle opened this issue Jun 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Mikelle
Copy link
Member

Mikelle commented Jun 19, 2024

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 Mikelle added the enhancement New feature or request label Jun 19, 2024
@kant777
Copy link
Contributor

kant777 commented Jun 19, 2024

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.

@Mikelle
Copy link
Member Author

Mikelle commented Jun 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants