From b5ea92bbe01608a1b22da7872327e6ccbf9aecfa Mon Sep 17 00:00:00 2001 From: liuhaoyang Date: Thu, 29 Feb 2024 15:48:21 +0800 Subject: [PATCH] sponsor percent should be more than zero --- core/types/meta_transaction.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/types/meta_transaction.go b/core/types/meta_transaction.go index 5511256f72..cd65343ace 100644 --- a/core/types/meta_transaction.go +++ b/core/types/meta_transaction.go @@ -22,7 +22,7 @@ var ( ErrExpiredMetaTx = errors.New("expired meta transaction") ErrInvalidGasFeeSponsorSig = errors.New("invalid gas fee sponsor signature") ErrGasFeeSponsorMismatch = errors.New("gas fee sponsor address is mismatch with signature") - ErrInvalidSponsorPercent = errors.New("invalid sponsor percent, expected range [0, 100]") + ErrInvalidSponsorPercent = errors.New("invalid sponsor percent, expected range (0, 100]") ErrSponsorBalanceNotEnough = errors.New("sponsor doesn't have enough balance") ) @@ -128,7 +128,8 @@ func DecodeAndVerifyMetaTxParams(tx *Transaction, isMetaTxUpgraded bool) (*MetaT return nil, nil } - if metaTxParams.SponsorPercent > OneHundredPercent { + if metaTxParams.SponsorPercent > OneHundredPercent || + metaTxParams.SponsorPercent == 0 { return nil, ErrInvalidSponsorPercent }