Skip to content

Commit

Permalink
touch all fields in withdrawal account header (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet authored Sep 22, 2023
1 parent 013df38 commit 71186ff
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion consensus/beacon/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,16 @@ func (beacon *Beacon) Finalize(chain consensus.ChainHeaderReader, header *types.
state.AddBalance(w.Address, amount)

// The returned gas is not charged
state.Witness().TouchAddressOnWriteAndComputeGas(w.Address[:])
waddr := utils.GetTreeKeyVersion(w.Address[:])
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
waddr[31] = utils.BalanceLeafKey
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
waddr[31] = utils.NonceLeafKey
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
waddr[31] = utils.CodeKeccakLeafKey
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
waddr[31] = utils.CodeSizeLeafKey
state.Witness().TouchAddressOnWriteAndComputeGas(waddr)
}

// Add the fee recipient to the witness
Expand Down

0 comments on commit 71186ff

Please sign in to comment.