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 #1413

Open
spennyp opened this issue Jan 7, 2025 · 1 comment
Open

bug: indexing freeze when using pglite #1413

spennyp opened this issue Jan 7, 2025 · 1 comment

Comments

@spennyp
Copy link

spennyp commented Jan 7, 2025

Version

0.8.17

Current behavior

Ponder app freezes during indexing.

Expected behavior

Should not freeze. This used index fine in v0.6, and stopped after migrating to v0.8

Steps to reproduce

  1. pnpm create ponder
  2. Choose the template: Reference - ERC20 token
  3. Populate PONDER_RPC_URL_1 in .env.local file
  4. Configure ponder.config.ts to:
import { createConfig } from "ponder";
import { http } from "viem";
import { erc20ABI } from "./abis/erc20ABI";
import { base } from "viem/chains";

export default createConfig({
  networks: {
    base: {
      chainId: base.id,
      transport: http(process.env.PONDER_RPC_URL_1),
    },
  },
  contracts: {
    ERC20: {
      network: "base",
      abi: erc20ABI,
      address: "0x0a93a7BE7e7e426fC046e204C44d6b03A302b631",
      startBlock: 15399701,
    },
  },
});
  1. Run pnpm dev

After a few minutes, freezes on something like this:

1:06:43 AM INFO  app        Indexed 116 events with 13.2% complete and 9m 30s remaining
1:06:44 AM INFO  app        Indexed 51 events with 13.6% complete and 9m 13s remaining
1:06:45 AM INFO  app        Indexed 121 events with 14.0% complete and 8m 54s remaining
1:06:46 AM INFO  app        Indexed 29 events with 14.6% complete and 8m 39s remaining

Sync

│ Network │ Status             │ Block    │ RPC (req/s) │
├─────────┼────────────────────┼──────────┼─────────────┤
│ base    │ historical (14.2%) │ 16720196 │        30.4 │

Indexing

│ Event          │ Count │ Duration (ms) │
├────────────────┼───────┼───────────────┤
│ ERC20:Transfer │  8123 │         0.021 │
│ ERC20:Approval │  2114 │         0.014 │

Progress (historical)

██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 14.0% (8m 54s eta)

Restarting the app doesn't help, just gets to the same spot and hangs.

Link to repository

No response

Anything else?

No response

@spennyp spennyp changed the title Indexing Freezing Indexing Freezes Jan 7, 2025
@typedarray
Copy link
Collaborator

Thanks for opening. I was able to reproduce this when using PGlite, but your app seems to work fine when using Postgres. This is likely a PGlite bug / edge case (the library is still rather young).

I'm working to open an actionable issue on the PGlite repo, but in the meantime you can get unblocked by using Postgres.

@typedarray typedarray changed the title Indexing Freezes bug: indexing freeze when using pglite Jan 8, 2025
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

2 participants