mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
fix empty tx, receipts hash
This commit is contained in:
parent
ae335662af
commit
12d7dd0746
1 changed files with 14 additions and 8 deletions
|
|
@ -205,8 +205,7 @@ func (sim *simulator) execute(ctx context.Context, opts simOpts) ([]simBlockResu
|
||||||
root = state.IntermediateRoot(config.IsEIP158(blockContext.BlockNumber)).Bytes()
|
root = state.IntermediateRoot(config.IsEIP158(blockContext.BlockNumber)).Bytes()
|
||||||
}
|
}
|
||||||
gasUsed += result.UsedGas
|
gasUsed += result.UsedGas
|
||||||
receipt := core.MakeReceipt(evm, result, state, blockContext.BlockNumber, common.Hash{}, tx, gasUsed, root)
|
receipts[i] = core.MakeReceipt(evm, result, state, blockContext.BlockNumber, common.Hash{}, tx, gasUsed, root)
|
||||||
receipts[i] = receipt
|
|
||||||
// If the result contains a revert reason, try to unpack it.
|
// If the result contains a revert reason, try to unpack it.
|
||||||
if len(result.Revert()) > 0 {
|
if len(result.Revert()) > 0 {
|
||||||
result.Err = newRevertError(result.Revert())
|
result.Err = newRevertError(result.Revert())
|
||||||
|
|
@ -236,8 +235,13 @@ func (sim *simulator) execute(ctx context.Context, opts simOpts) ([]simBlockResu
|
||||||
header.ParentHash = parentHash
|
header.ParentHash = parentHash
|
||||||
header.Root = state.IntermediateRoot(true)
|
header.Root = state.IntermediateRoot(true)
|
||||||
header.GasUsed = gasUsed
|
header.GasUsed = gasUsed
|
||||||
header.TxHash = types.DeriveSha(types.Transactions(txes), trie.NewStackTrie(nil))
|
if len(txes) > 0 {
|
||||||
header.ReceiptHash = types.DeriveSha(types.Receipts(receipts), trie.NewStackTrie(nil))
|
header.TxHash = types.DeriveSha(types.Transactions(txes), trie.NewStackTrie(nil))
|
||||||
|
}
|
||||||
|
if len(receipts) > 0 {
|
||||||
|
header.ReceiptHash = types.DeriveSha(types.Receipts(receipts), trie.NewStackTrie(nil))
|
||||||
|
header.Bloom = types.CreateBloom(types.Receipts(receipts))
|
||||||
|
}
|
||||||
results[bi] = mcBlockResultFromHeader(header, callResults)
|
results[bi] = mcBlockResultFromHeader(header, callResults)
|
||||||
repairLogs(results, header.Hash())
|
repairLogs(results, header.Hash())
|
||||||
}
|
}
|
||||||
|
|
@ -388,10 +392,12 @@ func makeHeaders(config *params.ChainConfig, blocks []simBlock, base *types.Head
|
||||||
baseFee = eip1559.CalcBaseFee(config, header)
|
baseFee = eip1559.CalcBaseFee(config, header)
|
||||||
}
|
}
|
||||||
header = &types.Header{
|
header = &types.Header{
|
||||||
UncleHash: types.EmptyUncleHash,
|
UncleHash: types.EmptyUncleHash,
|
||||||
Coinbase: base.Coinbase,
|
ReceiptHash: types.EmptyReceiptsHash,
|
||||||
Difficulty: base.Difficulty,
|
TxHash: types.EmptyTxsHash,
|
||||||
GasLimit: base.GasLimit,
|
Coinbase: base.Coinbase,
|
||||||
|
Difficulty: base.Difficulty,
|
||||||
|
GasLimit: base.GasLimit,
|
||||||
//MixDigest: header.MixDigest,
|
//MixDigest: header.MixDigest,
|
||||||
BaseFee: baseFee,
|
BaseFee: baseFee,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue