Closed
Description
System information
Geth version: 1.13.5
CL client & version: teku v23.11.0
OS & Version: Linux
Expected behaviour
After using geth removedb
(and choosing n
on deleting ancients) and restarting, the node should resync and honor the value of --history.transactions 0
.
Actual behaviour
After using geth removedb
(and choosing n
on deleting ancients) and restarting, the node resyncs but seems to only index "recent" transactions.
Steps to reproduce the behaviour
- Sync a node to head (I've tested reproduced on both 1.13.5 and 1.13.1 using both leveldb and pebble/PBSS)
- relevant arguments:
/usr/bin/geth --mainnet --syncmode full --db.engine=leveldb --history.transactions 0 --snapshot=true --datadir /mnt/local/ethereum
- Stop the node
- Run
geth removedb
- Choose
y
for deleting full node state,n
for ancients as shown below:
$ sudo -u geth geth removedb --db.engine=leveldb --datadir /mnt/local/ethereum
INFO [12-12|00:26:24.953] Maximum peer count ETH=50 LES=0 total=50
INFO [12-12|00:26:24.955] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [12-12|00:26:24.956] Using leveldb as db engine
INFO [12-12|00:26:24.958] Global gas cap set to 10x block gas limit
INFO [12-12|00:26:24.959] Initializing the KZG library backend=gokzg
Remove full node state database (/mnt/local/ethereum/geth/chaindata)? [y/n] y
Remove full node state database (/mnt/local/ethereum/geth/chaindata)? [y/n] y
INFO [12-12|00:26:57.218] Database successfully deleted path=/mnt/local/ethereum/geth/chaindata elapsed=26.749s
Remove full node ancient database (/mnt/local/ethereum/geth/chaindata/ancient)? [y/n] n
Remove full node ancient database (/mnt/local/ethereum/geth/chaindata/ancient)? [y/n] n
INFO [12-12|00:27:06.826] Database deletion skipped path=/mnt/local/ethereum/geth/chaindata/ancient
INFO [12-12|00:27:06.827] Light node database missing path=/mnt/local/ethereum/geth/lightchaindata
- Restart the node
- Wait "overnight" while node resyncs
- Eventually Node is synced to head
- Try retrieving an older tx, e.g.: https://etherscan.io/tx/0xa243c78518ea5b6ebdccb61f54f3f87f44e84b7c028560386196e6bc77de37dd
$ sudo geth attach /mnt/local/ethereum/geth.ipc
Welcome to the Geth JavaScript console!
instance: Geth/v1.13.5-omnibus-62a11504/linux-amd64/go1.21.4
at block: 18771040 (Tue Dec 12 2023 15:36:59 GMT+0000 (UTC))
datadir: /mnt/local/ethereum
modules: admin:1.0 debug:1.0 engine:1.0 eth:1.0 miner:1.0 net:1.0 rpc:1.0 txpool:1.0 web3:1.0
To exit, press ctrl-d or type exit
> eth.getTransaction("0xa243c78518ea5b6ebdccb61f54f3f87f44e84b7c028560386196e6bc77de37dd")
null
Furthermore, I scanned the logs for Indexing transactions
and never had any hits, so as far as I can tell rawdb.indexTransactions
never runs.
I'm trying again now w/o using the ancients, and it seems to be working, but I won't know for certain until it fully syncs again.