-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Statedb remove blockhash #23126
Statedb remove blockhash #23126
Conversation
Not if I merge this first |
This PR removes the blockhash from the statedb
This PR removes the blockhash from the statedb
I have a question: why header.Hash() is passed as parameter blockHash to function applyTransaction in https://github.com/MariusVanDerWijden/go-ethereum/blob/b5e579c4872dc604379689ce26c1312a8a1c877b/core/state_processor.go#L152 ? func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDB, header *types.Header, tx *types.Transaction, usedGas *uint64, cfg vm.Config) (*types.Receipt, error) {
msg, err := tx.AsMessage(types.MakeSigner(config, header.Number), header.BaseFee)
if err != nil {
return nil, err
}
// Create a new context to be used in the EVM environment
blockContext := NewEVMBlockContext(header, bc, author)
vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, config, cfg)
return applyTransaction(msg, config, bc, author, gp, statedb, header.Number, header.Hash(), tx, usedGas, vmenv)
} |
We need the header hash for setting it in the receipts. Or do you mean why not pass the header itself only the header hash? It's quicker if you apply multiple transactions in a block (see |
According to my understanding, it should pass block hash, not header hash ? |
Blockhash and header hash are one and the same thing see: go-ethereum/core/types/block.go Line 431 in e1b98f4
|
Thanks. |
depends on #23103