diff --git a/core/state_transition.go b/core/state_transition.go index 1bba04e2fa..3c829f7983 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -289,7 +289,7 @@ func (st *StateTransition) preCheck() error { } // This will panic if baseFee is nil, but basefee presence is verified // as part of header validation. - if (msg.To() == nil || *msg.To() != common.RandomizeSMCBinary) && st.gasFeeCap.Cmp(st.evm.Context.BaseFee) < 0 { + if !types.IsSpecialTx(msg.To()) && st.gasFeeCap.Cmp(st.evm.Context.BaseFee) < 0 { return fmt.Errorf("%w: address %v, maxFeePerGas: %s baseFee: %s", ErrFeeCapTooLow, msg.From().Hex(), st.gasFeeCap, st.evm.Context.BaseFee) } diff --git a/core/types/transaction.go b/core/types/transaction.go index e99519d5c7..273d33eb8b 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -482,11 +482,14 @@ func (tx *Transaction) TxCost(number *big.Int) *big.Int { return total } -func (tx *Transaction) IsSpecialTransaction() bool { - to := tx.To() +func IsSpecialTx(to *common.Address) bool { return to != nil && (*to == common.BlockSignersBinary || *to == common.RandomizeSMCBinary) } +func (tx *Transaction) IsSpecialTransaction() bool { + return IsSpecialTx(tx.To()) +} + func (tx *Transaction) IsTradingTransaction() bool { to := tx.To() return to != nil && *to == common.XDCXAddrBinary