thehubbleproject / hubble-contracts

Hubble optimistic rollup
https://thehubbleproject.github.io/docs/
MIT License
133 stars 28 forks source link

starting up the rpc client until after the initial sync is completed. #558

Closed ChihChengLiang closed 3 years ago

ChihChengLiang commented 3 years ago

What's wrong

The RPC client shouldn't be serving before the node is fully synced.

How can we fix it

Should return HTTP 503

TODO: Need to figure out how to implement this

jacque006 commented 3 years ago

We can likely implement this by adding a request hook that will 503 until the sync complete event is sent.

Per https://github.com/thehubbleproject/hubble-contracts/pull/606#discussion_r659975631 , we may need to group different routes by what mode the node is in and error (HTTP 4xx/5xx) if the route is currently unavailable. If we ever figure out a pattern where nodes can forward txns to the active proposer then all routes could be opened up.