Repository: 33cn/plugin
Pull request #749 (2019-12-27 13:30:57)

Update tx fee config
33cn/chain33#695
同步chain33交易费配置修改

codecov[bot]: # [Codecov](https://codecov.io/gh/33cn/plugin/pull/749?src=pr&el=h1) Report
> Merging [#749](https://codecov.io/gh/33cn/plugin/pull/749?src=pr&el=desc) into [master](https://codecov.io/gh/33cn/plugin/commit/e97eda526202fa2fe8fd98067d00dbba413d8c67?src=pr&el=desc) will **increase** coverage by `0.05%`.
> The diff coverage is `66.66%`.

[![Impacted file tree graph](https://codecov.io/gh/33cn/plugin/pull/749/graphs/tree.svg?width=650&token=EwYhDbvpC8&height=150&src=pr)](https://codecov.io/gh/33cn/plugin/pull/749?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #749      +/-   ##
==========================================
+ Coverage   59.38%   59.43%   +0.05%     
==========================================
  Files         104      104              
  Lines       15846    15846              
==========================================
+ Hits         9410     9418       +8     
+ Misses       5576     5569       -7     
+ Partials      860      859       -1
```


| [Impacted Files](https://codecov.io/gh/33cn/plugin/pull/749?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [plugin/dapp/relay/cmd/relayd/relayd/relayd.go](https://codecov.io/gh/33cn/plugin/pull/749/diff?src=pr&el=tree#diff-cGx1Z2luL2RhcHAvcmVsYXkvY21kL3JlbGF5ZC9yZWxheWQvcmVsYXlkLmdv) | `0% <0%> (ø)` | :arrow_up: |
| [plugin/mempool/price/mempool.go](https://codecov.io/gh/33cn/plugin/pull/749/diff?src=pr&el=tree#diff-cGx1Z2luL21lbXBvb2wvcHJpY2UvbWVtcG9vbC5nbw==) | `83.33% <100%> (ø)` | :arrow_up: |
| [plugin/mempool/score/mempool.go](https://codecov.io/gh/33cn/plugin/pull/749/diff?src=pr&el=tree#diff-cGx1Z2luL21lbXBvb2wvc2NvcmUvbWVtcG9vbC5nbw==) | `83.33% <100%> (ø)` | :arrow_up: |
| [plugin/consensus/dpos/state\_machine.go](https://codecov.io/gh/33cn/plugin/pull/749/diff?src=pr&el=tree#diff-cGx1Z2luL2NvbnNlbnN1cy9kcG9zL3N0YXRlX21hY2hpbmUuZ28=) | `48.97% <0%> (+0.81%)` | :arrow_up: |
| [plugin/store/mpt/db/trie.go](https://codecov.io/gh/33cn/plugin/pull/749/diff?src=pr&el=tree#diff-cGx1Z2luL3N0b3JlL21wdC9kYi90cmllLmdv) | `56.34% <0%> (+1.17%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/33cn/plugin/pull/749?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/33cn/plugin/pull/749?src=pr&el=footer). Last update [e97eda5...6dd7d13](https://codecov.io/gh/33cn/plugin/pull/749?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

bysomeone: 已经更新 @vipwzw 

Patch:
diff --git a/chain33.para.toml b/chain33.para.toml
index d24944896..b2e527ac2 100644
--- a/chain33.para.toml
+++ b/chain33.para.toml
@@ -70,7 +70,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="para"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 maxTxNumPerAccount=10000
 
 [consensus]
@@ -162,8 +162,6 @@ signType="secp256k1"
 minerdisable=true
 
 [exec]
-isFree=true
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 
diff --git a/chain33.toml b/chain33.toml
index 2d00d3430..40d5f61b5 100644
--- a/chain33.toml
+++ b/chain33.toml
@@ -66,8 +66,12 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="price"
 poolCacheSize=10240
-minTxFee=100000
 maxTxNumPerAccount=100
+# 最小得交易手续费率，这个没有默认值，必填，一般是0.001 coins
+minTxFeeRate=100000
+# 最大的交易手续费率, 0.1 coins
+maxTxFeeRate=10000000
+# 单笔交易最大的手续费, 10 coins
 maxTxFee=1000000000
 isLevelFee=true
 [mempool.sub.timeline]
@@ -198,9 +202,6 @@ minerwhitelist=["*"]
 rescanMultisigAddr=false
 
 [exec]
-isFree=false
-minExecFee=100000
-maxExecFee=1000000000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
@@ -229,8 +230,8 @@ genesis="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
 
 [exec.sub.manage]
 superManager=[
-    "1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S", 
-    "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv", 
+    "1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S",
+    "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv",
     "1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
 ]
 [exec.sub.paracross]
diff --git a/go.mod b/go.mod
index e5d026e61..060900fdd 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/33cn/plugin
 go 1.12
 
 require (
-	github.com/33cn/chain33 v0.0.0-20191225114001-0e761fbcd8ce
+	github.com/33cn/chain33 v0.0.0-20191230031247-b56730d527a0
 	github.com/BurntSushi/toml v0.3.1
 	github.com/NebulousLabs/Sia v1.3.7
 	github.com/btcsuite/btcd v0.0.0-20181013004428-67e573d211ac
diff --git a/go.sum b/go.sum
index 9e84e0bb7..f922e4ce9 100644
--- a/go.sum
+++ b/go.sum
@@ -1,6 +1,6 @@
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-github.com/33cn/chain33 v0.0.0-20191225114001-0e761fbcd8ce h1:8w3fHBpsupag2ue5iwyIv8cp6va2LtvZuJ/OhvNEEpk=
-github.com/33cn/chain33 v0.0.0-20191225114001-0e761fbcd8ce/go.mod h1:4I8n+Zyf3t0UKM5jjpqJY627Tub62oXkLsdzIv4r6rQ=
+github.com/33cn/chain33 v0.0.0-20191230031247-b56730d527a0 h1:U8qOKXeidZsyGGy/KN5fNQV1B9l28DvG52Ezqiv+4nc=
+github.com/33cn/chain33 v0.0.0-20191230031247-b56730d527a0/go.mod h1:4I8n+Zyf3t0UKM5jjpqJY627Tub62oXkLsdzIv4r6rQ=
 github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7 h1:PqzgE6kAMi81xWQA2QIVxjWkFHptGgC547vchpUbtFo=
 github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
diff --git a/plugin/consensus/para/paracommitmsg.go b/plugin/consensus/para/paracommitmsg.go
index dcb752520..21857bb23 100644
--- a/plugin/consensus/para/paracommitmsg.go
+++ b/plugin/consensus/para/paracommitmsg.go
@@ -397,12 +397,12 @@ func (client *commitMsgClient) getTxsGroup(txsArr *types.Transactions) (*types.T
 		return tx, nil
 	}
 	cfg := client.paraClient.GetAPI().GetConfig()
-	group, err := types.CreateTxGroup(txsArr.Txs, cfg.GInt("MinFee"))
+	group, err := types.CreateTxGroup(txsArr.Txs, cfg.GetMinTxFeeRate())
 	if err != nil {
 		plog.Error("para CreateTxGroup", "err", err.Error())
 		return nil, err
 	}
-	err = group.Check(cfg, 0, cfg.GInt("MinFee"), cfg.GInt("MaxFee"))
+	err = group.Check(cfg, 0, cfg.GetMinTxFeeRate(), cfg.GetMaxTxFee())
 	if err != nil {
 		plog.Error("para CheckTxGroup", "err", err.Error())
 		return nil, err
diff --git a/plugin/dapp/evm/commands/evm.go b/plugin/dapp/evm/commands/evm.go
index bee50d018..cee2457aa 100644
--- a/plugin/dapp/evm/commands/evm.go
+++ b/plugin/dapp/evm/commands/evm.go
@@ -289,7 +289,7 @@ func createContract(cmd *cobra.Command, args []string) {
 func createEvmTx(cfg *types.Chain33Config, action proto.Message, execer, caller, addr, expire, rpcLaddr string, fee uint64) (string, error) {
 	tx := &types.Transaction{Execer: []byte(execer), Payload: types.Encode(action), Fee: 0, To: addr}
 
-	tx.Fee, _ = tx.GetRealFee(cfg.GInt("MinFee"))
+	tx.Fee, _ = tx.GetRealFee(cfg.GetMinTxFeeRate())
 	if tx.Fee < int64(fee) {
 		tx.Fee += int64(fee)
 	}
@@ -341,7 +341,7 @@ func createEvmTransferTx(cfg *types.Chain33Config, cmd *cobra.Command, caller, e
 	}
 
 	var err error
-	tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee"))
+	tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
 	if err != nil {
 		return "", err
 	}
diff --git a/plugin/dapp/evm/rpc/rpc.go b/plugin/dapp/evm/rpc/rpc.go
index 3c73922fd..63470cc26 100644
--- a/plugin/dapp/evm/rpc/rpc.go
+++ b/plugin/dapp/evm/rpc/rpc.go
@@ -33,7 +33,7 @@ func (c *channelClient) Create(ctx context.Context, in evmtypes.EvmContractCreat
 	addr := address.ExecAddress(cfg.ExecName(in.ParaName + "evm"))
 	tx := &types.Transaction{Execer: []byte(execer), Payload: types.Encode(&action), Fee: 0, To: addr}
 
-	tx.Fee, _ = tx.GetRealFee(cfg.GInt("MinFee"))
+	tx.Fee, _ = tx.GetRealFee(cfg.GetMinTxFeeRate())
 	if tx.Fee < in.Fee {
 		tx.Fee += in.Fee
 	}
@@ -62,7 +62,7 @@ func (c *channelClient) Call(ctx context.Context, in evmtypes.EvmContractCallReq
 	tx := &types.Transaction{Execer: []byte(in.Exec), Payload: types.Encode(&action), Fee: 0, To: toAddr}
 
 	cfg := c.GetConfig()
-	tx.Fee, _ = tx.GetRealFee(cfg.GInt("MinFee"))
+	tx.Fee, _ = tx.GetRealFee(cfg.GetMinTxFeeRate())
 	if tx.Fee < feeInt64 {
 		tx.Fee += feeInt64
 	}
@@ -96,7 +96,7 @@ func (c *channelClient) Transfer(ctx context.Context, in evmtypes.EvmContractTra
 	}
 
 	var err error
-	tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee"))
+	tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
 	if err != nil {
 		return nil, err
 	}
diff --git a/plugin/dapp/hashlock/commands/hashlock.go b/plugin/dapp/hashlock/commands/hashlock.go
index 0789199fb..222174fd8 100755
--- a/plugin/dapp/hashlock/commands/hashlock.go
+++ b/plugin/dapp/hashlock/commands/hashlock.go
@@ -69,7 +69,7 @@ func hashlockLockCmd(cmd *cobra.Command, args []string) {
 	delay, _ := cmd.Flags().GetInt64("delay")
 	amount, _ := cmd.Flags().GetFloat64("amount")
 
-	defaultFee := float64(cfg.GInt("MinFee")) / float64(types.Coin)
+	defaultFee := float64(cfg.GetMinTxFeeRate()) / float64(types.Coin)
 	fee, _ := cmd.Flags().GetFloat64("fee")
 	if fee < defaultFee {
 		fee = defaultFee
@@ -129,7 +129,7 @@ func hashlockUnlockCmd(cmd *cobra.Command, args []string) {
 	rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
 	secret, _ := cmd.Flags().GetString("secret")
 
-	defaultFee := float64(cfg.GInt("MinFee")) / float64(types.Coin)
+	defaultFee := float64(cfg.GetMinTxFeeRate()) / float64(types.Coin)
 	fee, _ := cmd.Flags().GetFloat64("fee")
 	if fee < defaultFee {
 		fee = defaultFee
@@ -172,7 +172,7 @@ func hashlockSendCmd(cmd *cobra.Command, args []string) {
 	rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
 	secret, _ := cmd.Flags().GetString("secret")
 
-	defaultFee := float64(cfg.GInt("MinFee")) / float64(types.Coin)
+	defaultFee := float64(cfg.GetMinTxFeeRate()) / float64(types.Coin)
 	fee, _ := cmd.Flags().GetFloat64("fee")
 	if fee < defaultFee {
 		fee = defaultFee
diff --git a/plugin/dapp/paracross/types/paracross.go b/plugin/dapp/paracross/types/paracross.go
index 7c02e8763..dd93665e4 100644
--- a/plugin/dapp/paracross/types/paracross.go
+++ b/plugin/dapp/paracross/types/paracross.go
@@ -307,7 +307,7 @@ func CreateRawMinerTx(cfg *types.Chain33Config, value *ParacrossMinerAction) (*t
 		Nonce:   0, //for consensus purpose, block hash need same, different auth node need keep totally same vote tx
 		To:      address.ExecAddress(cfg.ExecName(ParaX)),
 	}
-	err := tx.SetRealFee(cfg.GInt("MinFee"))
+	err := tx.SetRealFee(cfg.GetMinTxFeeRate())
 	if err != nil {
 		return nil, err
 	}
diff --git a/plugin/dapp/privacy/wallet/privacy.go b/plugin/dapp/privacy/wallet/privacy.go
index 663411842..4ee64527a 100644
--- a/plugin/dapp/privacy/wallet/privacy.go
+++ b/plugin/dapp/privacy/wallet/privacy.go
@@ -543,7 +543,7 @@ func (policy *privacyPolicy) createPublic2PrivacyTx(req *privacytypes.ReqCreateP
 			ActionType: action.Ty,
 		}),
 	}
-	tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee"))
+	tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
 	if err != nil {
 		bizlog.Error("createPublic2PrivacyTx", "calc fee failed", err)
 		return nil, err
@@ -622,7 +622,7 @@ func (policy *privacyPolicy) createPrivacy2PrivacyTx(req *privacytypes.ReqCreate
 	}
 	tx.SetExpire(cfg, time.Duration(req.Expire))
 	if !isMainetCoins {
-		tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee"))
+		tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
 		if err != nil {
 			bizlog.Error("createPrivacy2PrivacyTx", "calc fee failed", err)
 			return nil, err
@@ -711,7 +711,7 @@ func (policy *privacyPolicy) createPrivacy2PublicTx(req *privacytypes.ReqCreateP
 	}
 	tx.SetExpire(cfg, time.Duration(req.Expire))
 	if !isMainetCoins {
-		tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee"))
+		tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
 		if err != nil {
 			bizlog.Error("createPrivacy2PublicTx", "calc fee failed", err)
 			return nil, err
diff --git a/plugin/dapp/relay/cmd/relayd/relayd/relayd.go b/plugin/dapp/relay/cmd/relayd/relayd/relayd.go
index 7e71a62f7..8e606a93d 100644
--- a/plugin/dapp/relay/cmd/relayd/relayd/relayd.go
+++ b/plugin/dapp/relay/cmd/relayd/relayd/relayd.go
@@ -327,7 +327,7 @@ func (r *Relayd) transaction(payload []byte) *types.Transaction {
 
 	minFee := types.DefaultMinFee
 	if r.config.Chain33Cfg != nil {
-		minFee = r.config.Chain33Cfg.GInt("MinFee")
+		minFee = r.config.Chain33Cfg.GetMinTxFeeRate()
 	}
 	fee, _ := tx.GetRealFee(minFee)
 	tx.Fee = fee
diff --git a/plugin/dapp/retrieve/cmd/retrieve.go b/plugin/dapp/retrieve/cmd/retrieve.go
index e0319f0d1..13b248418 100644
--- a/plugin/dapp/retrieve/cmd/retrieve.go
+++ b/plugin/dapp/retrieve/cmd/retrieve.go
@@ -72,7 +72,7 @@ func backupCmd(cmd *cobra.Command, args []string) {
 	defaultAddr, _ := cmd.Flags().GetString("default")
 	delay, _ := cmd.Flags().GetInt64("delay")
 
-	defaultFee := float64(cfg.GInt("MinFee")) / float64(types.Coin)
+	defaultFee := float64(cfg.GetMinTxFeeRate()) / float64(types.Coin)
 	fee, _ := cmd.Flags().GetFloat64("fee")
 	if fee < defaultFee {
 		fee = defaultFee
@@ -133,7 +133,7 @@ func prepareCmd(cmd *cobra.Command, args []string) {
 	backup, _ := cmd.Flags().GetString("backup")
 	defaultAddr, _ := cmd.Flags().GetString("default")
 
-	defaultFee := float64(cfg.GInt("MinFee")) / float64(types.Coin)
+	defaultFee := float64(cfg.GetMinTxFeeRate()) / float64(types.Coin)
 	fee, _ := cmd.Flags().GetFloat64("fee")
 	if fee < defaultFee {
 		fee = defaultFee
@@ -168,7 +168,7 @@ func performCmd(cmd *cobra.Command, args []string) {
 	backup, _ := cmd.Flags().GetString("backup")
 	defaultAddr, _ := cmd.Flags().GetString("default")
 
-	defaultFee := float64(cfg.GInt("MinFee")) / float64(types.Coin)
+	defaultFee := float64(cfg.GetMinTxFeeRate()) / float64(types.Coin)
 	fee, _ := cmd.Flags().GetFloat64("fee")
 	if fee < defaultFee {
 		fee = defaultFee
@@ -215,7 +215,7 @@ func cancelCmd(cmd *cobra.Command, args []string) {
 	backup, _ := cmd.Flags().GetString("backup")
 	defaultAddr, _ := cmd.Flags().GetString("default")
 
-	defaultFee := float64(cfg.GInt("MinFee")) / float64(types.Coin)
+	defaultFee := float64(cfg.GetMinTxFeeRate()) / float64(types.Coin)
 	fee, _ := cmd.Flags().GetFloat64("fee")
 	if fee < defaultFee {
 		fee = defaultFee
diff --git a/plugin/dapp/unfreeze/types/types.go b/plugin/dapp/unfreeze/types/types.go
index 244ec441b..060acec8b 100644
--- a/plugin/dapp/unfreeze/types/types.go
+++ b/plugin/dapp/unfreeze/types/types.go
@@ -146,7 +146,7 @@ func CreateUnfreezeCreateTx(cfg *types.Chain33Config, title string, parm *Unfree
 		Nonce:   rand.New(rand.NewSource(time.Now().UnixNano())).Int63(),
 		To:      address.ExecAddress(getRealExecName(cfg, cfg.GetParaName())),
 	}
-	tx.SetRealFee(cfg.GInt("MinFee"))
+	tx.SetRealFee(cfg.GetMinTxFeeRate())
 	return tx, nil
 }
 
@@ -175,7 +175,7 @@ func CreateUnfreezeWithdrawTx(cfg *types.Chain33Config, title string, parm *Unfr
 		Nonce:   rand.New(rand.NewSource(time.Now().UnixNano())).Int63(),
 		To:      address.ExecAddress(getRealExecName(cfg, cfg.GetParaName())),
 	}
-	tx.SetRealFee(cfg.GInt("MinFee"))
+	tx.SetRealFee(cfg.GetMinTxFeeRate())
 	return tx, nil
 }
 
@@ -204,7 +204,7 @@ func CreateUnfreezeTerminateTx(cfg *types.Chain33Config, title string, parm *Unf
 		Nonce:   rand.New(rand.NewSource(time.Now().UnixNano())).Int63(),
 		To:      address.ExecAddress(getRealExecName(cfg, cfg.GetParaName())),
 	}
-	tx.SetRealFee(cfg.GInt("MinFee"))
+	tx.SetRealFee(cfg.GetMinTxFeeRate())
 	return tx, nil
 }
 
diff --git a/plugin/dapp/valnode/commands/valnode.go b/plugin/dapp/valnode/commands/valnode.go
index eb6d64a4a..5e6e2f1e6 100644
--- a/plugin/dapp/valnode/commands/valnode.go
+++ b/plugin/dapp/valnode/commands/valnode.go
@@ -167,7 +167,7 @@ func addNode(cmd *cobra.Command, args []string) {
 	value := &vt.ValNodeAction_Node{Node: &vt.ValNode{PubKey: pubkeybyte, Power: power}}
 	action := &vt.ValNodeAction{Value: value, Ty: vt.ValNodeActionUpdate}
 	tx := &types.Transaction{Execer: []byte(vt.ValNodeX), Payload: types.Encode(action), Fee: 0}
-	err = tx.SetRealFee(cfg.GInt("MinFee"))
+	err = tx.SetRealFee(cfg.GetMinTxFeeRate())
 	if err != nil {
 		fmt.Fprintln(os.Stderr, err)
 		return
diff --git a/plugin/mempool/price/mempool.go b/plugin/mempool/price/mempool.go
index 3786a1a1c..2ac63c755 100644
--- a/plugin/mempool/price/mempool.go
+++ b/plugin/mempool/price/mempool.go
@@ -27,7 +27,7 @@ func New(cfg *types.Mempool, sub []byte) queue.Module {
 		subcfg.PoolCacheSize = cfg.PoolCacheSize
 	}
 	if subcfg.ProperFee == 0 {
-		subcfg.ProperFee = cfg.MinTxFee
+		subcfg.ProperFee = cfg.MinTxFeeRate
 	}
 	c.SetQueueCache(NewQueue(subcfg))
 	return c
diff --git a/plugin/mempool/score/mempool.go b/plugin/mempool/score/mempool.go
index 8e769365f..b44e66dcd 100644
--- a/plugin/mempool/score/mempool.go
+++ b/plugin/mempool/score/mempool.go
@@ -30,7 +30,7 @@ func New(cfg *types.Mempool, sub []byte) queue.Module {
 		subcfg.PoolCacheSize = cfg.PoolCacheSize
 	}
 	if subcfg.ProperFee == 0 {
-		subcfg.ProperFee = cfg.MinTxFee
+		subcfg.ProperFee = cfg.MinTxFeeRate
 	}
 	c.SetQueueCache(NewQueue(subcfg))
 	return c


Test patch:
diff --git a/build/autotest/run.sh b/build/autotest/run.sh
index 0d7866b46..57dc9d85e 100755
--- a/build/autotest/run.sh
+++ b/build/autotest/run.sh
@@ -13,14 +13,7 @@ if [ "$(uname)" == "Darwin" ]; then
 fi
 
 ## get chain33 path
-CHAIN33_PATH=$(grep -m1 github.com/33cn/chain33 ../../go.mod | grep -o '[^ ]\+$')
-CHAIN33_PATH="${CHAIN33_PATH%/}"
-if [[ -d ../../${CHAIN33_PATH} ]]; then
-    CHAIN33_PATH=../../"$CHAIN33_PATH"
-
-elif [[ ! -d ${CHAIN33_PATH} ]]; then
-    CHAIN33_PATH="${GOPATH}"/pkg/mod/github.com/33cn/chain33@"$CHAIN33_PATH"
-fi
+CHAIN33_PATH=$(go list -f "{{.Dir}}" github.com/33cn/chain33)
 
 function build_auto_test() {
 
diff --git a/plugin/consensus/dpos/chain33.test.toml b/plugin/consensus/dpos/chain33.test.toml
index 7b1a5eb51..1581db034 100644
--- a/plugin/consensus/dpos/chain33.test.toml
+++ b/plugin/consensus/dpos/chain33.test.toml
@@ -62,7 +62,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 
 [consensus]
 name="tendermint"
@@ -135,8 +135,6 @@ minerdisable=false
 minerwhitelist=["*"]
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
diff --git a/plugin/consensus/dpos/node_test.go b/plugin/consensus/dpos/node_test.go
index adbc6aa38..d9c5d095f 100644
--- a/plugin/consensus/dpos/node_test.go
+++ b/plugin/consensus/dpos/node_test.go
@@ -103,7 +103,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 
 [consensus]
 name="dpos"
@@ -176,8 +176,6 @@ minerdisable=false
 minerwhitelist=["*"]
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
@@ -256,7 +254,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 
 [consensus]
 name="dpos"
@@ -350,8 +348,6 @@ minerdisable=false
 minerwhitelist=["*"]
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
diff --git a/plugin/consensus/para/para_test.go b/plugin/consensus/para/para_test.go
index 7fdf45adc..64d7fa7e3 100644
--- a/plugin/consensus/para/para_test.go
+++ b/plugin/consensus/para/para_test.go
@@ -74,11 +74,11 @@ func createCrossParaTempTx(cfg *types.Chain33Config, to string, amount int64) (*
 
 func createTxsGroup(cfg *types.Chain33Config, txs []*types.Transaction) ([]*types.Transaction, error) {
 
-	group, err := types.CreateTxGroup(txs, cfg.GInt("MinFee"))
+	group, err := types.CreateTxGroup(txs, cfg.GetMinTxFeeRate())
 	if err != nil {
 		return nil, err
 	}
-	err = group.Check(cfg, 0, cfg.GInt("MinFee"), cfg.GInt("MaxFee"))
+	err = group.Check(cfg, 0, cfg.GetMinTxFeeRate(), cfg.GetMaxTxFee())
 	if err != nil {
 		return nil, err
 	}
diff --git a/plugin/consensus/pbft/chain33.test.toml b/plugin/consensus/pbft/chain33.test.toml
index c9bc6941e..12bf560ac 100644
--- a/plugin/consensus/pbft/chain33.test.toml
+++ b/plugin/consensus/pbft/chain33.test.toml
@@ -53,7 +53,7 @@ verMax=119
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 
 [rpc]
 jrpcBindAddr="localhost:8801"
@@ -104,8 +104,6 @@ minerdisable=false
 minerwhitelist=["*"]
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
diff --git a/plugin/consensus/raft/chain33.test.toml b/plugin/consensus/raft/chain33.test.toml
index 9d3c02805..703784475 100644
--- a/plugin/consensus/raft/chain33.test.toml
+++ b/plugin/consensus/raft/chain33.test.toml
@@ -61,7 +61,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 maxTxNumPerAccount=100
 
 [mempool.sub.timeline]
@@ -140,8 +140,6 @@ minerWaitTime="1s"
 
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
@@ -167,4 +165,4 @@ superManager=[
 
 [exec.sub.autonomy]
 total="16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
-useBalance=false
\ No newline at end of file
+useBalance=false
diff --git a/plugin/consensus/tendermint/chain33.test.toml b/plugin/consensus/tendermint/chain33.test.toml
index 1c6260d41..dab3239f8 100644
--- a/plugin/consensus/tendermint/chain33.test.toml
+++ b/plugin/consensus/tendermint/chain33.test.toml
@@ -62,7 +62,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 
 [consensus]
 name="tendermint"
@@ -117,8 +117,6 @@ minerdisable=false
 minerwhitelist=["*"]
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
diff --git a/plugin/consensus/ticket/testdata/chain33.cfg.toml b/plugin/consensus/ticket/testdata/chain33.cfg.toml
index 9e5f86897..3308cf1db 100644
--- a/plugin/consensus/ticket/testdata/chain33.cfg.toml
+++ b/plugin/consensus/ticket/testdata/chain33.cfg.toml
@@ -63,7 +63,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 maxTxNumPerAccount=10000
 
 [consensus]
@@ -149,8 +149,6 @@ minerwhitelist=["*"]
 minerWaitTime="1s"
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
@@ -179,8 +177,8 @@ signType="auth_ecdsa"
 
 [exec.sub.manage]
 superManager=[
-    "1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S", 
-    "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv", 
+    "1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S",
+    "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv",
     "1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
 ]
 
diff --git a/plugin/dapp/cert/authority/authority_test.go b/plugin/dapp/cert/authority/authority_test.go
index 22827067c..3e41a2421 100644
--- a/plugin/dapp/cert/authority/authority_test.go
+++ b/plugin/dapp/cert/authority/authority_test.go
@@ -325,7 +325,7 @@ func TestValidateCerts(t *testing.T) {
 		t.Errorf("init env failed, error:%s", err)
 	}
 
-	prev := types.GInt("MinFee")
+	prev := types.GetMinTxFeeRate()
 	types.SetMinFee(0)
 	defer types.SetMinFee(prev)
 
diff --git a/plugin/dapp/cert/authority/test/chain33.auth.test.toml b/plugin/dapp/cert/authority/test/chain33.auth.test.toml
index ae17b1e27..5c4a4854c 100644
--- a/plugin/dapp/cert/authority/test/chain33.auth.test.toml
+++ b/plugin/dapp/cert/authority/test/chain33.auth.test.toml
@@ -57,7 +57,7 @@ grpcFuncWhitelist=["*"]
 
 [mempool]
 poolCacheSize=10240
-minTxFee=1000000
+minTxFeeRate=0
 
 [consensus]
 name="solo"
@@ -81,8 +81,6 @@ signType="secp256k1"
 minerwhitelist=["*"]
 
 [exec]
-isFree=true
-minExecFee=0
 enableStat=false
 
 [exec.sub.cert]
diff --git a/plugin/dapp/dposvote/commands/vote_test.go b/plugin/dapp/dposvote/commands/vote_test.go
index 5a8a140eb..6ad320c51 100644
--- a/plugin/dapp/dposvote/commands/vote_test.go
+++ b/plugin/dapp/dposvote/commands/vote_test.go
@@ -116,7 +116,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 
 [consensus]
 name="tendermint"
@@ -189,8 +189,6 @@ minerdisable=false
 minerwhitelist=["*"]
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
diff --git a/plugin/dapp/guess/commands/game_test.go b/plugin/dapp/guess/commands/game_test.go
index b81f6d7c1..61c39e807 100644
--- a/plugin/dapp/guess/commands/game_test.go
+++ b/plugin/dapp/guess/commands/game_test.go
@@ -144,7 +144,7 @@ name="timeline"
 # mempool缓存容量大小，默认10240
 poolCacheSize=10240
 # 最小得交易手续费用，这个没有默认值，必填，一般是100000
-minTxFee=100000
+minTxFeeRate=100000
 # 每个账户在mempool中得最大交易数量，默认100
 maxTxNumPerAccount=10000
 # timeline 是默认的先来先进的按时间排序
@@ -152,7 +152,7 @@ maxTxNumPerAccount=10000
 # mempool缓存容量大小，默认10240
 poolCacheSize=10240
 # 最小得交易手续费用，这个没有默认值，必填，一般是100000
-minTxFee=100000
+minTxFeeRate=100000
 # 每个账户在mempool中得最大交易数量，默认100
 maxTxNumPerAccount=10000
 # score是分数队列模式(分数=常量a*手续费/交易字节数-常量b*时间*定量c，按分数排队，高的优先，常量a，b和定量c可配置)，按分数来排序
@@ -160,7 +160,7 @@ maxTxNumPerAccount=10000
 # mempool缓存容量大小，默认10240
 poolCacheSize=10240
 # 最小得交易手续费用，这个没有默认值，必填，一般是100000
-minTxFee=100000
+minTxFeeRate=100000
 # 每个账户在mempool中得最大交易数量，默认100
 maxTxNumPerAccount=10000
 # 时间占价格比例
@@ -174,7 +174,7 @@ pricePower=1
 # mempool缓存容量大小，默认10240
 poolCacheSize=10240
 # 最小得交易手续费用，这个没有默认值，必填，一般是100000
-minTxFee=100000
+minTxFeeRate=100000
 # 每个账户在mempool中得最大交易数量，默认100
 maxTxNumPerAccount=10000
 [consensus]
@@ -256,10 +256,6 @@ minerdisable=false
 # 允许购买ticket挖矿的白名单地址，默认配置“*”，允许所有地址购买
 minerwhitelist=["*"]
 [exec]
-#执行器执行是否免费
-isFree=false
-#执行器执行所需最小费用,低于Mempool和Wallet设置的MinFee,在minExecFee = 0 的情况下，isFree = true才会生效
-minExecFee=100000
 #是否开启stat插件
 enableStat=false
 #是否开启MVCC插件
diff --git a/plugin/dapp/guess/rpc/guess_test.go b/plugin/dapp/guess/rpc/guess_test.go
index 91c2f7dc5..2364dbd18 100644
--- a/plugin/dapp/guess/rpc/guess_test.go
+++ b/plugin/dapp/guess/rpc/guess_test.go
@@ -147,7 +147,7 @@ name="timeline"
 # mempool缓存容量大小，默认10240
 poolCacheSize=10240
 # 最小得交易手续费用，这个没有默认值，必填，一般是100000
-minTxFee=100000
+minTxFeeRate=100000
 # 每个账户在mempool中得最大交易数量，默认100
 maxTxNumPerAccount=10000
 # timeline 是默认的先来先进的按时间排序
@@ -155,7 +155,7 @@ maxTxNumPerAccount=10000
 # mempool缓存容量大小，默认10240
 poolCacheSize=10240
 # 最小得交易手续费用，这个没有默认值，必填，一般是100000
-minTxFee=100000
+minTxFeeRate=100000
 # 每个账户在mempool中得最大交易数量，默认100
 maxTxNumPerAccount=10000
 # score是分数队列模式(分数=常量a*手续费/交易字节数-常量b*时间*定量c，按分数排队，高的优先，常量a，b和定量c可配置)，按分数来排序
@@ -163,7 +163,7 @@ maxTxNumPerAccount=10000
 # mempool缓存容量大小，默认10240
 poolCacheSize=10240
 # 最小得交易手续费用，这个没有默认值，必填，一般是100000
-minTxFee=100000
+minTxFeeRate=100000
 # 每个账户在mempool中得最大交易数量，默认100
 maxTxNumPerAccount=10000
 # 时间占价格比例
@@ -177,7 +177,7 @@ pricePower=1
 # mempool缓存容量大小，默认10240
 poolCacheSize=10240
 # 最小得交易手续费用，这个没有默认值，必填，一般是100000
-minTxFee=100000
+minTxFeeRate=100000
 # 每个账户在mempool中得最大交易数量，默认100
 maxTxNumPerAccount=10000
 [consensus]
@@ -259,10 +259,6 @@ minerdisable=false
 # 允许购买ticket挖矿的白名单地址，默认配置“*”，允许所有地址购买
 minerwhitelist=["*"]
 [exec]
-#执行器执行是否免费
-isFree=false
-#执行器执行所需最小费用,低于Mempool和Wallet设置的MinFee,在minExecFee = 0 的情况下，isFree = true才会生效
-minExecFee=100000
 #是否开启stat插件
 enableStat=false
 #是否开启MVCC插件
diff --git a/plugin/dapp/paracross/cmd/build/chain33.para.test.toml b/plugin/dapp/paracross/cmd/build/chain33.para.test.toml
index 04861165e..d6e94e858 100644
--- a/plugin/dapp/paracross/cmd/build/chain33.para.test.toml
+++ b/plugin/dapp/paracross/cmd/build/chain33.para.test.toml
@@ -65,7 +65,7 @@ mainnetJrpcAddr= "http://localhost:8801"
 [mempool]
 name="para"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 maxTxNumPerAccount=10000
 
 [consensus]
@@ -131,8 +131,6 @@ signType="secp256k1"
 minerwhitelist=["*"]
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 
diff --git a/plugin/dapp/paracross/executor/paracross_test.go b/plugin/dapp/paracross/executor/paracross_test.go
index 8f9ddfc9a..4d55b81d4 100644
--- a/plugin/dapp/paracross/executor/paracross_test.go
+++ b/plugin/dapp/paracross/executor/paracross_test.go
@@ -735,11 +735,11 @@ func createCrossCommitTx(s suite.Suite) (*types.Transaction, error) {
 }
 
 func createTxsGroup(s suite.Suite, txs []*types.Transaction) ([]*types.Transaction, error) {
-	group, err := types.CreateTxGroup(txs, chain33TestCfg.GInt("MinFee"))
+	group, err := types.CreateTxGroup(txs, chain33TestCfg.GetMinTxFeeRate())
 	if err != nil {
 		return nil, err
 	}
-	err = group.Check(chain33TestCfg, 0, chain33TestCfg.GInt("MinFee"), chain33TestCfg.GInt("MaxFee"))
+	err = group.Check(chain33TestCfg, 0, chain33TestCfg.GetMinTxFeeRate(), chain33TestCfg.GetMaxTxFee())
 	if err != nil {
 		return nil, err
 	}
diff --git a/plugin/dapp/paracross/testnode/cfg.go b/plugin/dapp/paracross/testnode/cfg.go
index d3c55e073..4dcf425c7 100644
--- a/plugin/dapp/paracross/testnode/cfg.go
+++ b/plugin/dapp/paracross/testnode/cfg.go
@@ -70,7 +70,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 maxTxNumPerAccount=10000
 
 [mempool.sub.para]
@@ -148,8 +148,6 @@ signType="secp256k1"
 minerdisable=true
 
 [exec]
-isFree=true
-minExecFee=100000
 enableStat=false
 
 [exec.sub.relay]
diff --git a/plugin/dapp/privacy/wallet/privacy_test.go b/plugin/dapp/privacy/wallet/privacy_test.go
index 1ea2c08ad..26a62280c 100644
--- a/plugin/dapp/privacy/wallet/privacy_test.go
+++ b/plugin/dapp/privacy/wallet/privacy_test.go
@@ -220,7 +220,7 @@ func (mock *PrivacyMock) createPublic2PrivacyTx(req *ty.ReqCreatePrivacyTx) *typ
 	}
 	cfg := mock.walletOp.GetAPI().GetConfig()
 	txSize := types.Size(tx) + types.SignatureSize
-	realFee := int64((txSize+1023)>>types.Size1Kshiftlen) * cfg.GInt("MinFee")
+	realFee := int64((txSize+1023)>>types.Size1Kshiftlen) * cfg.GetMinTxFeeRate()
 	tx.Fee = realFee
 	tx.SetExpire(cfg, time.Hour)
 	return tx
diff --git a/plugin/dapp/ticket/executor/testdata/chain33.cfg.toml b/plugin/dapp/ticket/executor/testdata/chain33.cfg.toml
index 97aec8944..61cb97a8a 100644
--- a/plugin/dapp/ticket/executor/testdata/chain33.cfg.toml
+++ b/plugin/dapp/ticket/executor/testdata/chain33.cfg.toml
@@ -62,7 +62,7 @@ grpcFuncWhitelist=["*"]
 [mempool]
 name="timeline"
 poolCacheSize=10240
-minTxFee=100000
+minTxFeeRate=100000
 maxTxNumPerAccount=10000
 
 [consensus]
@@ -158,8 +158,6 @@ minerwhitelist=["*"]
 minerWaitTime="1s"
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 alias=["token1:token","token2:token","token3:token"]
diff --git a/plugin/dapp/ticket/rpc/rpc_test.go b/plugin/dapp/ticket/rpc/rpc_test.go
index 7b756c462..300658f18 100755
--- a/plugin/dapp/ticket/rpc/rpc_test.go
+++ b/plugin/dapp/ticket/rpc/rpc_test.go
@@ -208,12 +208,10 @@ Title="test"
 
 [mempool]
 poolCacheSize=102400
-minTxFee=100000
+minTxFeeRate=100000
 maxTxNumPerAccount=100
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 
diff --git a/plugin/mempool/price/cache_test.go b/plugin/mempool/price/cache_test.go
index d27c95291..33709dbed 100644
--- a/plugin/mempool/price/cache_test.go
+++ b/plugin/mempool/price/cache_test.go
@@ -212,7 +212,7 @@ func TestRealNodeMempool(t *testing.T) {
 				//发送交易组
 				tx1 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.Coin/1000)
 				tx2 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.Coin/1000)
-				txgroup, err := types.CreateTxGroup([]*types.Transaction{tx1, tx2}, cfg.GInt("MinFee"))
+				txgroup, err := types.CreateTxGroup([]*types.Transaction{tx1, tx2}, cfg.GetMinTxFeeRate())
 				if err != nil {
 					log.Println(err)
 					continue
diff --git a/plugin/mempool/price/chain33.test.toml b/plugin/mempool/price/chain33.test.toml
index 6c290d8e9..6df769f2e 100644
--- a/plugin/mempool/price/chain33.test.toml
+++ b/plugin/mempool/price/chain33.test.toml
@@ -66,7 +66,7 @@ keyFile="key.pem"
 [mempool]
 name="price"
 poolCacheSize=200
-minTxFee=100000
+minTxFeeRate=100000
 maxTxNumPerAccount=100
 
 [mempool.sub.timeline]
@@ -161,8 +161,6 @@ signType="secp256k1"
 minerwhitelist=["*"]
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false
 
diff --git a/plugin/mempool/score/cache_test.go b/plugin/mempool/score/cache_test.go
index f93d620df..a29675638 100644
--- a/plugin/mempool/score/cache_test.go
+++ b/plugin/mempool/score/cache_test.go
@@ -188,7 +188,7 @@ func TestRealNodeMempool(t *testing.T) {
 				//发送交易组
 				tx1 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.Coin/1000)
 				tx2 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.Coin/1000)
-				txgroup, err := types.CreateTxGroup([]*types.Transaction{tx1, tx2}, cfg.GInt("MinFee"))
+				txgroup, err := types.CreateTxGroup([]*types.Transaction{tx1, tx2}, cfg.GetMinTxFeeRate())
 				if err != nil {
 					log.Println(err)
 					continue
diff --git a/plugin/mempool/score/chain33.test.toml b/plugin/mempool/score/chain33.test.toml
index 5df78079f..63cafa09d 100644
--- a/plugin/mempool/score/chain33.test.toml
+++ b/plugin/mempool/score/chain33.test.toml
@@ -66,7 +66,7 @@ keyFile="key.pem"
 [mempool]
 name="score"
 poolCacheSize=200
-minTxFee=100000
+minTxFeeRate=100000
 maxTxNumPerAccount=100
 
 [mempool.sub.timeline]
@@ -160,8 +160,6 @@ signType="secp256k1"
 minerwhitelist=["*"]
 
 [exec]
-isFree=false
-minExecFee=100000
 enableStat=false
 enableMVCC=false