diff --git a/cmd/chain33/chain33.fork.toml b/cmd/chain33/chain33.fork.toml index 9e81d726a8..cf6db35f13 100644 --- a/cmd/chain33/chain33.fork.toml +++ b/cmd/chain33/chain33.fork.toml @@ -28,7 +28,8 @@ ForkCheckEthTxSort=0 ForkProxyExec=0 ForkMaxBlockFee=0 ForkMaxTxFeeV1=0 -ForkMaxBlockFee=0 +ForkMaxTxFeeV2=0 + [fork.sub.none] ForkUseTimeDelay=0 diff --git a/system/consensus/solo/solo_test.go b/system/consensus/solo/solo_test.go index ede07c9763..49f309b2c7 100644 --- a/system/consensus/solo/solo_test.go +++ b/system/consensus/solo/solo_test.go @@ -60,13 +60,33 @@ func TestSolo(t *testing.T) { mock33.GetAPI().SendTx(txs[i]) } mock33.WaitHeight(2) + //test feelimit txs ,blockfeelimit + + privkey := mock33.GetGenesisKey() + txs = util.GenCoinsTxs(cfg, nil, 10) + for i := 0; i < 10; i++ { + //每笔交易手续费20个比特元 + txs[i].Fee = 20 * 1e8 + txs[i].Sign(types.SECP256K1, privkey) + } + for i := 0; i < len(txs); i++ { + t.Log(txs[i].GetTxFee()) + mock33.GetAPI().SendTx(txs[i]) + } + time.Sleep(time.Second * 10) + t.Log("current height:", mock33.GetBlockChain().GetBlockHeight()) + for h := 3; h <= int(mock33.GetBlockChain().GetBlockHeight()); h++ { + t.Log("blockfee:", mock33.GetBlock(int64(h)).Fee(), "blockheight:", h, "txnum:", len(mock33.GetBlock(int64(h)).Txs)) + assert.True(t, mock33.GetBlock(int64(h)).Fee() < types.MaxBlockFee) + } + } var ( tlog = log15.New("module", "test solo") ) -//mempool发送交易 10000tx/s +// mempool发送交易 10000tx/s func BenchmarkSendTx(b *testing.B) { if testing.Short() { b.Skip("skipping in short mode.") @@ -244,7 +264,7 @@ func createCoinsTx(cfg *types.Chain33Config, to string, txHeight int64) *types.T return tx } -//测试solo并发 +// 测试solo并发 func BenchmarkSolo(b *testing.B) { if testing.Short() { @@ -392,7 +412,7 @@ func BenchmarkCheckSign(b *testing.B) { } } -//消息队列发送性能, 80w /s +// 消息队列发送性能, 80w /s func BenchmarkMsgQueue(b *testing.B) { if testing.Short() { b.Skip("skipping in short mode.") diff --git a/types/defaultcfg.go b/types/defaultcfg.go index 5e15cf57ee..de6cce29f9 100644 --- a/types/defaultcfg.go +++ b/types/defaultcfg.go @@ -107,6 +107,12 @@ poolCacheSize=102400 minTxFeeRate=100000 maxTxNumPerAccount=100000 +[mver.mempool.ForkMaxTxFeeV1] +maxTxFee=5000000000 +[mver.mempool.ForkMaxTxFeeV2] +maxTxFee=2000000000 + + [consensus] name="solo" minerstart=true @@ -250,7 +256,7 @@ useBalance=false jdkPath="../../../../build/j2sdk-image" ` -//GetDefaultCfgstring ... +// GetDefaultCfgstring ... func GetDefaultCfgstring() string { return cfgstring } diff --git a/types/testdata/chain33.toml b/types/testdata/chain33.toml index 7e814ca32e..e7e938bf78 100644 --- a/types/testdata/chain33.toml +++ b/types/testdata/chain33.toml @@ -156,6 +156,8 @@ ForkV24TxGroupPara= 806578 ForkStateDBSet=-1 ForkMaxTxFeeV1=30839600 ForkMaxTxFeeV2=30939600 +ForkMaxBlockFee=30949600 + [fork.sub.manage] Enable=120000 ForkV11ManageExec= 400000