Skip to content

Commit cd5d222

Browse files
committed
add comment
1 parent b8d60b2 commit cd5d222

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/state_transition.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
374374
st.gas -= gas
375375

376376
// Check clause 6
377+
// Note: If this is an L1MessageTx, we will not return a top-level ErrInsufficientFundsForTransfer.
378+
// Instead, we return ErrInsufficientBalance from within st.evm.Call. This means that such transactions
379+
// will revert but they can be included in a valid block. This is necessary for supporting enforced txs.
377380
if msg.Value().Sign() > 0 && !st.evm.Context.CanTransfer(st.state, msg.From(), msg.Value()) && !msg.IsL1MessageTx() {
378381
return nil, fmt.Errorf("%w: address %v", ErrInsufficientFundsForTransfer, msg.From().Hex())
379382
}

0 commit comments

Comments
 (0)