Skip to content

Commit f2b4bee

Browse files
committed
fix: include receipts when upgrading last synchronous block
As it self-settles, there isn't actually a concern with re-settlement of the receipts as previously commented in the code. Having this block's execution results behave like other blocks is just one less edge case.
1 parent 00b1863 commit f2b4bee

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

db.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,14 @@ func (vm *VM) upgradeLastSynchronousBlock(hash common.Hash) error {
3838
return err
3939
}
4040

41-
if err := block.MarkExecuted(
42-
vm.db,
43-
true,
44-
gastime.New(
45-
block.Time(),
46-
// TODO(arr4n) get the gas target and post-execution excess of the
47-
// genesis block.
48-
1e6, 0,
49-
),
50-
block.Timestamp(),
51-
nil, // avoid re-settlement of receipts,
52-
block.Root(),
53-
); err != nil {
41+
clock := gastime.New(
42+
block.Time(),
43+
// TODO(arr4n) get the gas target and post-execution excess of the
44+
// genesis block.
45+
1e6, 0,
46+
)
47+
receipts := rawdb.ReadRawReceipts(vm.db, hash, block.Height())
48+
if err := block.MarkExecuted(vm.db, true, clock, block.Timestamp(), receipts, block.Root()); err != nil {
5449
return err
5550
}
5651
if err := block.WriteLastSettledNumber(vm.db); err != nil {

0 commit comments

Comments
 (0)