Skip to content

Commit c2017a3

Browse files
committedDec 17, 2024
skip validaton for l1 message (#165)

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎core/state_transition.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,18 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
368368
return nil, err
369369
}
370370
if st.gas < gas {
371-
return nil, fmt.Errorf("%w: have %d, want %d", ErrIntrinsicGas, st.gas, gas)
371+
// Allow L1 message transactions to be included in the block but fail during execution,
372+
// instead of rejecting them outright at this point.
373+
if st.msg.IsL1MessageTx() {
374+
gas = st.gas
375+
} else {
376+
return nil, fmt.Errorf("%w: have %d, want %d", ErrIntrinsicGas, st.gas, gas)
377+
}
372378
}
373379
st.gas -= gas
374380

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

0 commit comments

Comments
 (0)
Please sign in to comment.