Commit 6a3fd8fe authored by jiangpeng's avatar jiangpeng Committed by vipwzw

sync chain33 tx fee config

parent 54e4e578
...@@ -70,7 +70,7 @@ grpcFuncWhitelist=["*"] ...@@ -70,7 +70,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="para" name="para"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
[consensus] [consensus]
...@@ -162,8 +162,6 @@ signType="secp256k1" ...@@ -162,8 +162,6 @@ signType="secp256k1"
minerdisable=true minerdisable=true
[exec] [exec]
isFree=true
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
......
...@@ -66,8 +66,12 @@ grpcFuncWhitelist=["*"] ...@@ -66,8 +66,12 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="price" name="price"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000
maxTxNumPerAccount=100 maxTxNumPerAccount=100
# 最小得交易手续费率,这个没有默认值,必填,一般是0.001 coins
minTxFeeRate=100000
# 最大的交易手续费率, 0.1 coins
maxTxFeeRate=10000000
# 单笔交易最大的手续费, 10 coins
maxTxFee=1000000000 maxTxFee=1000000000
isLevelFee=true isLevelFee=true
[mempool.sub.timeline] [mempool.sub.timeline]
...@@ -198,9 +202,6 @@ minerwhitelist=["*"] ...@@ -198,9 +202,6 @@ minerwhitelist=["*"]
rescanMultisigAddr=false rescanMultisigAddr=false
[exec] [exec]
isFree=false
minExecFee=100000
maxExecFee=1000000000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
...@@ -229,8 +230,8 @@ genesis="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv" ...@@ -229,8 +230,8 @@ genesis="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
[exec.sub.manage] [exec.sub.manage]
superManager=[ superManager=[
"1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S", "1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S",
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv", "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv",
"1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK" "1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
] ]
[exec.sub.paracross] [exec.sub.paracross]
......
...@@ -62,7 +62,7 @@ grpcFuncWhitelist=["*"] ...@@ -62,7 +62,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
[consensus] [consensus]
name="tendermint" name="tendermint"
...@@ -135,8 +135,6 @@ minerdisable=false ...@@ -135,8 +135,6 @@ minerdisable=false
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
......
...@@ -103,7 +103,7 @@ grpcFuncWhitelist=["*"] ...@@ -103,7 +103,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
[consensus] [consensus]
name="dpos" name="dpos"
...@@ -176,8 +176,6 @@ minerdisable=false ...@@ -176,8 +176,6 @@ minerdisable=false
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
...@@ -256,7 +254,7 @@ grpcFuncWhitelist=["*"] ...@@ -256,7 +254,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
[consensus] [consensus]
name="dpos" name="dpos"
...@@ -350,8 +348,6 @@ minerdisable=false ...@@ -350,8 +348,6 @@ minerdisable=false
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
......
...@@ -74,11 +74,11 @@ func createCrossParaTempTx(cfg *types.Chain33Config, to string, amount int64) (* ...@@ -74,11 +74,11 @@ func createCrossParaTempTx(cfg *types.Chain33Config, to string, amount int64) (*
func createTxsGroup(cfg *types.Chain33Config, txs []*types.Transaction) ([]*types.Transaction, error) { 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 { if err != nil {
return nil, err 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 { if err != nil {
return nil, err return nil, err
} }
......
...@@ -397,12 +397,12 @@ func (client *commitMsgClient) getTxsGroup(txsArr *types.Transactions) (*types.T ...@@ -397,12 +397,12 @@ func (client *commitMsgClient) getTxsGroup(txsArr *types.Transactions) (*types.T
return tx, nil return tx, nil
} }
cfg := client.paraClient.GetAPI().GetConfig() 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 { if err != nil {
plog.Error("para CreateTxGroup", "err", err.Error()) plog.Error("para CreateTxGroup", "err", err.Error())
return nil, err 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 { if err != nil {
plog.Error("para CheckTxGroup", "err", err.Error()) plog.Error("para CheckTxGroup", "err", err.Error())
return nil, err return nil, err
......
...@@ -53,7 +53,7 @@ verMax=119 ...@@ -53,7 +53,7 @@ verMax=119
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
[rpc] [rpc]
jrpcBindAddr="localhost:8801" jrpcBindAddr="localhost:8801"
...@@ -104,8 +104,6 @@ minerdisable=false ...@@ -104,8 +104,6 @@ minerdisable=false
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
......
...@@ -61,7 +61,7 @@ grpcFuncWhitelist=["*"] ...@@ -61,7 +61,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
maxTxNumPerAccount=100 maxTxNumPerAccount=100
[mempool.sub.timeline] [mempool.sub.timeline]
...@@ -140,8 +140,6 @@ minerWaitTime="1s" ...@@ -140,8 +140,6 @@ minerWaitTime="1s"
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
...@@ -167,4 +165,4 @@ superManager=[ ...@@ -167,4 +165,4 @@ superManager=[
[exec.sub.autonomy] [exec.sub.autonomy]
total="16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp" total="16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
useBalance=false useBalance=false
\ No newline at end of file
...@@ -62,7 +62,7 @@ grpcFuncWhitelist=["*"] ...@@ -62,7 +62,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
[consensus] [consensus]
name="tendermint" name="tendermint"
...@@ -117,8 +117,6 @@ minerdisable=false ...@@ -117,8 +117,6 @@ minerdisable=false
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
......
...@@ -63,7 +63,7 @@ grpcFuncWhitelist=["*"] ...@@ -63,7 +63,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
[consensus] [consensus]
...@@ -149,8 +149,6 @@ minerwhitelist=["*"] ...@@ -149,8 +149,6 @@ minerwhitelist=["*"]
minerWaitTime="1s" minerWaitTime="1s"
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
...@@ -179,8 +177,8 @@ signType="auth_ecdsa" ...@@ -179,8 +177,8 @@ signType="auth_ecdsa"
[exec.sub.manage] [exec.sub.manage]
superManager=[ superManager=[
"1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S", "1Bsg9j6gW83sShoee1fZAt9TkUjcrCgA9S",
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv", "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv",
"1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK" "1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
] ]
......
...@@ -325,7 +325,7 @@ func TestValidateCerts(t *testing.T) { ...@@ -325,7 +325,7 @@ func TestValidateCerts(t *testing.T) {
t.Errorf("init env failed, error:%s", err) t.Errorf("init env failed, error:%s", err)
} }
prev := types.GInt("MinFee") prev := types.GetMinTxFeeRate()
types.SetMinFee(0) types.SetMinFee(0)
defer types.SetMinFee(prev) defer types.SetMinFee(prev)
......
...@@ -57,7 +57,7 @@ grpcFuncWhitelist=["*"] ...@@ -57,7 +57,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
poolCacheSize=10240 poolCacheSize=10240
minTxFee=1000000 minTxFeeRate=0
[consensus] [consensus]
name="solo" name="solo"
...@@ -81,8 +81,6 @@ signType="secp256k1" ...@@ -81,8 +81,6 @@ signType="secp256k1"
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=true
minExecFee=0
enableStat=false enableStat=false
[exec.sub.cert] [exec.sub.cert]
......
...@@ -116,7 +116,7 @@ grpcFuncWhitelist=["*"] ...@@ -116,7 +116,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
[consensus] [consensus]
name="tendermint" name="tendermint"
...@@ -189,8 +189,6 @@ minerdisable=false ...@@ -189,8 +189,6 @@ minerdisable=false
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
......
...@@ -289,7 +289,7 @@ func createContract(cmd *cobra.Command, args []string) { ...@@ -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) { 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 := &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) { if tx.Fee < int64(fee) {
tx.Fee += int64(fee) tx.Fee += int64(fee)
} }
...@@ -341,7 +341,7 @@ func createEvmTransferTx(cfg *types.Chain33Config, cmd *cobra.Command, caller, e ...@@ -341,7 +341,7 @@ func createEvmTransferTx(cfg *types.Chain33Config, cmd *cobra.Command, caller, e
} }
var err error var err error
tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee")) tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
if err != nil { if err != nil {
return "", err return "", err
} }
......
...@@ -33,7 +33,7 @@ func (c *channelClient) Create(ctx context.Context, in evmtypes.EvmContractCreat ...@@ -33,7 +33,7 @@ func (c *channelClient) Create(ctx context.Context, in evmtypes.EvmContractCreat
addr := address.ExecAddress(cfg.ExecName(in.ParaName + "evm")) addr := address.ExecAddress(cfg.ExecName(in.ParaName + "evm"))
tx := &types.Transaction{Execer: []byte(execer), Payload: types.Encode(&action), Fee: 0, To: addr} 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 { if tx.Fee < in.Fee {
tx.Fee += in.Fee tx.Fee += in.Fee
} }
...@@ -62,7 +62,7 @@ func (c *channelClient) Call(ctx context.Context, in evmtypes.EvmContractCallReq ...@@ -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} tx := &types.Transaction{Execer: []byte(in.Exec), Payload: types.Encode(&action), Fee: 0, To: toAddr}
cfg := c.GetConfig() cfg := c.GetConfig()
tx.Fee, _ = tx.GetRealFee(cfg.GInt("MinFee")) tx.Fee, _ = tx.GetRealFee(cfg.GetMinTxFeeRate())
if tx.Fee < feeInt64 { if tx.Fee < feeInt64 {
tx.Fee += feeInt64 tx.Fee += feeInt64
} }
...@@ -96,7 +96,7 @@ func (c *channelClient) Transfer(ctx context.Context, in evmtypes.EvmContractTra ...@@ -96,7 +96,7 @@ func (c *channelClient) Transfer(ctx context.Context, in evmtypes.EvmContractTra
} }
var err error var err error
tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee")) tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -144,7 +144,7 @@ name="timeline" ...@@ -144,7 +144,7 @@ name="timeline"
# mempool缓存容量大小,默认10240 # mempool缓存容量大小,默认10240
poolCacheSize=10240 poolCacheSize=10240
# 最小得交易手续费用,这个没有默认值,必填,一般是100000 # 最小得交易手续费用,这个没有默认值,必填,一般是100000
minTxFee=100000 minTxFeeRate=100000
# 每个账户在mempool中得最大交易数量,默认100 # 每个账户在mempool中得最大交易数量,默认100
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
# timeline 是默认的先来先进的按时间排序 # timeline 是默认的先来先进的按时间排序
...@@ -152,7 +152,7 @@ maxTxNumPerAccount=10000 ...@@ -152,7 +152,7 @@ maxTxNumPerAccount=10000
# mempool缓存容量大小,默认10240 # mempool缓存容量大小,默认10240
poolCacheSize=10240 poolCacheSize=10240
# 最小得交易手续费用,这个没有默认值,必填,一般是100000 # 最小得交易手续费用,这个没有默认值,必填,一般是100000
minTxFee=100000 minTxFeeRate=100000
# 每个账户在mempool中得最大交易数量,默认100 # 每个账户在mempool中得最大交易数量,默认100
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
# score是分数队列模式(分数=常量a*手续费/交易字节数-常量b*时间*定量c,按分数排队,高的优先,常量a,b和定量c可配置),按分数来排序 # score是分数队列模式(分数=常量a*手续费/交易字节数-常量b*时间*定量c,按分数排队,高的优先,常量a,b和定量c可配置),按分数来排序
...@@ -160,7 +160,7 @@ maxTxNumPerAccount=10000 ...@@ -160,7 +160,7 @@ maxTxNumPerAccount=10000
# mempool缓存容量大小,默认10240 # mempool缓存容量大小,默认10240
poolCacheSize=10240 poolCacheSize=10240
# 最小得交易手续费用,这个没有默认值,必填,一般是100000 # 最小得交易手续费用,这个没有默认值,必填,一般是100000
minTxFee=100000 minTxFeeRate=100000
# 每个账户在mempool中得最大交易数量,默认100 # 每个账户在mempool中得最大交易数量,默认100
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
# 时间占价格比例 # 时间占价格比例
...@@ -174,7 +174,7 @@ pricePower=1 ...@@ -174,7 +174,7 @@ pricePower=1
# mempool缓存容量大小,默认10240 # mempool缓存容量大小,默认10240
poolCacheSize=10240 poolCacheSize=10240
# 最小得交易手续费用,这个没有默认值,必填,一般是100000 # 最小得交易手续费用,这个没有默认值,必填,一般是100000
minTxFee=100000 minTxFeeRate=100000
# 每个账户在mempool中得最大交易数量,默认100 # 每个账户在mempool中得最大交易数量,默认100
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
[consensus] [consensus]
...@@ -256,10 +256,6 @@ minerdisable=false ...@@ -256,10 +256,6 @@ minerdisable=false
# 允许购买ticket挖矿的白名单地址,默认配置“*”,允许所有地址购买 # 允许购买ticket挖矿的白名单地址,默认配置“*”,允许所有地址购买
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
#执行器执行是否免费
isFree=false
#执行器执行所需最小费用,低于Mempool和Wallet设置的MinFee,在minExecFee = 0 的情况下,isFree = true才会生效
minExecFee=100000
#是否开启stat插件 #是否开启stat插件
enableStat=false enableStat=false
#是否开启MVCC插件 #是否开启MVCC插件
......
...@@ -147,7 +147,7 @@ name="timeline" ...@@ -147,7 +147,7 @@ name="timeline"
# mempool缓存容量大小,默认10240 # mempool缓存容量大小,默认10240
poolCacheSize=10240 poolCacheSize=10240
# 最小得交易手续费用,这个没有默认值,必填,一般是100000 # 最小得交易手续费用,这个没有默认值,必填,一般是100000
minTxFee=100000 minTxFeeRate=100000
# 每个账户在mempool中得最大交易数量,默认100 # 每个账户在mempool中得最大交易数量,默认100
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
# timeline 是默认的先来先进的按时间排序 # timeline 是默认的先来先进的按时间排序
...@@ -155,7 +155,7 @@ maxTxNumPerAccount=10000 ...@@ -155,7 +155,7 @@ maxTxNumPerAccount=10000
# mempool缓存容量大小,默认10240 # mempool缓存容量大小,默认10240
poolCacheSize=10240 poolCacheSize=10240
# 最小得交易手续费用,这个没有默认值,必填,一般是100000 # 最小得交易手续费用,这个没有默认值,必填,一般是100000
minTxFee=100000 minTxFeeRate=100000
# 每个账户在mempool中得最大交易数量,默认100 # 每个账户在mempool中得最大交易数量,默认100
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
# score是分数队列模式(分数=常量a*手续费/交易字节数-常量b*时间*定量c,按分数排队,高的优先,常量a,b和定量c可配置),按分数来排序 # score是分数队列模式(分数=常量a*手续费/交易字节数-常量b*时间*定量c,按分数排队,高的优先,常量a,b和定量c可配置),按分数来排序
...@@ -163,7 +163,7 @@ maxTxNumPerAccount=10000 ...@@ -163,7 +163,7 @@ maxTxNumPerAccount=10000
# mempool缓存容量大小,默认10240 # mempool缓存容量大小,默认10240
poolCacheSize=10240 poolCacheSize=10240
# 最小得交易手续费用,这个没有默认值,必填,一般是100000 # 最小得交易手续费用,这个没有默认值,必填,一般是100000
minTxFee=100000 minTxFeeRate=100000
# 每个账户在mempool中得最大交易数量,默认100 # 每个账户在mempool中得最大交易数量,默认100
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
# 时间占价格比例 # 时间占价格比例
...@@ -177,7 +177,7 @@ pricePower=1 ...@@ -177,7 +177,7 @@ pricePower=1
# mempool缓存容量大小,默认10240 # mempool缓存容量大小,默认10240
poolCacheSize=10240 poolCacheSize=10240
# 最小得交易手续费用,这个没有默认值,必填,一般是100000 # 最小得交易手续费用,这个没有默认值,必填,一般是100000
minTxFee=100000 minTxFeeRate=100000
# 每个账户在mempool中得最大交易数量,默认100 # 每个账户在mempool中得最大交易数量,默认100
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
[consensus] [consensus]
...@@ -259,10 +259,6 @@ minerdisable=false ...@@ -259,10 +259,6 @@ minerdisable=false
# 允许购买ticket挖矿的白名单地址,默认配置“*”,允许所有地址购买 # 允许购买ticket挖矿的白名单地址,默认配置“*”,允许所有地址购买
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
#执行器执行是否免费
isFree=false
#执行器执行所需最小费用,低于Mempool和Wallet设置的MinFee,在minExecFee = 0 的情况下,isFree = true才会生效
minExecFee=100000
#是否开启stat插件 #是否开启stat插件
enableStat=false enableStat=false
#是否开启MVCC插件 #是否开启MVCC插件
......
...@@ -69,7 +69,7 @@ func hashlockLockCmd(cmd *cobra.Command, args []string) { ...@@ -69,7 +69,7 @@ func hashlockLockCmd(cmd *cobra.Command, args []string) {
delay, _ := cmd.Flags().GetInt64("delay") delay, _ := cmd.Flags().GetInt64("delay")
amount, _ := cmd.Flags().GetFloat64("amount") 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") fee, _ := cmd.Flags().GetFloat64("fee")
if fee < defaultFee { if fee < defaultFee {
fee = defaultFee fee = defaultFee
...@@ -129,7 +129,7 @@ func hashlockUnlockCmd(cmd *cobra.Command, args []string) { ...@@ -129,7 +129,7 @@ func hashlockUnlockCmd(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr") rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
secret, _ := cmd.Flags().GetString("secret") 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") fee, _ := cmd.Flags().GetFloat64("fee")
if fee < defaultFee { if fee < defaultFee {
fee = defaultFee fee = defaultFee
...@@ -172,7 +172,7 @@ func hashlockSendCmd(cmd *cobra.Command, args []string) { ...@@ -172,7 +172,7 @@ func hashlockSendCmd(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr") rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
secret, _ := cmd.Flags().GetString("secret") 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") fee, _ := cmd.Flags().GetFloat64("fee")
if fee < defaultFee { if fee < defaultFee {
fee = defaultFee fee = defaultFee
......
...@@ -65,7 +65,7 @@ mainnetJrpcAddr= "http://localhost:8801" ...@@ -65,7 +65,7 @@ mainnetJrpcAddr= "http://localhost:8801"
[mempool] [mempool]
name="para" name="para"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
[consensus] [consensus]
...@@ -131,8 +131,6 @@ signType="secp256k1" ...@@ -131,8 +131,6 @@ signType="secp256k1"
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
......
...@@ -735,11 +735,11 @@ func createCrossCommitTx(s suite.Suite) (*types.Transaction, error) { ...@@ -735,11 +735,11 @@ func createCrossCommitTx(s suite.Suite) (*types.Transaction, error) {
} }
func createTxsGroup(s suite.Suite, txs []*types.Transaction) ([]*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 { if err != nil {
return nil, err 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 { if err != nil {
return nil, err return nil, err
} }
......
...@@ -70,7 +70,7 @@ grpcFuncWhitelist=["*"] ...@@ -70,7 +70,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
[mempool.sub.para] [mempool.sub.para]
...@@ -148,8 +148,6 @@ signType="secp256k1" ...@@ -148,8 +148,6 @@ signType="secp256k1"
minerdisable=true minerdisable=true
[exec] [exec]
isFree=true
minExecFee=100000
enableStat=false enableStat=false
[exec.sub.relay] [exec.sub.relay]
......
...@@ -307,7 +307,7 @@ func CreateRawMinerTx(cfg *types.Chain33Config, value *ParacrossMinerAction) (*t ...@@ -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 Nonce: 0, //for consensus purpose, block hash need same, different auth node need keep totally same vote tx
To: address.ExecAddress(cfg.ExecName(ParaX)), To: address.ExecAddress(cfg.ExecName(ParaX)),
} }
err := tx.SetRealFee(cfg.GInt("MinFee")) err := tx.SetRealFee(cfg.GetMinTxFeeRate())
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -543,7 +543,7 @@ func (policy *privacyPolicy) createPublic2PrivacyTx(req *privacytypes.ReqCreateP ...@@ -543,7 +543,7 @@ func (policy *privacyPolicy) createPublic2PrivacyTx(req *privacytypes.ReqCreateP
ActionType: action.Ty, ActionType: action.Ty,
}), }),
} }
tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee")) tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
if err != nil { if err != nil {
bizlog.Error("createPublic2PrivacyTx", "calc fee failed", err) bizlog.Error("createPublic2PrivacyTx", "calc fee failed", err)
return nil, err return nil, err
...@@ -622,7 +622,7 @@ func (policy *privacyPolicy) createPrivacy2PrivacyTx(req *privacytypes.ReqCreate ...@@ -622,7 +622,7 @@ func (policy *privacyPolicy) createPrivacy2PrivacyTx(req *privacytypes.ReqCreate
} }
tx.SetExpire(cfg, time.Duration(req.Expire)) tx.SetExpire(cfg, time.Duration(req.Expire))
if !isMainetCoins { if !isMainetCoins {
tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee")) tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
if err != nil { if err != nil {
bizlog.Error("createPrivacy2PrivacyTx", "calc fee failed", err) bizlog.Error("createPrivacy2PrivacyTx", "calc fee failed", err)
return nil, err return nil, err
...@@ -711,7 +711,7 @@ func (policy *privacyPolicy) createPrivacy2PublicTx(req *privacytypes.ReqCreateP ...@@ -711,7 +711,7 @@ func (policy *privacyPolicy) createPrivacy2PublicTx(req *privacytypes.ReqCreateP
} }
tx.SetExpire(cfg, time.Duration(req.Expire)) tx.SetExpire(cfg, time.Duration(req.Expire))
if !isMainetCoins { if !isMainetCoins {
tx.Fee, err = tx.GetRealFee(cfg.GInt("MinFee")) tx.Fee, err = tx.GetRealFee(cfg.GetMinTxFeeRate())
if err != nil { if err != nil {
bizlog.Error("createPrivacy2PublicTx", "calc fee failed", err) bizlog.Error("createPrivacy2PublicTx", "calc fee failed", err)
return nil, err return nil, err
......
...@@ -220,7 +220,7 @@ func (mock *PrivacyMock) createPublic2PrivacyTx(req *ty.ReqCreatePrivacyTx) *typ ...@@ -220,7 +220,7 @@ func (mock *PrivacyMock) createPublic2PrivacyTx(req *ty.ReqCreatePrivacyTx) *typ
} }
cfg := mock.walletOp.GetAPI().GetConfig() cfg := mock.walletOp.GetAPI().GetConfig()
txSize := types.Size(tx) + types.SignatureSize 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.Fee = realFee
tx.SetExpire(cfg, time.Hour) tx.SetExpire(cfg, time.Hour)
return tx return tx
......
...@@ -327,7 +327,7 @@ func (r *Relayd) transaction(payload []byte) *types.Transaction { ...@@ -327,7 +327,7 @@ func (r *Relayd) transaction(payload []byte) *types.Transaction {
minFee := types.DefaultMinFee minFee := types.DefaultMinFee
if r.config.Chain33Cfg != nil { if r.config.Chain33Cfg != nil {
minFee = r.config.Chain33Cfg.GInt("MinFee") minFee = r.config.Chain33Cfg.GetMinTxFeeRate()
} }
fee, _ := tx.GetRealFee(minFee) fee, _ := tx.GetRealFee(minFee)
tx.Fee = fee tx.Fee = fee
......
...@@ -72,7 +72,7 @@ func backupCmd(cmd *cobra.Command, args []string) { ...@@ -72,7 +72,7 @@ func backupCmd(cmd *cobra.Command, args []string) {
defaultAddr, _ := cmd.Flags().GetString("default") defaultAddr, _ := cmd.Flags().GetString("default")
delay, _ := cmd.Flags().GetInt64("delay") 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") fee, _ := cmd.Flags().GetFloat64("fee")
if fee < defaultFee { if fee < defaultFee {
fee = defaultFee fee = defaultFee
...@@ -133,7 +133,7 @@ func prepareCmd(cmd *cobra.Command, args []string) { ...@@ -133,7 +133,7 @@ func prepareCmd(cmd *cobra.Command, args []string) {
backup, _ := cmd.Flags().GetString("backup") backup, _ := cmd.Flags().GetString("backup")
defaultAddr, _ := cmd.Flags().GetString("default") 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") fee, _ := cmd.Flags().GetFloat64("fee")
if fee < defaultFee { if fee < defaultFee {
fee = defaultFee fee = defaultFee
...@@ -168,7 +168,7 @@ func performCmd(cmd *cobra.Command, args []string) { ...@@ -168,7 +168,7 @@ func performCmd(cmd *cobra.Command, args []string) {
backup, _ := cmd.Flags().GetString("backup") backup, _ := cmd.Flags().GetString("backup")
defaultAddr, _ := cmd.Flags().GetString("default") 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") fee, _ := cmd.Flags().GetFloat64("fee")
if fee < defaultFee { if fee < defaultFee {
fee = defaultFee fee = defaultFee
...@@ -215,7 +215,7 @@ func cancelCmd(cmd *cobra.Command, args []string) { ...@@ -215,7 +215,7 @@ func cancelCmd(cmd *cobra.Command, args []string) {
backup, _ := cmd.Flags().GetString("backup") backup, _ := cmd.Flags().GetString("backup")
defaultAddr, _ := cmd.Flags().GetString("default") 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") fee, _ := cmd.Flags().GetFloat64("fee")
if fee < defaultFee { if fee < defaultFee {
fee = defaultFee fee = defaultFee
......
...@@ -62,7 +62,7 @@ grpcFuncWhitelist=["*"] ...@@ -62,7 +62,7 @@ grpcFuncWhitelist=["*"]
[mempool] [mempool]
name="timeline" name="timeline"
poolCacheSize=10240 poolCacheSize=10240
minTxFee=100000 minTxFeeRate=100000
maxTxNumPerAccount=10000 maxTxNumPerAccount=10000
[consensus] [consensus]
...@@ -158,8 +158,6 @@ minerwhitelist=["*"] ...@@ -158,8 +158,6 @@ minerwhitelist=["*"]
minerWaitTime="1s" minerWaitTime="1s"
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
alias=["token1:token","token2:token","token3:token"] alias=["token1:token","token2:token","token3:token"]
......
...@@ -208,12 +208,10 @@ Title="test" ...@@ -208,12 +208,10 @@ Title="test"
[mempool] [mempool]
poolCacheSize=102400 poolCacheSize=102400
minTxFee=100000 minTxFeeRate=100000
maxTxNumPerAccount=100 maxTxNumPerAccount=100
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
......
...@@ -146,7 +146,7 @@ func CreateUnfreezeCreateTx(cfg *types.Chain33Config, title string, parm *Unfree ...@@ -146,7 +146,7 @@ func CreateUnfreezeCreateTx(cfg *types.Chain33Config, title string, parm *Unfree
Nonce: rand.New(rand.NewSource(time.Now().UnixNano())).Int63(), Nonce: rand.New(rand.NewSource(time.Now().UnixNano())).Int63(),
To: address.ExecAddress(getRealExecName(cfg, cfg.GetParaName())), To: address.ExecAddress(getRealExecName(cfg, cfg.GetParaName())),
} }
tx.SetRealFee(cfg.GInt("MinFee")) tx.SetRealFee(cfg.GetMinTxFeeRate())
return tx, nil return tx, nil
} }
...@@ -175,7 +175,7 @@ func CreateUnfreezeWithdrawTx(cfg *types.Chain33Config, title string, parm *Unfr ...@@ -175,7 +175,7 @@ func CreateUnfreezeWithdrawTx(cfg *types.Chain33Config, title string, parm *Unfr
Nonce: rand.New(rand.NewSource(time.Now().UnixNano())).Int63(), Nonce: rand.New(rand.NewSource(time.Now().UnixNano())).Int63(),
To: address.ExecAddress(getRealExecName(cfg, cfg.GetParaName())), To: address.ExecAddress(getRealExecName(cfg, cfg.GetParaName())),
} }
tx.SetRealFee(cfg.GInt("MinFee")) tx.SetRealFee(cfg.GetMinTxFeeRate())
return tx, nil return tx, nil
} }
...@@ -204,7 +204,7 @@ func CreateUnfreezeTerminateTx(cfg *types.Chain33Config, title string, parm *Unf ...@@ -204,7 +204,7 @@ func CreateUnfreezeTerminateTx(cfg *types.Chain33Config, title string, parm *Unf
Nonce: rand.New(rand.NewSource(time.Now().UnixNano())).Int63(), Nonce: rand.New(rand.NewSource(time.Now().UnixNano())).Int63(),
To: address.ExecAddress(getRealExecName(cfg, cfg.GetParaName())), To: address.ExecAddress(getRealExecName(cfg, cfg.GetParaName())),
} }
tx.SetRealFee(cfg.GInt("MinFee")) tx.SetRealFee(cfg.GetMinTxFeeRate())
return tx, nil return tx, nil
} }
......
...@@ -167,7 +167,7 @@ func addNode(cmd *cobra.Command, args []string) { ...@@ -167,7 +167,7 @@ func addNode(cmd *cobra.Command, args []string) {
value := &vt.ValNodeAction_Node{Node: &vt.ValNode{PubKey: pubkeybyte, Power: power}} value := &vt.ValNodeAction_Node{Node: &vt.ValNode{PubKey: pubkeybyte, Power: power}}
action := &vt.ValNodeAction{Value: value, Ty: vt.ValNodeActionUpdate} action := &vt.ValNodeAction{Value: value, Ty: vt.ValNodeActionUpdate}
tx := &types.Transaction{Execer: []byte(vt.ValNodeX), Payload: types.Encode(action), Fee: 0} 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 { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
return return
......
...@@ -212,7 +212,7 @@ func TestRealNodeMempool(t *testing.T) { ...@@ -212,7 +212,7 @@ func TestRealNodeMempool(t *testing.T) {
//发送交易组 //发送交易组
tx1 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.Coin/1000) tx1 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.Coin/1000)
tx2 := 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 { if err != nil {
log.Println(err) log.Println(err)
continue continue
......
...@@ -66,7 +66,7 @@ keyFile="key.pem" ...@@ -66,7 +66,7 @@ keyFile="key.pem"
[mempool] [mempool]
name="price" name="price"
poolCacheSize=200 poolCacheSize=200
minTxFee=100000 minTxFeeRate=100000
maxTxNumPerAccount=100 maxTxNumPerAccount=100
[mempool.sub.timeline] [mempool.sub.timeline]
...@@ -161,8 +161,6 @@ signType="secp256k1" ...@@ -161,8 +161,6 @@ signType="secp256k1"
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
......
...@@ -27,7 +27,7 @@ func New(cfg *types.Mempool, sub []byte) queue.Module { ...@@ -27,7 +27,7 @@ func New(cfg *types.Mempool, sub []byte) queue.Module {
subcfg.PoolCacheSize = cfg.PoolCacheSize subcfg.PoolCacheSize = cfg.PoolCacheSize
} }
if subcfg.ProperFee == 0 { if subcfg.ProperFee == 0 {
subcfg.ProperFee = cfg.MinTxFee subcfg.ProperFee = cfg.MinTxFeeRate
} }
c.SetQueueCache(NewQueue(subcfg)) c.SetQueueCache(NewQueue(subcfg))
return c return c
......
...@@ -188,7 +188,7 @@ func TestRealNodeMempool(t *testing.T) { ...@@ -188,7 +188,7 @@ func TestRealNodeMempool(t *testing.T) {
//发送交易组 //发送交易组
tx1 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.Coin/1000) tx1 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.Coin/1000)
tx2 := 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 { if err != nil {
log.Println(err) log.Println(err)
continue continue
......
...@@ -66,7 +66,7 @@ keyFile="key.pem" ...@@ -66,7 +66,7 @@ keyFile="key.pem"
[mempool] [mempool]
name="score" name="score"
poolCacheSize=200 poolCacheSize=200
minTxFee=100000 minTxFeeRate=100000
maxTxNumPerAccount=100 maxTxNumPerAccount=100
[mempool.sub.timeline] [mempool.sub.timeline]
...@@ -160,8 +160,6 @@ signType="secp256k1" ...@@ -160,8 +160,6 @@ signType="secp256k1"
minerwhitelist=["*"] minerwhitelist=["*"]
[exec] [exec]
isFree=false
minExecFee=100000
enableStat=false enableStat=false
enableMVCC=false enableMVCC=false
......
...@@ -30,7 +30,7 @@ func New(cfg *types.Mempool, sub []byte) queue.Module { ...@@ -30,7 +30,7 @@ func New(cfg *types.Mempool, sub []byte) queue.Module {
subcfg.PoolCacheSize = cfg.PoolCacheSize subcfg.PoolCacheSize = cfg.PoolCacheSize
} }
if subcfg.ProperFee == 0 { if subcfg.ProperFee == 0 {
subcfg.ProperFee = cfg.MinTxFee subcfg.ProperFee = cfg.MinTxFeeRate
} }
c.SetQueueCache(NewQueue(subcfg)) c.SetQueueCache(NewQueue(subcfg))
return c return c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment