core: fix BlockSigner tx cause debug API fail after EIP-1559

This commit is contained in:
Daniel Liu 2025-02-20 11:25:55 +08:00
parent 783d46f29e
commit 4f8d11e11d
2 changed files with 6 additions and 3 deletions

View file

@ -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)
}

View file

@ -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