core, eth, rpc: split out block validator and state processor
This removes the burden on a single object to take care of all validation and state processing. Now instead the validation is done by the `core.BlockValidator` (`types.Validator`) that takes care of both header and uncle validation through the `ValidateBlock` method and state validation through the `ValidateState` method. The state processing is done by a new object `core.StateProcessor` (`types.Processor`) and accepts a new state as input and uses that to process the given block's transactions (and uncles for rewords) to calculate the state root for the next block (P_n + 1).
Showing
- cmd/utils/flags.go 0 additions, 2 deletionscmd/utils/flags.go
- core/bench_test.go 0 additions, 1 deletioncore/bench_test.go
- core/block_validator.go 243 additions, 0 deletionscore/block_validator.go
- core/block_validator_test.go 2 additions, 2 deletionscore/block_validator_test.go
- core/blockchain.go 114 additions, 20 deletionscore/blockchain.go
- core/blockchain_test.go 75 additions, 64 deletionscore/blockchain_test.go
- core/chain_makers.go 4 additions, 7 deletionscore/chain_makers.go
- core/chain_makers_test.go 4 additions, 5 deletionscore/chain_makers_test.go
- core/gaspool.go 27 additions, 6 deletionscore/gaspool.go
- core/state_processor.go 107 additions, 0 deletionscore/state_processor.go
- core/types.go 70 additions, 0 deletionscore/types.go
- eth/backend.go 18 additions, 23 deletionseth/backend.go
- eth/gasprice.go 1 addition, 1 deletioneth/gasprice.go
- eth/helper_test.go 0 additions, 2 deletionseth/helper_test.go
- miner/worker.go 11 additions, 10 deletionsminer/worker.go
- rpc/api/debug.go 24 additions, 4 deletionsrpc/api/debug.go
- xeth/xeth.go 1 addition, 1 deletionxeth/xeth.go
Loading
Please register or sign in to comment