bnb-chain / reth

BSC and opBNB client based on the Reth fork
Apache License 2.0
72 stars 19 forks source link

Crash due to environment map size limit reache #82

Closed shouc closed 3 months ago

shouc commented 3 months ago

Describe the bug

After fully synced the node, we run into following error:

2024-07-24T22:19:41.724440Z ERROR Stage encountered a fatal error: internal database error occurred: write operation CursorInsert failed for key "67e5f6e2a653232e9d8391a5da2aa7239fb8935d2f53d9edf9f57107df0479b9
" in table "TransactionHashNumbers": environment map size limit reached (-30792) stage=TransactionLookup
2024-07-24T22:19:41.724739Z ERROR shutting down due to error
Error: internal database error occurred: write operation CursorInsert failed for key "67e5f6e2a653232e9d8391a5da2aa7239fb8935d2f53d9edf9f57107df0479b9" in table "TransactionHashNumbers": environment map size li
mit reached (-30792)

Caused by:
    write operation CursorInsert failed for key "67e5f6e2a653232e9d8391a5da2aa7239fb8935d2f53d9edf9f57107df0479b9" in table "TransactionHashNumbers": environment map size limit reached (-30792)

Location:
    /home/shou/reth/crates/node/builder/src/launch/mod.rs:411:28

Steps to reproduce

make build-bsc
./target/release/bsc-reth node

Node logs

No response

Platform(s)

Linux (x86)

What version/commit are you on?

Commit SHA: f254328ada0203bda3e8802db229e72427f2e8e6
Build Timestamp: 2024-07-17T02:36:05.014973309Z
Build Features: bsc,jemalloc
Build Profile: release

What database version are you on?

Current database version: 2
Local database version: 2

Which chain / network are you on?

BSC

What type of node are you running?

Archive (default)

What prune config do you use, if any?

No response

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

shouc commented 3 months ago
shou@dev4:~/reth$ ./target/release/bsc-reth db stats                                                                                                                                                              
2024-07-24T22:35:19.818610Z  INFO Initialized tracing, debug log directory: /home/shou/.cache/reth/logs/bsc                                                                                                       
2024-07-24T22:35:19.839956Z  INFO Opening storage db_path="/home/shou/.local/share/reth/bsc/db" sf_path="/home/shou/.local/share/reth/bsc/static_files"                                                           
2024-07-24T22:35:19.904003Z  INFO Verifying storage consistency.                                                                                                                                                  
| Segment      | Block Range         | Transaction Range | Shape (columns x rows) | Size      |                                                                                                                   
|--------------|---------------------|-------------------|------------------------|-----------|                                                                                                                   
| Headers      | 0..=40703405        | N/A               | 3 x 40703406           | 25 GiB    |                                                                                                                   
| Transactions | 0..=40703405        | 0..=5972470411    | 1 x 5972470412         | 1.3 TiB   |                                                                                                                   
| Receipts     | 0..=40703405        | 0..=5972470411    | 1 x 5972470412         | 976.7 GiB |                                                                                                                   
| Sidecars     | 29000000..=40703405 | N/A               | 2 x 11703406           | 20.2 GiB  |                                                                                                                   
| ------------ | ------------------- | ----------------- | ---------------------- | --------- |                                                                                                                   
| Total        |                     |                   |                        | 2.3 TiB   |                                                                                                                   

| Table Name                 | # Entries   | Branch Pages | Leaf Pages | Overflow Pages | Total Size |                                                                                                            
|----------------------------|-------------|--------------|------------|----------------|------------|                                                                                                            
| AccountChangeSets          | 7136456448  | 30749685     | 93564151   | 0              | 474.2 GiB  |                                                                                                            
| AccountsHistory            | 499919894   | 113280       | 12007440   | 2575782        | 56.1 GiB   |                                                                                                            
| AccountsTrie               | 24197825    | 4203         | 1006733    | 0              | 3.9 GiB    |                                                                                                            
| BlockBodyIndices           | 40703406    | 1111         | 248268     | 0              | 974.1 MiB  |                                                                                                            
| BlockOmmers                | 0           | 0            | 0          | 0              | 0 B        |                                                                                                            
| BlockRequests              | 0           | 0            | 0          | 0              | 0 B        |                                                                                                            
| BlockWithdrawals           | 0           | 0            | 0          | 0              | 0 B        |                                                                                                            
| Bytecodes                  | 2890377     | 2617         | 173864     | 7723033        | 30.1 GiB   |                                                                                                            
| CanonicalHeaders           | 0           | 0            | 0          | 0              | 0 B        |                                                                                                            
| ChainState                 | 0           | 0            | 0          | 0              | 0 B        |                                                                                                            
| HashedAccounts             | 307320528   | 97151        | 5373152    | 0              | 20.9 GiB   |                                                                                                            
| HashedStorages             | 3778281824  | 1424772      | 52939435   | 0              | 207.4 GiB  |                                                                                                            
| HeaderNumbers              | 40703406    | 10544        | 773132     | 0              | 3 GiB      |                                                                                                            
| HeaderTerminalDifficulties | 0           | 0            | 0          | 0              | 0 B        |                                                                                                            
| Headers                    | 0           | 0            | 0          | 0              | 0 B        |                                                                                                            
| ParliaSnapshot             | 39750       | 9            | 659        | 39750          | 157.9 MiB  |                                                                                                            
| PlainAccountState          | 307320528   | 58273        | 5396747    | 0              | 20.8 GiB   |                                                                                                            
| PlainStorageState          | 3778281824  | 2058647      | 78294710   | 0              | 306.5 GiB  |                                                                                                            
| PruneCheckpoints           | 4           | 0            | 1          | 0              | 4 KiB      |                                                                                                            
| Receipts                   | 0           | 0            | 0          | 0              | 0 B        |                                                                                                            
| Sidecars                   | 0           | 0            | 0          | 0              | 0 B        |                                                                                                            
| StageCheckpointProgresses  | 1           | 0            | 1          | 0              | 4 KiB      |                                                                                                            
| StageCheckpoints           | 12          | 0            | 1          | 0              | 4 KiB      |
| StorageChangeSets          | 26438455220 | 23514053     | 455866040  | 0              | 1.8 TiB    |
| StoragesHistory            | 4589403754  | 2209626      | 125948466  | 7644104        | 518 GiB    |
| StoragesTrie               | 339459894   | 1614575      | 17372535   | 0              | 72.4 GiB   |
| TransactionBlocks          | 40101339    | 1151         | 257060     | 0              | 1008.6 MiB |
| TransactionHashNumbers     | 5953248345  | 773653       | 73496894   | 0              | 283.3 GiB  |
| TransactionSenders         | 5972470412  | 249189       | 55817481   | 0              | 213.9 GiB  |
| Transactions               | 0           | 0            | 0          | 0              | 0 B        |
| VersionHistory             | 2           | 0            | 1          | 0              | 4 KiB      |
| -------------------------- | ----------- | ------------ | ---------- | -------------- | ---------- |
| Tables                     |             |              |            |                | 3.9 TiB    |
| Freelist                   | 4794812     |              |            |                | 18.3 GiB   |