beacon/engine: prealloc capacity for map and slice (#29903)

* prealloc capacity for map and slice

* revert unnecessary change
pull/29918/head
maskpp 5 months ago committed by GitHub
parent 50405e29b7
commit b36c73813c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      beacon/engine/types.go

@ -209,7 +209,7 @@ func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash,
if params.BaseFeePerGas != nil && (params.BaseFeePerGas.Sign() == -1 || params.BaseFeePerGas.BitLen() > 256) { if params.BaseFeePerGas != nil && (params.BaseFeePerGas.Sign() == -1 || params.BaseFeePerGas.BitLen() > 256) {
return nil, fmt.Errorf("invalid baseFeePerGas: %v", params.BaseFeePerGas) return nil, fmt.Errorf("invalid baseFeePerGas: %v", params.BaseFeePerGas)
} }
var blobHashes []common.Hash var blobHashes = make([]common.Hash, 0, len(txs))
for _, tx := range txs { for _, tx := range txs {
blobHashes = append(blobHashes, tx.BlobHashes()...) blobHashes = append(blobHashes, tx.BlobHashes()...)
} }

Loading…
Cancel
Save