trie: cache collapsed tries node, not rlp blobs (#16876)
The current trie memory database/cache that we do pruning on stores trie nodes as binary rlp encoded blobs, and also stores the node relationships/references for GC purposes. However, most of the trie nodes (everything apart from a value node) is in essence just a collection of references. This PR switches out the RLP encoded trie blobs with the collapsed-but-not-serialized trie nodes. This permits most of the references to be recovered from within the node data structure, avoiding the need to track them a second time (expensive memory wise).
Showing
- core/blockchain.go 2 additions, 2 deletionscore/blockchain.go
- core/blockchain_test.go 2 additions, 2 deletionscore/blockchain_test.go
- core/state/statedb.go 1 addition, 1 deletioncore/state/statedb.go
- eth/api_tracer.go 3 additions, 3 deletionseth/api_tracer.go
- trie/database.go 238 additions, 36 deletionstrie/database.go
- trie/hasher.go 5 additions, 25 deletionstrie/hasher.go
- trie/node.go 14 additions, 1 deletiontrie/node.go
- trie/trie.go 3 additions, 5 deletionstrie/trie.go
Loading
Please register or sign in to comment