Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
29118e1d
Commit
29118e1d
authored
Oct 23, 2019
by
mdj33
Committed by
vipwzw
Nov 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify selfConsensEnable
parent
b92aa4fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
chain33.para.toml
chain33.para.toml
+1
-0
para.go
plugin/consensus/para/para.go
+10
-10
testcase.sh
plugin/dapp/paracross/cmd/build/testcase.sh
+0
-1
No files found.
chain33.para.toml
View file @
29118e1d
...
@@ -254,6 +254,7 @@ Enable=0
...
@@ -254,6 +254,7 @@ Enable=0
ForkParacrossWithdrawFromParachain
=
0
ForkParacrossWithdrawFromParachain
=
0
ForkParacrossCommitTx
=
0
ForkParacrossCommitTx
=
0
ForkLoopCheckCommitTxDone
=
0
ForkLoopCheckCommitTxDone
=
0
ForkConsensSupportJump
=
0
[fork.sub.evm]
[fork.sub.evm]
Enable
=
0
Enable
=
0
...
...
plugin/consensus/para/para.go
View file @
29118e1d
...
@@ -88,7 +88,7 @@ type subConfig struct {
...
@@ -88,7 +88,7 @@ type subConfig struct {
WaitBlocks4CommitMsg
int32
`json:"waitBlocks4CommitMsg,omitempty"`
WaitBlocks4CommitMsg
int32
`json:"waitBlocks4CommitMsg,omitempty"`
GenesisAmount
int64
`json:"genesisAmount,omitempty"`
GenesisAmount
int64
`json:"genesisAmount,omitempty"`
MainBlockHashForkHeight
int64
`json:"mainBlockHashForkHeight,omitempty"`
MainBlockHashForkHeight
int64
`json:"mainBlockHashForkHeight,omitempty"`
s
elfConsensusEnable
[]
*
paraSelfConsEnable
`json:"selfConsensusEnable,omitempty"`
S
elfConsensusEnable
[]
*
paraSelfConsEnable
`json:"selfConsensusEnable,omitempty"`
WaitConsensStopTimes
uint32
`json:"waitConsensStopTimes,omitempty"`
WaitConsensStopTimes
uint32
`json:"waitConsensStopTimes,omitempty"`
MaxCacheCount
int64
`json:"maxCacheCount,omitempty"`
MaxCacheCount
int64
`json:"maxCacheCount,omitempty"`
MaxSyncErrCount
int32
`json:"maxSyncErrCount,omitempty"`
MaxSyncErrCount
int32
`json:"maxSyncErrCount,omitempty"`
...
@@ -128,16 +128,16 @@ func New(cfg *types.Consensus, sub []byte) queue.Module {
...
@@ -128,16 +128,16 @@ func New(cfg *types.Consensus, sub []byte) queue.Module {
subcfg
.
MainBlockHashForkHeight
=
defaultMainBlockHashForkHeight
subcfg
.
MainBlockHashForkHeight
=
defaultMainBlockHashForkHeight
}
}
if
len
(
subcfg
.
s
elfConsensusEnable
)
==
0
{
if
len
(
subcfg
.
S
elfConsensusEnable
)
==
0
{
selfEnable
:=
&
paraSelfConsEnable
{
Enable
:
false
}
selfEnable
:=
&
paraSelfConsEnable
{
Enable
:
false
}
subcfg
.
selfConsensusEnable
=
append
(
subcfg
.
s
elfConsensusEnable
,
selfEnable
)
subcfg
.
SelfConsensusEnable
=
append
(
subcfg
.
S
elfConsensusEnable
,
selfEnable
)
}
}
if
subcfg
.
s
elfConsensusEnable
[
0
]
.
BlockHeight
!=
0
{
if
subcfg
.
S
elfConsensusEnable
[
0
]
.
BlockHeight
!=
0
{
selfEnable
:=
&
paraSelfConsEnable
{
Enable
:
false
}
selfEnable
:=
&
paraSelfConsEnable
{
Enable
:
false
}
subcfg
.
selfConsensusEnable
=
append
([]
*
paraSelfConsEnable
{
selfEnable
},
subcfg
.
s
elfConsensusEnable
...
)
subcfg
.
SelfConsensusEnable
=
append
([]
*
paraSelfConsEnable
{
selfEnable
},
subcfg
.
S
elfConsensusEnable
...
)
}
}
err
=
checkSelfConsensEnable
(
subcfg
.
s
elfConsensusEnable
)
err
=
checkSelfConsensEnable
(
subcfg
.
S
elfConsensusEnable
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
"para selfConsensusEnable config not correct"
)
panic
(
"para selfConsensusEnable config not correct"
)
}
}
...
@@ -189,7 +189,7 @@ func New(cfg *types.Consensus, sub []byte) queue.Module {
...
@@ -189,7 +189,7 @@ func New(cfg *types.Consensus, sub []byte) queue.Module {
para
.
commitMsgClient
.
waitConsensStopTimes
=
subcfg
.
WaitConsensStopTimes
para
.
commitMsgClient
.
waitConsensStopTimes
=
subcfg
.
WaitConsensStopTimes
}
}
para
.
commitMsgClient
.
setSelfConsensMap
(
subcfg
.
s
elfConsensusEnable
)
para
.
commitMsgClient
.
setSelfConsensMap
(
subcfg
.
S
elfConsensusEnable
)
// 设置平行链共识起始高度,在共识高度为-1也就是从未共识过的环境中允许从设置的非0起始高度开始共识
// 设置平行链共识起始高度,在共识高度为-1也就是从未共识过的环境中允许从设置的非0起始高度开始共识
//note:只有在主链LoopCheckCommitTxDoneForkHeight之后才支持设置ParaConsensStartHeight
//note:只有在主链LoopCheckCommitTxDoneForkHeight之后才支持设置ParaConsensStartHeight
...
@@ -401,9 +401,9 @@ func (client *client) CreateGenesisTx() (ret []*types.Transaction) {
...
@@ -401,9 +401,9 @@ func (client *client) CreateGenesisTx() (ret []*types.Transaction) {
}
}
func
(
client
*
client
)
getSelfConsEnableStatus
(
height
int64
)
*
paraSelfConsEnable
{
func
(
client
*
client
)
getSelfConsEnableStatus
(
height
int64
)
*
paraSelfConsEnable
{
for
i
:=
len
(
client
.
subCfg
.
s
elfConsensusEnable
)
-
1
;
i
>=
0
;
i
--
{
for
i
:=
len
(
client
.
subCfg
.
S
elfConsensusEnable
)
-
1
;
i
>=
0
;
i
--
{
if
height
>=
client
.
subCfg
.
s
elfConsensusEnable
[
i
]
.
BlockHeight
{
if
height
>=
client
.
subCfg
.
S
elfConsensusEnable
[
i
]
.
BlockHeight
{
return
client
.
subCfg
.
s
elfConsensusEnable
[
i
]
return
client
.
subCfg
.
S
elfConsensusEnable
[
i
]
}
}
}
}
panic
(
fmt
.
Sprintf
(
"para selfConsensusEnable not set for height=%d"
,
height
))
panic
(
fmt
.
Sprintf
(
"para selfConsensusEnable not set for height=%d"
,
height
))
...
...
plugin/dapp/paracross/cmd/build/testcase.sh
View file @
29118e1d
...
@@ -39,7 +39,6 @@ function para_set_toml() {
...
@@ -39,7 +39,6 @@ function para_set_toml() {
sed
-i
$xsedfix
's/^interval=.*/interval=4/g'
"
${
1
}
"
sed
-i
$xsedfix
's/^interval=.*/interval=4/g'
"
${
1
}
"
sed
-i
$xsedfix
's/^MainForkParacrossCommitTx=.*/MainForkParacrossCommitTx=10/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/^MainLoopCheckCommitTxDoneForkHeight=.*/MainLoopCheckCommitTxDoneForkHeight='''
$MainLoopCheckForkHeight
'''/g'
"
${
1
}
"
sed
-i
$xsedfix
'/^MainForkParacrossCommitTx=.*/a MainBlockHashForkHeight=1'
"
${
1
}
"
sed
-i
$xsedfix
'/^MainForkParacrossCommitTx=.*/a MainBlockHashForkHeight=1'
"
${
1
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment