chore(db): remove block numhash key (#1242)

This commit is contained in:
Roman Krasiuk
2023-02-10 23:43:00 +02:00
committed by GitHub
parent 23848df73a
commit 00a49f5ee7
20 changed files with 175 additions and 271 deletions

View File

@ -40,7 +40,6 @@ There are many tables within the node, all used to store different types of data
- Headers
- BlockBodies
- BlockOmmers
- NonCanonicalTransactions
- Transactions
- TxHashNumber
- Receipts
@ -241,10 +240,9 @@ Lets take a look at a couple examples before moving on. In the snippet below, th
[File: crates/storage/provider/src/block.rs](https://github.com/paradigmxyz/reth/blob/main/crates/storage/provider/src/block.rs#L121-L125)
```rust ignore
let block_num_hash = BlockNumHash((block.number, block.hash()));
tx.put::<tables::CanonicalHeaders>(block.number, block.hash())?;
// Put header with canonical hashes.
tx.put::<tables::Headers>(block_num_hash, block.header.as_ref().clone())?;
tx.put::<tables::Headers>(block.number, block.header.as_ref().clone())?;
tx.put::<tables::HeaderNumbers>(block.hash(), block.number)?;
```