mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 21:17:16 +00:00
[Fix doc] Compute State Root Stage follows Hashed State Stage, not the other way round (#2073)
This commit is contained in:
parent
29fa1aa35a
commit
4ecd6e07ca
@ -58,7 +58,7 @@ So, when we are generating indexes or hashed state, we do a multi-step process.
|
||||
|
||||
This optimization sometimes leads to dramatic (orders of magnitude) write speed improvements.
|
||||
|
||||
## Stages (for the up to date list see [`stagedsync.go`](/eth/stagedsync/stagedsync.go)):
|
||||
## Stages (for the up to date list see [`stagedsync.go`](/eth/stagedsync/stagedsync.go) and [`stagebuilder.go`](/eth/stagedsync/stagebuilder.go)):
|
||||
|
||||
Each stage consists of 2 functions `ExecFunc` that progesses the stage forward and `UnwindFunc` that unwinds the stage backwards.
|
||||
|
||||
@ -106,7 +106,19 @@ This stage is disk intensive.
|
||||
|
||||
This stage can spawn unwinds if the block execution fails.
|
||||
|
||||
### Stage 6: [Compute State Root Stage](/eth/stagedsync/stage_interhashes.go)
|
||||
### Stage 6: [Generate Hashed State Stage](/eth/stagedsync/stage_hashstate.go)
|
||||
|
||||
Erigon during execution uses Plain state storage.
|
||||
|
||||
> Plain State: Instead of the normal (we call it "Hashed State") where accounts and storage items are addressed as `keccak256(address)`, in the plain state them are addressed by the `address` itself.
|
||||
|
||||
Though, to make sure that some APIs work and keep the compatibility with the other clients, we generate Hashed state as well.
|
||||
|
||||
If the hashed state is not empty, then we are looking at the History ChangeSets and update only the items that were changed.
|
||||
|
||||
This stage doesn't use a network connection.
|
||||
|
||||
### Stage 7: [Compute State Root Stage](/eth/stagedsync/stage_interhashes.go)
|
||||
|
||||
This stage build the Merkle trie and checks the root hash for the current state.
|
||||
|
||||
@ -120,18 +132,6 @@ If the root hash doesn't match, it initiates an unwind one block backwards.
|
||||
|
||||
This stage doesn't use a network connection.
|
||||
|
||||
### Stage 7: [Generate Hashed State Stage](/eth/stagedsync/stage_hashstate.go)
|
||||
|
||||
Erigon during execution uses Plain state storage.
|
||||
|
||||
> Plain State: Instead of the normal (we call it "Hashed State") where accounts and storage items are addressed as `keccak256(address)`, in the plain state them are addressed by the `address` itself.
|
||||
|
||||
Though, to make sure that some APIs work and keep the compatibility with the other clients, we generate Hashed state as well.
|
||||
|
||||
If the hashed state is not empty, then we are looking at the History ChangeSets and update only the items that were changed.
|
||||
|
||||
This stage doesn't use a network connection.
|
||||
|
||||
### Stages 8, 9, 10, 11: Generate Indexes Stages [8, 9](/eth/stagedsync/stage_indexes.go), [10](/eth/stagedsync/stage_log_index.go), and [11](/eth/stagedsync/stage_txlookup.go)
|
||||
|
||||
There are 4 indexes that are generated during sync.
|
||||
|
Loading…
Reference in New Issue
Block a user