Skip to content

Stop fetching every address on eth_getLogs when using RPC as a datasource #1141

@ThallesP

Description

@ThallesP

Envio fetches every single registered address when calling eth_getLogs:
Image

While this approach makes sense during historical synchronization as it filters out unnecessary events from other addresses, it may not be optimal once we've reached the chain tip.

Issues with the current approach:

  1. It produces numerous extra requests
  2. It consumes substantial egress bandwidth, which is costly

I'm suggesting that when Envio reaches the chain tip, it should automatically switch to using eth_getLogs without any address filter, then internally discard logs from unregistered addresses.

I've created a proof of concept at notuslabs@643a719. I haven't tested it yet as I need to build and release it as a package for testing, but it could serve as inspiration (though it was generated with AI, so please take it with a grain of salt).

Additionally, it would be beneficial if we could configure this behavior via config.yml under the rpc section, allowing developers to set unfiltered addresses even during historical sync. The default setting should remain as live only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions