streamingfast / substreams

Powerful Blockchain streaming data engine, based on StreamingFast Firehose technology.
Apache License 2.0
159 stars 45 forks source link

Make Tier2 nodes fully generic, fusing into a single cluster #424

Closed abourget closed 5 months ago

abourget commented 6 months ago

Goal: optimise costs, reduce waste; better experience on chains with less traffic.

Problem: when launching multiple chains, you need to launch a tier1 and a tier2 stack for all; sometimes tier2 are dormant, so a HorizontalPodAutoscaler will scale down the deployment; yet when someone arrives with 200 jobs, it overloads and starts crashing.

Solution: create a single pool, large pool, of tier2 nodes.. that will receive their configuration from the tier1 upon request. This would also make it less drastic when upgrading tier2 nodes, because there would be a more fluid rotation, having more tier2 nodes to cycle through. Large power would be immediately available to someone bursting with requests, as everything would be shared.. and we could then scale up more gradually with the HPA when they start being saturated.

Prerequisites:

Proposal:

      --common-metering-plugin=grpc://localhost:9010?buffer=100000&network=arb-one <-- network name should be passed, and given to the metering calls
      --common-merged-blocks-store-url=gs://path-to-bucket/arb-one/v1?project=project_id
      --common-first-streamable-block=0
      --substreams-state-bundle-size=1000
      --substreams-state-store-url=gs://path-to-another-bucket/arb-one/substreams-states?project=project_id
      --substreams-state-store-default-tag=v1 <--- the selected tag should be computed and passed

      --substreams-rpc-cache-store-url=  <-- unused now, going away
      --substreams-rpc-endpoints=http://rpc-caching-proxy:8080/ <--- this is only for firehose-ethereum

      --substreams-rpc-gas-limit=0 <-- unused with wazero
matthewdarwin commented 5 months ago

This is done now.