Open 0xSorcerer opened 3 weeks ago
Upon further investigation, it looks like the function ReadHeaderRLP in erigon/core/rawdb/accessors_chain yields an empty RLP header for the block hash and number. This is very strange as when I query the node externally through RPC I get the actual header. What could be the issue?
You can print in logs reason why block is nil (means - not found) by: https://github.com/erigontech/erigon/tree/main/cmd/rpcdaemon#debugging
I did this but the thing is that the block ISN'T nil when making a JSON rpc request to the node. It is nil (0x0 pointer) though when reading the database directly.
I would like ask you your go mod setting, I dose not know how to use erigon-lib and erigon simultaneously:
package main
import (
"context"
"fmt"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon-lib/kv/mdbx"
)
Here is my go.mod setting
module github.com/xuht724/erigon_read_db
go 1.22.3
replace github.com/erigontech/erigon => /home/os/haotian/erigon-2.60.6
replace github.com/ledgerwatch/erigon-lib => /home/os/haotian/erigon-2.60.6/erigon-lib
We had test about it: https://github.com/erigontech/erigon/tree/main/tests/erigon-ext-test
I read from erigon's DB and create a FullBlock (block that contains both transactions and their receipts) with:
Works perfectly until I reach block 20300000:
I then get the error:
MakeFullBlock implementation:
Node is synced and
--internalcl
flag is enabled.Furthermore, I noticed that this goes back to working for more recent blocks, such as 20564334.