Skip to content
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

Merged

Conversation

MariusVanDerWijden
Copy link
Member

depends on #23103

@holiman holiman marked this pull request as ready for review June 30, 2021 13:13
@holiman
Copy link
Contributor

holiman commented Jun 30, 2021

depends on #23103

Not if I merge this first :trollface:

@holiman holiman added this to the 1.10.5 milestone Jun 30, 2021
@holiman holiman merged commit 686b288 into ethereum:master Jun 30, 2021
@holiman holiman changed the title Statedb rem blockhash followup Statedb remove blockhash Jun 30, 2021
sidhujag pushed a commit to sidhujag/go-ethereum that referenced this pull request Jun 30, 2021
This PR removes the blockhash from the statedb
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
This PR removes the blockhash from the statedb
@gzliudan
Copy link
Contributor

gzliudan commented Mar 1, 2023

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)
}

@MariusVanDerWijden
Copy link
Member Author

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 (p *StateProcessor) Process())

@gzliudan
Copy link
Contributor

gzliudan commented Mar 1, 2023

According to my understanding, it should pass block hash, not header hash ?

@MariusVanDerWijden
Copy link
Member Author

Blockhash and header hash are one and the same thing see:

v := b.header.Hash()

@gzliudan
Copy link
Contributor

gzliudan commented Mar 1, 2023

Thanks.

gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 27, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 17, 2024
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 18, 2024
wanwiset25 pushed a commit to XinFinOrg/XDPoSChain that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants