Skip to content

Commit 71186ff

Browse files
authored
touch all fields in withdrawal account header (#277)
1 parent 013df38 commit 71186ff

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

consensus/beacon/consensus.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,16 @@ func (beacon *Beacon) Finalize(chain consensus.ChainHeaderReader, header *types.
359359
state.AddBalance(w.Address, amount)
360360

361361
// The returned gas is not charged
362-
state.Witness().TouchAddressOnWriteAndComputeGas(w.Address[:])
362+
waddr := utils.GetTreeKeyVersion(w.Address[:])
363+
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
364+
waddr[31] = utils.BalanceLeafKey
365+
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
366+
waddr[31] = utils.NonceLeafKey
367+
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
368+
waddr[31] = utils.CodeKeccakLeafKey
369+
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
370+
waddr[31] = utils.CodeSizeLeafKey
371+
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
363372
}
364373

365374
// Add the fee recipient to the witness

0 commit comments

Comments
 (0)