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
d82063da
Commit
d82063da
authored
Oct 23, 2019
by
mdj33
Committed by
vipwzw
Nov 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selfConsensEnable fork
parent
29118e1d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
docker-compose.sh
build/docker-compose.sh
+1
-0
para.go
plugin/consensus/para/para.go
+6
-7
action.go
plugin/dapp/paracross/executor/action.go
+13
-1
No files found.
build/docker-compose.sh
View file @
d82063da
...
...
@@ -81,6 +81,7 @@ function base_init() {
sed
-i
$sedfix
's/^powLimitBits=.*/powLimitBits="0x1f2fffff"/g'
chain33.toml
sed
-i
$sedfix
's/^targetTimePerBlock=.*/targetTimePerBlock=1/g'
chain33.toml
sed
-i
$sedfix
's/^targetTimespan=.*/targetTimespan=10000000/g'
chain33.toml
sed
-i
$sedfix
's/^isLevelFee=.*/isLevelFee=false/g'
chain33.toml
# p2p
sed
-i
$sedfix
's/^seeds=.*/seeds=["chain33:13802","chain32:13802","chain31:13802"]/g'
chain33.toml
...
...
plugin/consensus/para/para.go
View file @
d82063da
...
...
@@ -33,13 +33,12 @@ const (
genesisBlockTime
int64
=
1514533390
//current miner tx take any privatekey for unify all nodes sign purpose, and para chain is free
minerPrivateKey
=
"6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b"
defaultGenesisAmount
int64
=
1e8
poolMainBlockSec
int64
=
5
defaultEmptyBlockInterval
int64
=
50
//write empty block every interval blocks in mainchain
defaultSearchMatchedBlockDepth
int32
=
10000
defaultMainBlockHashForkHeight
int64
=
209186
//calc block hash fork height in main chain
mainParaSelfConsensusForkHeight
int64
=
types
.
MaxHeight
//para chain self consensus height switch, must >= ForkParacrossCommitTx of main
minerPrivateKey
=
"6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b"
defaultGenesisAmount
int64
=
1e8
poolMainBlockSec
int64
=
5
defaultEmptyBlockInterval
int64
=
50
//write empty block every interval blocks in mainchain
defaultSearchMatchedBlockDepth
int32
=
10000
defaultMainBlockHashForkHeight
int64
=
209186
//calc block hash fork height in main chain
)
var
(
...
...
plugin/dapp/paracross/executor/action.go
View file @
d82063da
...
...
@@ -708,8 +708,20 @@ func (a *action) isAllowMainConsensJump(commit *pt.ParacrossHeightStatus, titleS
}
//平行链自共识无缝切换条件:commit height为自共识分段起始高度
//分叉高度按平行链本身高度判断,而不是按主链高度,可以尽早支持isStartHeight标志,没共识过的平行链采用分段结构,可以从0开始,分叉高度也为0,
//共识过的平行链,由于之前按主链高度判断,创世0区块固定只在主链共识,平行链需要自动从1高度或更高高度过渡过来
func
(
a
*
action
)
isAllowParaConsensJump
(
commit
*
pt
.
ParacrossCommitAction
,
titleStatus
*
pt
.
ParacrossStatus
)
(
bool
,
error
)
{
return
commit
.
Status
.
IsStartHeight
,
nil
if
commit
.
Status
.
IsStartHeight
||
types
.
IsDappFork
(
a
.
height
,
pt
.
ParaX
,
pt
.
ForkConsensSupportJump
)
{
return
commit
.
Status
.
IsStartHeight
,
nil
}
return
a
.
isAllowParaConsensJumpOld
(
commit
,
titleStatus
)
}
//平行链自共识无缝切换条件:1,平行链没有共识过,2:commit高度是大于自共识分叉高度且上一次共识的主链高度小于自共识分叉高度,保证只运行一次,
// 这样在主链没有共识空洞前提下,平行链允许有条件的共识跳跃
func
(
a
*
action
)
isAllowParaConsensJumpOld
(
commit
*
pt
.
ParacrossCommitAction
,
titleStatus
*
pt
.
ParacrossStatus
)
(
bool
,
error
)
{
return
titleStatus
.
Height
==
-
1
,
nil
}
func
(
a
*
action
)
isAllowConsensJump
(
commit
*
pt
.
ParacrossCommitAction
,
titleStatus
*
pt
.
ParacrossStatus
)
(
bool
,
error
)
{
...
...
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