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

bug: indexing freeze when using pglite in anvil #1570

Open
koo-one opened this issue Feb 28, 2025 · 3 comments
Open

bug: indexing freeze when using pglite in anvil #1570

koo-one opened this issue Feb 28, 2025 · 3 comments

Comments

@koo-one
Copy link

koo-one commented Feb 28, 2025

Version

0.9.19

Current behavior

the Ponder app freezes when restart after processing about 30 blocks, even though it worked seamlessly in version 0.7.17.

Expected behavior

The Ponder app should continue indexing and processing blocks seamlessly, even when ponder dev is restarted, regardless of block time delays.

Steps to reproduce

  1. Start the Anvil Fork Script
  2. Run the Ponder Development App

fork script is like this. it executed well in ponder ver 0.7.17

#!/bin/bash

echo "[info] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start fork"

# load env variables
source .env

anvil --block-time 12 --fork-url mainnet --chain-id 31337 --fork-block-number 21276259 

Initially, the Ponder app starts indexing correctly.

However, stopping the application and then restart it (i.e., run ponder dev) about 6 minutes later, the runtime freezes. The logs show that indexing stops progressing, even though Anvil continues processing new blocks.

> ponder dev

 3:36:07 INFO  build      Using PGlite database at .ponder/pglite (default)
 3:36:07 WARN  build      Network 'anvil' is using a public RPC URL (http://127.0.0.1:8545). Most apps require an RPC URL with a higher rate limit.
 3:36:07 INFO  database   Using database schema 'public'
 3:36:08 INFO  database   Created tables [token, user, restake_position, borrow_position, pool, restaking, pair, pair_param, yield_source, authorization, nonce]
 3:36:08 WARN  sync       Deleting cache records for 'anvil'
 3:36:08 INFO  server     Started listening on port 42069
 3:36:08 INFO  server     Started returning 200 responses from /health endpoint
 3:36:08 INFO  historical Started 'anvil' historical sync with 0% cached

Sync

│ Network │ Status             │ Block    │ RPC (req/s) │
├─────────┼────────────────────┼──────────┼─────────────┤
│ anvil   │ historical (76.5%) │ 21276284 │         0.0 │

Indexing

Waiting to start...

Progress 

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.0%

API functions 
Server live at http://localhost:42069

Anvil Logs Snapshot (for context):
Example logs from Anvil:

eth_getLogs

Block Number: 21276323
Block Hash: 0x1f8ed0b70fbdbe4edbab90ecb6f66bf8fdadb0e96ef304b03c68931f583daad4
Block Time: "Wed, 27 Nov 2024 03:12:23 +0000"


Block Number: 21276324
Block Hash: 0x6cd13cb6f359f7aa675e78a0fc5f9d60de59f94ee3b45be73888e9d955086023
Block Time: "Wed, 27 Nov 2024 03:12:35 +0000"


Block Number: 21276325
Block Hash: 0x6ef9a007c01b0872e1fa43aa3dfc6a3914522c069550ec2e861b6f6b96133e69
Block Time: "Wed, 27 Nov 2024 03:12:47 +0000"


Block Number: 21276326
Block Hash: 0xf3991e95ecf9d37efdf56594d18b3652f231aa5b5277f8620ae722f79a12aba0
Block Time: "Wed, 27 Nov 2024 03:12:59 +0000"


Block Number: 21276327
Block Hash: 0x339251e471ba11394f7238743a77fceee1c873cab46514bb86fe8141eedf76d0
Block Time: "Wed, 27 Nov 2024 03:13:11 +0000"


Block Number: 21276328
Block Hash: 0x24f8edbdd4f95ea5f75d658f6d26307c8c424a05cfca77cfcdb732da8d1cb95f
Block Time: "Wed, 27 Nov 2024 03:13:23 +0000"


Block Number: 21276329
Block Hash: 0xaabe8333a9a1dbbe40ace792dc92786728ed05bc8867ec3de2c9a05a5b69de97
Block Time: "Wed, 27 Nov 2024 03:13:35 +0000" 

Link to repository

No response

Anything else?

No response

@typedarray
Copy link
Collaborator

Can you reproduce this when using Postgres? I suspect this is a PGlite issue unrelated to Anvil.

@koo-one
Copy link
Author

koo-one commented Mar 3, 2025

it seems okay when using Postgres! is this isuue is related to PGlite?

@tk-o
Copy link
Contributor

tk-o commented Mar 4, 2025

I had this issue with indexing Anvil chain.

A fix that worked for me was adding disableCache: true to Anvil's network config in ponder.config.ts.

Feel free to give it a try, @koo-one 🚀

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

3 participants