mantlenetworkio / mantle

Mantle | Mass adoption of decentralized & token-governed technologies. With Mantle Network, Mantle Treasury, and token holder-governed products initiatives.
https://www.mantle.xyz
MIT License
224 stars 101 forks source link

Segfault during initial sync #1400

Open fafrd opened 6 months ago

fafrd commented 6 months ago

Describe the bug Encountered SIGSEGV when syncing from scratch:

INFO [03-06|19:53:32.244] Maximum peer count                       ETH=50 LES=0 total=50
INFO [03-06|19:53:32.245] Allocated cache and file handles         database=/home/mantle/mantle_l2geth_data/geth/chaindata cache=16.00MiB handles=16
INFO [03-06|19:53:32.261] Persisted trie from memory database      nodes=63 size=38.36KiB time=75.499µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=-1222.00B
INFO [03-06|19:53:32.261] Successfully wrote genesis state         database=chaindata hash=0a0eb3…fcd013
INFO [03-06|19:53:32.261] Allocated cache and file handles         database=/home/mantle/mantle_l2geth_data/geth/lightchaindata cache=16.00MiB handles=16
INFO [03-06|19:53:32.273] Persisted trie from memory database      nodes=63 size=38.36KiB time=67.48µs  gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=-1222.00B
INFO [03-06|19:53:32.273] Successfully wrote genesis state         database=lightchaindata hash=0a0eb3…fcd013
Starting Geth node
INFO [03-06|19:53:32.301] Maximum peer count                       ETH=50 LES=0 total=50
INFO [03-06|19:53:32.301] Starting peer-to-peer node               instance=Geth/v1.9.10-stable/linux-amd64/go1.22.1
INFO [03-06|19:53:32.301] Allocated trie memory caches             clean=512.00MiB dirty=0.00B
INFO [03-06|19:53:32.301] Allocated cache and file handles         database=/home/mantle/mantle_l2geth_data/geth/chaindata cache=512.00MiB handles=524288
INFO [03-06|19:53:32.320] Opened ancient database                  database=/home/mantle/mantle_l2geth_data/geth/chaindata/ancient
INFO [03-06|19:53:32.320] Initialised chain configuration          config="{ChainID: 5000 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0, Muir Glacier: 0, Berlin: 0,UpdateGasLimitBlock:clique,EigenDaBlock:%!v(MISSING), Engine: %!v(MISSING)}"
INFO [03-06|19:53:32.320] Initialising Ethereum protocol           versions="[64 63]" network=5000 dbversion=7
INFO [03-06|19:53:32.320] Loaded most recent local header          number=0 hash=0a0eb3…fcd013 td=1 age=54y11mo2w
INFO [03-06|19:53:32.320] Loaded most recent local full block      number=0 hash=0a0eb3…fcd013 td=1 age=54y11mo2w
INFO [03-06|19:53:32.320] Loaded most recent local fast block      number=0 hash=0a0eb3…fcd013 td=1 age=54y11mo2w
INFO [03-06|19:53:32.320] Loaded local transaction journal         transactions=0 dropped=0
INFO [03-06|19:53:32.321] Regenerated local transaction journal    transactions=0 accounts=0
INFO [03-06|19:53:32.321] Running in verifier mode                 sync-backend=l2
INFO [03-06|19:53:32.321] Configured rollup client                 url=https://dtl.mantle.xyz chain-id=5000 ctc-deploy-height=8
INFO [03-06|19:53:35.327] Connected to upstream service
INFO [03-06|19:53:35.543] Initializing initial BVM Context         ctc-deploy-height=8
INFO [03-06|20:53:32.322] Regenerated local transaction journal    transactions=0 accounts=0
INFO [03-06|21:53:32.321] Regenerated local transaction journal    transactions=0 accounts=0
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xca11d3]

goroutine 1 [running]:
github.com/mantlenetworkio/mantle/l2geth/rollup.(*Client).GetLastConfirmedEnqueue(0xc000050860)
        /home/mantle/mantle/l2geth/rollup/client.go:624 +0xf3
github.com/mantlenetworkio/mantle/l2geth/rollup.(*SyncService).initializeLatestL1(0xc000368780, 0xc0008549c0)
        /home/mantle/mantle/l2geth/rollup/sync_service.go:354 +0x4da
github.com/mantlenetworkio/mantle/l2geth/rollup.NewSyncService({0x18b9c40?, 0x2375ac0?}, {0x1f018, 0x1, 0x1, 0x1c9c380, {0xc000042073, 0x16}, {0x0, 0x0}, ...}, ...)
        /home/mantle/mantle/l2geth/rollup/sync_service.go:222 +0xf25
github.com/mantlenetworkio/mantle/l2geth/eth.New(0xc000854a80, 0xc000848008)
        /home/mantle/mantle/l2geth/eth/backend.go:210 +0x1105
github.com/mantlenetworkio/mantle/l2geth/cmd/utils.RegisterEthService.func2(0xc000621fb0?)
        /home/mantle/mantle/l2geth/cmd/utils/flags.go:1841 +0x25
github.com/mantlenetworkio/mantle/l2geth/node.(*Node).Start(0xc00065f188)
        /home/mantle/mantle/l2geth/node/node.go:206 +0x5cd
github.com/mantlenetworkio/mantle/l2geth/cmd/utils.StartNode(0xc00065f188)
        /home/mantle/mantle/l2geth/cmd/utils/cmd.go:67 +0x1c
main.startNode(0xc000646840, 0xc00065f188)
        /home/mantle/mantle/l2geth/cmd/geth/main.go:360 +0x52
main.geth(0xc000646840)
        /home/mantle/mantle/l2geth/cmd/geth/main.go:348 +0xe5
gopkg.in/urfave/cli%2ev1.HandleAction({0x128f8e0?, 0x16c92a0?}, 0xc00081c408?)
        /home/mantle/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/app.go:490 +0x50
gopkg.in/urfave/cli%2ev1.(*App).Run(0xc0004dcd00, {0xc000146000, 0xc, 0xc})
        /home/mantle/go/pkg/mod/gopkg.in/urfave/cli.v1@v1.20.0/app.go:264 +0x69f
main.main()
        /home/mantle/mantle/l2geth/cmd/geth/main.go:288 +0x2f

To Reproduce I followed the instructions here pretty precisely: https://docs.mantle.xyz/network/for-validators/deploy-a-node/deploying-a-rollup-verifier-replica-node

Using networks commit 07ef5607246b17d8ad8611e525fb1257637de0da (origin/main) and mantle geth commit e2426b156d5f244904896f5fd2a40239c1bf01a3 (tag: v0.4.3-5). Not running in docker, directly on my machine.

My data directory ~/mantle_l2geth_data is symlinked to another SSD.

Machine is running Debian 11 with an i7-11700 and 128gb ram