core: fix preCheck for RandomizeSMC after EIP-1559

This commit is contained in:
Daniel Liu 2024-11-19 14:19:57 +08:00
parent 370c6b62e7
commit 4855f19261

View file

@ -267,7 +267,7 @@ func (st *StateTransition) preCheck() error {
} }
// This will panic if baseFee is nil, but basefee presence is verified // This will panic if baseFee is nil, but basefee presence is verified
// as part of header validation. // as part of header validation.
if st.gasFeeCap.Cmp(st.evm.Context.BaseFee) < 0 { if (msg.To() == nil || *msg.To() != common.RandomizeSMCBinary) && st.gasFeeCap.Cmp(st.evm.Context.BaseFee) < 0 {
return fmt.Errorf("%w: address %v, maxFeePerGas: %s baseFee: %s", ErrFeeCapTooLow, return fmt.Errorf("%w: address %v, maxFeePerGas: %s baseFee: %s", ErrFeeCapTooLow,
msg.From().Hex(), st.gasFeeCap, st.evm.Context.BaseFee) msg.From().Hex(), st.gasFeeCap, st.evm.Context.BaseFee)
} }