Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC Sync Delay: SubQuery Indexer Node Falling Behind Current Block Height (Up to 30-Minute Lag) #756

Open
nitishpatel opened this issue Dec 5, 2024 · 10 comments

Comments

@nitishpatel
Copy link

Issue:

The RPC used for running a SubQuery indexer node is blocks behind the actual current block height and is taking up to 30 minutes to catch up.


Steps to Reproduce:

  1. Clone the Repository:

    git clone [email protected]:subquery/ethereum-subql-starter.git

    Navigate to the directory:

    cd ethereum-subql-starter/XDC/xdc-apothem-starter/
  2. Install Dependencies:

    yarn install
  3. Update the Configuration:
    Open project.ts and update the startBlock to something recent:

    startBlock: 69941025,

    Also, set the endpoint to:

    endpoint: ["https://erpc.apothem.network"],

Observations:

  • When unfinalized blocks are not allowed (setting disabled), the indexer syncs 300+ blocks behind.

    • Previously, the indexer synced to the current height within 20 seconds, even with unfinalized blocks disabled.
    • Currently, it takes upwards of 30 minutes to sync.
  • After allowing unfinalized blocks, the indexer syncs in 30 seconds as expected.


Expected Behavior:

The indexer should sync with the current block height within 20 seconds, as it did previously, regardless of the unfinalized block setting.


Environment Details:

RPC: https://erpc.apothem.network

@nitishpatel nitishpatel changed the title Apothem RPC's responding slowly RPC Sync Delay: SubQuery Indexer Node Falling Behind Current Block Height (Up to 30-Minute Lag) Dec 5, 2024
@gzliudan
Copy link
Collaborator

gzliudan commented Dec 5, 2024

May I ask when this issue occurred ?

@jamesbayly
Copy link

Hey, this is no good. We're taking a look at it.
@stwiname @yoozo

@jamesbayly
Copy link

Hey @nitishpatel perhaps there is some misconception about how the real time indexing works.

SubQuery provides real time indexing of unconfirmed data directly from the RPC endpoint that solves this problem. SubQuery takes the most probabilistic data before it is confirmed to provide to the app. In the unlikely event that the data isn’t confirmed and a reorg occurs, SubQuery will automatically roll back and correct its mistakes quickly and efficiently - resulting in an insanely quick user experience for your customers.

To control this feature, please adjust the --block-confirmations command to fine tune your project and also ensure that historic indexing is enabled (enabled by default)

I suspect the default number of confirmations for your chain is 300 blocks, by controlling the --block-confirmations you should be able to reduce this

@nitishpatel
Copy link
Author

Hey @jamesbayly , I will check out with the --block-confirmations flag, However would be good to know if there is something changed recently on the apothem network, because subquery seemed to sync just fine about 8 days back, I started facing the issue post apothem was down for 2 days

@jamesbayly
Copy link

We'll check into it. Can you confirm what version of subql-node you are using. it's printed during project startup

@nitishpatel
Copy link
Author

The docker image being used is 5.1.4

@gzliudan
Copy link
Collaborator

gzliudan commented Dec 9, 2024

@nitishpatel Did you tested with RPC https://earpc.apothem.network ? This is archive node.

@nitishpatel
Copy link
Author

@gzliudan We were using that but then it was going down in between and the also got delisted from https://chainlist.org/?search=apothem

@wanwiset25
Copy link
Collaborator

wanwiset25 commented Dec 13, 2024

I suspect the default number of confirmations for your chain is 300 blocks, by controlling the --block-confirmations you should be able to reduce this

@jamesbayly How can we find out what is the default confirmation number?

@jamesbayly
Copy link

I suspect the default number of confirmations for your chain is 300 blocks, by controlling the --block-confirmations you should be able to reduce this

@jamesbayly How can we find out what is the default confirmation number?

For EVM networks, it is 200 blocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants