Skip to content

[bug]: Neutrino backend with header import takes ~20 mins with postgres DB #11014

Description

@bufo24

Pre-Submission Checklist

  • I have searched the existing issues and believe this is a new bug.
  • I am not asking a question about how to use lnd, but reporting a bug (otherwise open a discussion).

LND Version

v0.21.1

LND Configuration

lnd.conf:

databasebackend=postgres

Backend Version

Neutrino

Backend Configuration

.

OS/Distribution

.

Bug Details & Steps to Reproduce

  1. Configure a mainnet node with header imports from 900.000 using Neutrino and a Postgres backend
  2. Start the node, it takes 20 mins before the RPC is ready to init wallet etc.

Logs:

2026-07-31 09:24:28.240 [INF] BTCN: Block manager header state reset: block tip=899999, filter tip=899999
2026-07-31 09:24:28.221 [INF] BTCN: Headers import completed: processed 899999 headers (block and filter) (added: 899999, skipped: 0) from height 0 to 899999 in 20m16.575680607s (739.78 headers/sec, 100.00% new)
2026-07-31 09:24:28.221 [INF] BTCN: Successfully added 899999 new headers from heights 1 to 899999
2026-07-31 09:04:27.290 [INF] BTCN: Appending 899999 new headers in batches of 65536
2026-07-31 09:04:27.289 [INF] BTCN: Adding 899999 new headers (block and filter) from heights 1 to 899999
2026-07-31 09:04:12.167 [INF] BTCN: Chain continuity validation successful: import data (0-899999) connects properly with target chain
2026-07-31 09:04:12.167 [INF] BTCN: Import headers data will extend chain from height 1
2026-07-31 09:04:11.645 [INF] BTCN: Using default write batch size of 65536 headers per region

Expected Behavior

Either:

  • Wallet can be initialized before chain is synced
  • Initial sync does not take ~20 mins with header import

I understand that the postgres still has some KV tables, but any recommendations about improving this setup would be greatly appreciated! We're looking for a way to spin up nodes and get them synced up quickly, ideally using postgres.

Debug Information

No response

Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions