Skip to content

Conversation

@jsvisa
Copy link

@jsvisa jsvisa commented Jun 6, 2025

After the bloating, the size of trie journal will reached into 4GB++, will exceed pebble's write bactch size(4GB), so after the geth stop, it will panic as below:

INFO [06-04|00:49:21.888] HTTP server stopped                      endpoint=[::]:8543
INFO [06-04|00:49:21.889] IPC endpoint closed                      url=/data/geth-dev/geth.ipc
INFO [06-04|00:49:21.889] Ethereum protocol stopped
INFO [06-04|00:49:21.889] Transaction pool stopped
INFO [06-04|00:49:23.669] Imported new potential chain segment     number=64 hash=745cbd..6e876d blocks=1 txs=0 mgas=0.000 elapsed=2.055s     mgasps=0.000 triediffs=5.89GiB    triedirty=0.00B
INFO [06-04|00:49:23.670] Persisting dirty state to disk           head=63 root=6ac6c8..71f7de layers=63
WARN [06-04|00:49:23.670] Error performing sealing work            err="blockchain is stopped"
panic: pebble: batch too large: >= 4.0GB

goroutine 1 [running]:
github.com/cockroachdb/pebble.(*Batch).grow(0xc06e685200?, 0xc000138908?)
        github.com/cockroachdb/pebble@v1.1.5/batch.go:1414 +0x12d
github.com/cockroachdb/pebble.(*Batch).prepareDeferredKeyValueRecord(0xc06e685200, 0xb, 0x120482415, 0x1)
        github.com/cockroachdb/pebble@v1.1.5/batch.go:592 +0x93
github.com/cockroachdb/pebble.(*Batch).SetDeferred(...)
        github.com/cockroachdb/pebble@v1.1.5/batch.go:726
github.com/cockroachdb/pebble.(*Batch).Set(0xc06e685200, {0x2f91bf0, 0xb, 0x2712?}, {0xc7c96b4000, 0x120482415, 0x80?}, 0x80?)
        github.com/cockroachdb/pebble@v1.1.5/batch.go:708 +0x3c
github.com/cockroachdb/pebble.(*DB).Set(0xc0005c1b08, {0x2f91bf0, 0xb, 0xb}, {0xc7c96b4000, 0x120482415, 0x200000000}, 0x319ecd4)
        github.com/cockroachdb/pebble@v1.1.5/db.go:608 +0xd2
github.com/ethereum/go-ethereum/ethdb/pebble.(*Database).Put(0x20?, {0x2f91bf0?, 0x7f1bb2504a38?, 0x217c148?}, {0xc7c96b4000?, 0x6e7340?, 0x319f7a0?})
        github.com/ethereum/go-ethereum/ethdb/pebble/pebble.go:388 +0x14c
github.com/ethereum/go-ethereum/core/rawdb.WriteTrieJournal({0x7f1b484a0940?, 0xc000686660?}, {0xc7c96b4000?, 0xc404fcba20?, 0xc30cf0ea80?})
        github.com/ethereum/go-ethereum/core/rawdb/accessors_state.go:154 +0x52
github.com/ethereum/go-ethereum/triedb/pathdb.(*Database).Journal(0xc00107bda0, {0x6a, 0xc6, 0xc8, 0x52, 0x51, 0x42, 0xd4, 0x8d, 0x2c, ...})
        github.com/ethereum/go-ethereum/triedb/pathdb/journal.go:337 +0x705
github.com/ethereum/go-ethereum/triedb.(*Database).Journal(0xc000878e10?, {0x6a, 0xc6, 0xc8, 0x52, 0x51, 0x42, 0xd4, 0x8d, 0x2c, ...})
        github.com/ethereum/go-ethereum/triedb/database.go:312 +0x3a
github.com/ethereum/go-ethereum/core.(*BlockChain).Stop(0xc0412eac08)
        github.com/ethereum/go-ethereum/core/blockchain.go:1237 +0x225
github.com/ethereum/go-ethereum/eth.(*Ethereum).Stop(0xc000530340)
        github.com/ethereum/go-ethereum/eth/backend.go:517 +0xc5
github.com/ethereum/go-ethereum/node.(*Node).stopServices(0xc0001b49a0, {0xc0413eb380, 0x3, 0x1000000020002?})
        github.com/ethereum/go-ethereum/node/node.go:291 +0xbf
github.com/ethereum/go-ethereum/node.(*Node).Close(0xc0001b49a0)

Here we try to save the journal into file to bypass this issue.

jsvisa added 3 commits June 6, 2025 09:32
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
Copy link
Owner

@gballet gballet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to store it as multiple keys into the db, but the batch size problem will probably also affect the full batch. Let's not make this a blocker for the bloatnet.

@gballet gballet merged commit 3f6bf40 into gballet:bloat-per-block Jun 6, 2025
@jsvisa jsvisa deleted the trie-into-file branch June 23, 2025 09:14
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

Successfully merging this pull request may close these issues.

2 participants