core: pre-allocate the receipt slice (#34786)

This commit is contained in:
cui 2026-04-22 11:02:44 +08:00 committed by GitHub
parent d422ab39d5
commit dca3cf02a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,7 +64,7 @@ func (p *StateProcessor) chainConfig() *params.ChainConfig {
func (p *StateProcessor) Process(ctx context.Context, block *types.Block, statedb *state.StateDB, cfg vm.Config) (*ProcessResult, error) {
var (
config = p.chainConfig()
receipts types.Receipts
receipts = make(types.Receipts, 0, len(block.Transactions()))
header = block.Header()
blockHash = block.Hash()
blockNumber = block.Number()