Skip to content

Commit

Permalink
skip validaton for l1 message
Browse files Browse the repository at this point in the history
  • Loading branch information
FletcherMan committed Dec 16, 2024
1 parent 5d472fd commit a341446
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,18 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
return nil, err
}
if st.gas < gas {
return nil, fmt.Errorf("%w: have %d, want %d", ErrIntrinsicGas, st.gas, gas)
// Allow L1 message transactions to be included in the block but fail during execution,
// instead of rejecting them outright at this point.
if st.msg.IsL1MessageTx() {
gas = st.gas
} else {
return nil, fmt.Errorf("%w: have %d, want %d", ErrIntrinsicGas, st.gas, gas)
}
}
st.gas -= gas

// Check clause 6
if msg.Value().Sign() > 0 && !st.evm.Context.CanTransfer(st.state, msg.From(), msg.Value()) {
if msg.Value().Sign() > 0 && !msg.IsL1MessageTx() && !st.evm.Context.CanTransfer(st.state, msg.From(), msg.Value()) {
return nil, fmt.Errorf("%w: address %v", ErrInsufficientFundsForTransfer, msg.From().Hex())
}

Expand Down

0 comments on commit a341446

Please sign in to comment.