mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: derive receipts at end of block in GenerateChain
This ensures the returned receipts match what would be returned by the RPC API.
This commit is contained in:
parent
fd5d33a33b
commit
fd9a83315e
1 changed files with 13 additions and 2 deletions
|
|
@ -369,8 +369,19 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
block, receipt := genblock(i, parent, triedb, statedb)
|
||||
cm.add(block, receipt)
|
||||
block, receipts := genblock(i, parent, triedb, statedb)
|
||||
|
||||
// Post-process the receipts.
|
||||
var blobGasPrice *big.Int
|
||||
if block.ExcessBlobGas() != nil {
|
||||
blobGasPrice = eip4844.CalcBlobFee(*block.ExcessBlobGas())
|
||||
}
|
||||
if err := receipts.DeriveFields(config, block.Hash(), block.NumberU64(), block.Time(), block.BaseFee(), blobGasPrice, block.Transactions()); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Advance the chain.
|
||||
cm.add(block, receipts)
|
||||
parent = block
|
||||
}
|
||||
return cm.chain, cm.receipts
|
||||
|
|
|
|||
Loading…
Reference in a new issue