Commit 4daf4270 authored by mdj33's avatar mdj33 Committed by vipwzw

fix ut

parent e9bd0511
......@@ -114,12 +114,10 @@ MainForkParacrossCommitTx=2270000
MainParaSelfConsensusForkHeight=-1
#主链开启循环检查共识交易done的fork高度
MainLoopCheckCommitTxDoneForkHeight=-1
#主链过滤平行链tx
FetchFilterParaTxsEnable=-1
#主链每隔几个没有相关平行链交易的区块,平行链上打包空区块,缺省从平行链blockHeight=0开始,依次增长,空块间隔不能为0
[[consensus.sub.para.emptyBlockInterval]]
blockHeight=0
intervel=50
interval=50
......
......@@ -140,7 +140,7 @@ func New(cfg *types.Consensus, sub []byte) queue.Module {
subcfg.BatchFetchBlockCount = types.MaxBlockCountPerTime
}
if subcfg.BatchFetchBlockCount > types.MaxBlockCountPerTime {
panic(fmt.Sprintf("BatchFetchBlockCount=%d should be more than %d ", subcfg.BatchFetchBlockCount, types.MaxBlockCountPerTime))
panic(fmt.Sprintf("BatchFetchBlockCount=%d should be <= %d ", subcfg.BatchFetchBlockCount, types.MaxBlockCountPerTime))
}
pk, err := hex.DecodeString(minerPrivateKey)
......@@ -224,7 +224,6 @@ func New(cfg *types.Consensus, sub []byte) queue.Module {
if subcfg.MultiDownServerRspTime > 0 {
para.multiDldCli.serverTimeout = subcfg.MultiDownServerRspTime
}
c.SetChild(para)
return para
}
......@@ -240,7 +239,7 @@ func checkEmptyBlockInterval(in []*emptyBlockInterval) error {
return types.ErrInvalidParam
}
if in[i].Interval <= 0 {
plog.Error("EmptyBlockInterval,interval should big than 0", "height", in[i].BlockHeight)
plog.Error("EmptyBlockInterval,interval should > 0", "height", in[i].BlockHeight)
return types.ErrInvalidParam
}
}
......
......@@ -95,8 +95,7 @@ ParaRemoteGrpcClient = "localhost:8802"
startHeight=20
#打包时间间隔,单位秒
writeBlockSeconds=2
#主链每隔几个没有相关交易的区块,平行链上打包空区块
emptyBlockInterval=4
MainBlockHashForkHeight=1
MainForkParacrossCommitTx=5
MainParaSelfConsensusForkHeight=300
......@@ -107,6 +106,10 @@ authAccount="1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
waitBlocks4CommitMsg=2
#创世地址额度
genesisAmount=100000000
#主链每隔几个没有相关交易的区块,平行链上打包空区块
[[consensus.sub.para.emptyBlockInterval]]
blockHeight=0
interval=4
[store]
name="mavl"
......
......@@ -36,13 +36,13 @@ function para_set_toml() {
sed -i $xsedfix 's/^Title.*/Title="user.p.'''$PARANAME'''."/g' "${1}"
sed -i $xsedfix 's/^# TestNet=.*/TestNet=true/g' "${1}"
sed -i $xsedfix 's/^startHeight=.*/startHeight=1/g' "${1}"
sed -i $xsedfix 's/^emptyBlockInterval=.*/emptyBlockInterval=4/g' "${1}"
sed -i $xsedfix '/^emptyBlockInterval=.*/a MainBlockHashForkHeight=1' "${1}"
sed -i $xsedfix 's/^interval=.*/interval=4/g' "${1}"
sed -i $xsedfix 's/^MainForkParacrossCommitTx=.*/MainForkParacrossCommitTx=10/g' "${1}"
sed -i $xsedfix 's/^MainParaSelfConsensusForkHeight=.*/MainParaSelfConsensusForkHeight=50/g' "${1}"
sed -i $xsedfix 's/^MainLoopCheckCommitTxDoneForkHeight=.*/MainLoopCheckCommitTxDoneForkHeight='''$MainLoopCheckForkHeight'''/g' "${1}"
sed -i $xsedfix 's/^FetchFilterParaTxsEnable=.*/FetchFilterParaTxsEnable=1/g' "${1}"
sed -i $xsedfix '/^MainForkParacrossCommitTx=.*/a MainBlockHashForkHeight=1' "${1}"
# rpc
sed -i $xsedfix 's/^jrpcBindAddr=.*/jrpcBindAddr="0.0.0.0:8901"/g' "${1}"
......
......@@ -104,8 +104,6 @@ ParaRemoteGrpcClient=""
startHeight=1
#打包时间间隔,单位秒
writeBlockSeconds=2
#主链每隔几个没有相关交易的区块,平行链上打包空区块
emptyBlockInterval=2
#验证账户,验证节点需要配置自己的账户,并且钱包导入对应种子,非验证节点留空
authAccount="1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF"
#等待平行链共识消息在主链上链并成功的块数,超出会重发共识消息,最小是2
......@@ -117,6 +115,9 @@ genesisAmount=100000000
MainBlockHashForkHeight=1
MainForkParacrossCommitTx=1
MainLoopCheckCommitTxDoneForkHeight=11
[[consensus.sub.para.emptyBlockInterval]]
blockHeight=0
interval=2
[store]
name="mavl"
......
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