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

sync chain33 tx fee config

parent 54e4e578
......@@ -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
......
......@@ -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]
......
......@@ -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"]
......
......@@ -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"]
......
......@@ -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
}
......
......@@ -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
......
......@@ -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"]
......
......@@ -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
......@@ -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"]
......
......@@ -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"
]
......
......@@ -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)
......
......@@ -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]
......
......@@ -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"]
......
......@@ -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
}
......
......@@ -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
}
......
......@@ -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插件
......
......@@ -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插件
......
......@@ -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
......
......@@ -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
......
......@@ -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
}
......
......@@ -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]
......
......@@ -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
}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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"]
......
......@@ -208,12 +208,10 @@ Title="test"
[mempool]
poolCacheSize=102400
minTxFee=100000
minTxFeeRate=100000
maxTxNumPerAccount=100
[exec]
isFree=false
minExecFee=100000
enableStat=false
enableMVCC=false
......
......@@ -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
}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
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