thehubbleproject / hubble-contracts

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

Delay rpc calls until node synced #635

Closed kautukkundan closed 3 years ago

kautukkundan commented 3 years ago

closes #558

kautukkundan commented 3 years ago

Some notes -

  1. Based on Jake's previous comment

    I addition, one downside of this is that all endpoints will return this status including our process health check (/health) which would be used by container orchestration platforms and uptime checks in general to make sure the node is still responding to pings. We should have the hook ignore /health or consider adding the hook only to the endpoints registered in RPC.ts.

I guess this is sorted as the fastify hook only applies to the fastify endpoints. since the /health endpoint is created with the terminus, it does not have the onRequest hook applied to it. I have manually tested this as well.

  1. I tried to write a test case for testing out the rpc endpoints. However, the server requires geth node to be running already on port 8545 with the contracts deployed and registered. This needs some discussion if automated testing is required for the api right now. Also should that be included in the existing test suite or a separate test suite specifically for testing out APIs which runs separately after the default test suite.
jacque006 commented 3 years ago

For testing, given the amount or work it will involve to setup I think we can skip for now. Manual testing is good :+1: