ithacaxyz / op-rs

Apache License 2.0
58 stars 6 forks source link

chore(rollup): support http polling without `eth_newBlockFilter` and `eth_getFilterChanges` #87

Closed merklefruit closed 2 months ago

merklefruit commented 2 months ago

Some RPC providers don't support the filtering methods above.

To support more free providers, we should add the possibility of polling by simply fetching new blocks and checking if the hash has changed. This is quite inefficient, but can be useful for testing / prototyping and if users don't have access to a websocket provider.

The code that calls eth_getFilterChanges is here in the StandaloneContext implementation:

https://github.com/paradigmxyz/op-rs/blob/9ccbc38efec724080f5e111474591586f4e86e2c/crates/rollup/src/driver/context/standalone.rs#L68