Parity-ethereum: Purpose of combine_key in AccountDB

Created on 26 Feb 2019  ·  2Comments  ·  Source: openethereum/parity-ethereum

  • Parity Ethereum version: 2.2.11
  • Operating system: Linux
  • Installation: built from source
  • Fully synchronized: no
  • Network: ethereum
  • Restarted: yes

What is the purpose of combine_key in ethcore/src/account_db.rs (https://github.com/paritytech/parity-ethereum/blob/master/ethcore/src/account_db.rs#L31)? This breaks the Proving and ProofCheck state backends as the key under which the contract code is stored is not equal to the keccak hash of the code. Would it be possible to _not_ combine the address hash and the key, and instead just lookup by the provided key? Geth does this (https://github.com/ethereum/go-ethereum/blob/17d67c5834679f2b27ef08eddfce3b3a154a96a8/core/state/database.go#L146) so it doesn't seem like it is mandated by the spec.

Z1-question 🙋‍♀️

Most helpful comment

This is required for our pruning algorithm. The idea is that every node has unique key in the underlying key-value database. This eliminates the need for reference counting and makes pruning much more performant.
Proving and ProofCheck should be usingAccountDb for accessing account storage.

All 2 comments

@rphmeier can probably answer this? this appears to have been our design since day 1.

This is required for our pruning algorithm. The idea is that every node has unique key in the underlying key-value database. This eliminates the need for reference counting and makes pruning much more performant.
Proving and ProofCheck should be usingAccountDb for accessing account storage.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

famfamfam picture famfamfam  ·  3Comments

BillSantos picture BillSantos  ·  3Comments

vmenond picture vmenond  ·  3Comments

jordipainan picture jordipainan  ·  3Comments

mr-older picture mr-older  ·  3Comments