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
29629ee7
Commit
29629ee7
authored
Jun 27, 2019
by
mdj33
Committed by
vipwzw
Jul 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node quit trigger commit done
parent
e989b8fb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
130 additions
and
33 deletions
+130
-33
chain33.para.toml
chain33.para.toml
+2
-0
action.go
plugin/dapp/paracross/executor/action.go
+0
-0
exec_del_local.go
plugin/dapp/paracross/executor/exec_del_local.go
+19
-0
exec_local.go
plugin/dapp/paracross/executor/exec_local.go
+17
-0
paracross.go
plugin/dapp/paracross/executor/paracross.go
+44
-18
superaccount.go
plugin/dapp/paracross/executor/superaccount.go
+14
-2
paracross.proto
plugin/dapp/paracross/proto/paracross.proto
+25
-13
errors.go
plugin/dapp/paracross/types/errors.go
+2
-0
type.go
plugin/dapp/paracross/types/type.go
+7
-0
No files found.
chain33.para.toml
View file @
29629ee7
...
@@ -113,6 +113,8 @@ genesisAmount=100000000
...
@@ -113,6 +113,8 @@ genesisAmount=100000000
MainForkParacrossCommitTx
=
2270000
MainForkParacrossCommitTx
=
2270000
#平行链自共识开启对应的主链高度,需要大于等于MainForkParacrossCommitTx=2270000, -1 不开启
#平行链自共识开启对应的主链高度,需要大于等于MainForkParacrossCommitTx=2270000, -1 不开启
MainParaSelfConsensusForkHeight
=
-1
MainParaSelfConsensusForkHeight
=
-1
#主链开启循环检查共识交易done的fork高度
MainLoopCheckCommitTxDoneForkHeight
=
-1
[store]
[store]
name
=
"kvmvccmavl"
name
=
"kvmvccmavl"
...
...
plugin/dapp/paracross/executor/action.go
View file @
29629ee7
This diff is collapsed.
Click to expand it.
plugin/dapp/paracross/executor/exec_del_local.go
View file @
29629ee7
...
@@ -77,6 +77,25 @@ func (e *Paracross) ExecDelLocal_NodeConfig(payload *pt.ParaNodeAddrConfig, tx *
...
@@ -77,6 +77,25 @@ func (e *Paracross) ExecDelLocal_NodeConfig(payload *pt.ParaNodeAddrConfig, tx *
}
}
key
:=
calcLocalNodeTitleDone
(
g
.
Title
,
g
.
TargetAddr
)
key
:=
calcLocalNodeTitleDone
(
g
.
Title
,
g
.
TargetAddr
)
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
key
,
Value
:
nil
})
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
key
,
Value
:
nil
})
}
else
if
log
.
Ty
==
pt
.
TyLogParacrossCommitDone
{
var
g
pt
.
ReceiptParacrossDone
types
.
Decode
(
log
.
Log
,
&
g
)
g
.
Height
=
g
.
Height
-
1
key
:=
calcLocalTitleKey
(
g
.
Title
)
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
key
,
Value
:
types
.
Encode
(
&
g
)})
key
=
calcLocalHeightKey
(
g
.
Title
,
g
.
Height
)
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
key
,
Value
:
nil
})
if
!
types
.
IsPara
()
{
r
,
err
:=
e
.
saveLocalParaTxsFork
(
&
g
,
true
)
if
err
!=
nil
{
return
nil
,
err
}
set
.
KV
=
append
(
set
.
KV
,
r
.
KV
...
)
}
}
}
}
}
return
&
set
,
nil
return
&
set
,
nil
...
...
plugin/dapp/paracross/executor/exec_local.go
View file @
29629ee7
...
@@ -81,6 +81,23 @@ func (e *Paracross) ExecLocal_NodeConfig(payload *pt.ParaNodeAddrConfig, tx *typ
...
@@ -81,6 +81,23 @@ func (e *Paracross) ExecLocal_NodeConfig(payload *pt.ParaNodeAddrConfig, tx *typ
}
}
key
:=
calcLocalNodeTitleDone
(
g
.
Title
,
g
.
TargetAddr
)
key
:=
calcLocalNodeTitleDone
(
g
.
Title
,
g
.
TargetAddr
)
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
key
,
Value
:
types
.
Encode
(
&
g
)})
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
key
,
Value
:
types
.
Encode
(
&
g
)})
}
else
if
log
.
Ty
==
pt
.
TyLogParacrossCommitDone
{
var
g
pt
.
ReceiptParacrossDone
types
.
Decode
(
log
.
Log
,
&
g
)
key
:=
calcLocalTitleKey
(
g
.
Title
)
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
key
,
Value
:
types
.
Encode
(
&
g
)})
key
=
calcLocalHeightKey
(
g
.
Title
,
g
.
Height
)
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
key
,
Value
:
types
.
Encode
(
&
g
)})
if
!
types
.
IsPara
()
{
r
,
err
:=
e
.
saveLocalParaTxsFork
(
&
g
,
false
)
if
err
!=
nil
{
return
nil
,
err
}
set
.
KV
=
append
(
set
.
KV
,
r
.
KV
...
)
}
}
}
}
}
return
&
set
,
nil
return
&
set
,
nil
...
...
plugin/dapp/paracross/executor/paracross.go
View file @
29629ee7
...
@@ -68,7 +68,7 @@ func (c *Paracross) checkTxGroup(tx *types.Transaction, index int) ([]*types.Tra
...
@@ -68,7 +68,7 @@ func (c *Paracross) checkTxGroup(tx *types.Transaction, index int) ([]*types.Tra
}
}
func
(
c
*
Paracross
)
saveLocalParaTxs
(
tx
*
types
.
Transaction
,
isDel
bool
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
c
*
Paracross
)
saveLocalParaTxs
(
tx
*
types
.
Transaction
,
isDel
bool
)
(
*
types
.
LocalDBSet
,
error
)
{
var
set
types
.
LocalDBSet
var
payload
pt
.
ParacrossAction
var
payload
pt
.
ParacrossAction
err
:=
types
.
Decode
(
tx
.
Payload
,
&
payload
)
err
:=
types
.
Decode
(
tx
.
Payload
,
&
payload
)
...
@@ -80,10 +80,41 @@ func (c *Paracross) saveLocalParaTxs(tx *types.Transaction, isDel bool) (*types.
...
@@ -80,10 +80,41 @@ func (c *Paracross) saveLocalParaTxs(tx *types.Transaction, isDel bool) (*types.
}
}
commit
:=
payload
.
GetCommit
()
commit
:=
payload
.
GetCommit
()
crossTxHashs
,
crossTxResult
,
err
:=
getCrossTxHashs
(
c
.
GetAPI
(),
commit
)
crossTxHashs
,
crossTxResult
,
err
:=
getCrossTxHashs
(
c
.
GetAPI
(),
commit
.
Status
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
return
c
.
udpateLocalParaTxs
(
commit
.
Status
.
Title
,
commit
.
Status
.
Height
,
crossTxHashs
,
crossTxResult
,
isDel
)
}
//无法获取到commit tx信息,从commitDone 结构里面构建
func
(
c
*
Paracross
)
saveLocalParaTxsFork
(
commitDone
*
pt
.
ReceiptParacrossDone
,
isDel
bool
)
(
*
types
.
LocalDBSet
,
error
)
{
status
:=
&
pt
.
ParacrossNodeStatus
{
MainBlockHash
:
commitDone
.
MainBlockHash
,
MainBlockHeight
:
commitDone
.
MainBlockHeight
,
Title
:
commitDone
.
Title
,
Height
:
commitDone
.
Height
,
BlockHash
:
commitDone
.
BlockHash
,
TxResult
:
commitDone
.
TxResult
,
TxHashs
:
commitDone
.
TxHashs
,
CrossTxResult
:
commitDone
.
CrossTxResult
,
CrossTxHashs
:
commitDone
.
CrossTxHashs
,
}
crossTxHashs
,
crossTxResult
,
err
:=
getCrossTxHashs
(
c
.
GetAPI
(),
status
)
if
err
!=
nil
{
return
nil
,
err
}
return
c
.
udpateLocalParaTxs
(
commitDone
.
Title
,
commitDone
.
Height
,
crossTxHashs
,
crossTxResult
,
isDel
)
}
func
(
c
*
Paracross
)
udpateLocalParaTxs
(
paraTitle
string
,
paraHeight
int64
,
crossTxHashs
[][]
byte
,
crossTxResult
[]
byte
,
isDel
bool
)
(
*
types
.
LocalDBSet
,
error
)
{
var
set
types
.
LocalDBSet
if
len
(
crossTxHashs
)
==
0
{
if
len
(
crossTxHashs
)
==
0
{
return
&
set
,
nil
return
&
set
,
nil
}
}
...
@@ -93,8 +124,8 @@ func (c *Paracross) saveLocalParaTxs(tx *types.Transaction, isDel bool) (*types.
...
@@ -93,8 +124,8 @@ func (c *Paracross) saveLocalParaTxs(tx *types.Transaction, isDel bool) (*types.
paraTx
,
err
:=
GetTx
(
c
.
GetAPI
(),
crossTxHashs
[
i
])
paraTx
,
err
:=
GetTx
(
c
.
GetAPI
(),
crossTxHashs
[
i
])
if
err
!=
nil
{
if
err
!=
nil
{
clog
.
Crit
(
"paracross.Commit Load Tx failed"
,
"para title"
,
commit
.
Status
.
Title
,
clog
.
Crit
(
"paracross.Commit Load Tx failed"
,
"para title"
,
para
Title
,
"para height"
,
commit
.
Status
.
Height
,
"para tx index"
,
i
,
"error"
,
err
,
"txHash"
,
"para height"
,
para
Height
,
"para tx index"
,
i
,
"error"
,
err
,
"txHash"
,
hex
.
EncodeToString
(
crossTxHashs
[
i
]))
hex
.
EncodeToString
(
crossTxHashs
[
i
]))
return
nil
,
err
return
nil
,
err
}
}
...
@@ -102,19 +133,19 @@ func (c *Paracross) saveLocalParaTxs(tx *types.Transaction, isDel bool) (*types.
...
@@ -102,19 +133,19 @@ func (c *Paracross) saveLocalParaTxs(tx *types.Transaction, isDel bool) (*types.
var
payload
pt
.
ParacrossAction
var
payload
pt
.
ParacrossAction
err
=
types
.
Decode
(
paraTx
.
Tx
.
Payload
,
&
payload
)
err
=
types
.
Decode
(
paraTx
.
Tx
.
Payload
,
&
payload
)
if
err
!=
nil
{
if
err
!=
nil
{
clog
.
Crit
(
"paracross.Commit Decode Tx failed"
,
"para title"
,
commit
.
Status
.
Title
,
clog
.
Crit
(
"paracross.Commit Decode Tx failed"
,
"para title"
,
para
Title
,
"para height"
,
commit
.
Status
.
Height
,
"para tx index"
,
i
,
"error"
,
err
,
"txHash"
,
"para height"
,
para
Height
,
"para tx index"
,
i
,
"error"
,
err
,
"txHash"
,
hex
.
EncodeToString
(
crossTxHashs
[
i
]))
hex
.
EncodeToString
(
crossTxHashs
[
i
]))
return
nil
,
err
return
nil
,
err
}
}
if
payload
.
Ty
==
pt
.
ParacrossActionAssetTransfer
{
if
payload
.
Ty
==
pt
.
ParacrossActionAssetTransfer
{
kv
,
err
:=
c
.
updateLocalAssetTransfer
(
tx
,
paraTx
.
Tx
,
success
,
isDel
)
kv
,
err
:=
c
.
updateLocalAssetTransfer
(
paraHeight
,
paraTx
.
Tx
,
success
,
isDel
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
set
.
KV
=
append
(
set
.
KV
,
kv
)
set
.
KV
=
append
(
set
.
KV
,
kv
)
}
else
if
payload
.
Ty
==
pt
.
ParacrossActionAssetWithdraw
{
}
else
if
payload
.
Ty
==
pt
.
ParacrossActionAssetWithdraw
{
kv
,
err
:=
c
.
initLocalAssetWithdraw
(
tx
,
paraTx
.
Tx
,
true
,
success
,
isDel
)
kv
,
err
:=
c
.
initLocalAssetWithdraw
(
paraHeight
,
paraTx
.
Tx
,
true
,
success
,
isDel
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -185,7 +216,7 @@ func (c *Paracross) initLocalAssetTransfer(tx *types.Transaction, success, isDel
...
@@ -185,7 +216,7 @@ func (c *Paracross) initLocalAssetTransfer(tx *types.Transaction, success, isDel
return
&
types
.
KeyValue
{
Key
:
key
,
Value
:
types
.
Encode
(
&
asset
)},
nil
return
&
types
.
KeyValue
{
Key
:
key
,
Value
:
types
.
Encode
(
&
asset
)},
nil
}
}
func
(
c
*
Paracross
)
initLocalAssetWithdraw
(
txCommit
,
tx
*
types
.
Transaction
,
isWithdraw
,
success
,
isDel
bool
)
(
*
types
.
KeyValue
,
error
)
{
func
(
c
*
Paracross
)
initLocalAssetWithdraw
(
paraHeight
int64
,
tx
*
types
.
Transaction
,
isWithdraw
,
success
,
isDel
bool
)
(
*
types
.
KeyValue
,
error
)
{
key
:=
calcLocalAssetKey
(
tx
.
Hash
())
key
:=
calcLocalAssetKey
(
tx
.
Hash
())
if
isDel
{
if
isDel
{
c
.
GetLocalDB
()
.
Set
(
key
,
nil
)
c
.
GetLocalDB
()
.
Set
(
key
,
nil
)
...
@@ -198,10 +229,7 @@ func (c *Paracross) initLocalAssetWithdraw(txCommit, tx *types.Transaction, isWi
...
@@ -198,10 +229,7 @@ func (c *Paracross) initLocalAssetWithdraw(txCommit, tx *types.Transaction, isWi
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
asset
.
ParaHeight
,
err
=
getCommitHeight
(
txCommit
.
Payload
)
asset
.
ParaHeight
=
paraHeight
if
err
!=
nil
{
return
nil
,
err
}
var
payload
pt
.
ParacrossAction
var
payload
pt
.
ParacrossAction
err
=
types
.
Decode
(
tx
.
Payload
,
&
payload
)
err
=
types
.
Decode
(
tx
.
Payload
,
&
payload
)
...
@@ -239,7 +267,7 @@ func (c *Paracross) initLocalAssetWithdraw(txCommit, tx *types.Transaction, isWi
...
@@ -239,7 +267,7 @@ func (c *Paracross) initLocalAssetWithdraw(txCommit, tx *types.Transaction, isWi
return
&
types
.
KeyValue
{
Key
:
key
,
Value
:
types
.
Encode
(
&
asset
)},
nil
return
&
types
.
KeyValue
{
Key
:
key
,
Value
:
types
.
Encode
(
&
asset
)},
nil
}
}
func
(
c
*
Paracross
)
updateLocalAssetTransfer
(
txCommit
,
tx
*
types
.
Transaction
,
success
,
isDel
bool
)
(
*
types
.
KeyValue
,
error
)
{
func
(
c
*
Paracross
)
updateLocalAssetTransfer
(
paraHeight
int64
,
tx
*
types
.
Transaction
,
success
,
isDel
bool
)
(
*
types
.
KeyValue
,
error
)
{
clog
.
Debug
(
"para execLocal"
,
"tx hash"
,
hex
.
EncodeToString
(
tx
.
Hash
()))
clog
.
Debug
(
"para execLocal"
,
"tx hash"
,
hex
.
EncodeToString
(
tx
.
Hash
()))
key
:=
calcLocalAssetKey
(
tx
.
Hash
())
key
:=
calcLocalAssetKey
(
tx
.
Hash
())
...
@@ -253,10 +281,8 @@ func (c *Paracross) updateLocalAssetTransfer(txCommit, tx *types.Transaction, su
...
@@ -253,10 +281,8 @@ func (c *Paracross) updateLocalAssetTransfer(txCommit, tx *types.Transaction, su
panic
(
err
)
panic
(
err
)
}
}
if
!
isDel
{
if
!
isDel
{
asset
.
ParaHeight
,
err
=
getCommitHeight
(
txCommit
.
Payload
)
asset
.
ParaHeight
=
paraHeight
if
err
!=
nil
{
return
nil
,
err
}
asset
.
CommitDoneHeight
=
c
.
GetHeight
()
asset
.
CommitDoneHeight
=
c
.
GetHeight
()
asset
.
Success
=
success
asset
.
Success
=
success
}
else
{
}
else
{
...
...
plugin/dapp/paracross/executor/superaccount.go
View file @
29629ee7
...
@@ -545,7 +545,7 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -545,7 +545,7 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
updateVotes
(
stat
,
nodes
)
updateVotes
(
stat
,
nodes
)
most
,
vote
:=
getMostVote
(
stat
)
most
,
vote
:=
getMostVote
(
stat
)
if
!
isCommitDone
(
stat
,
nodes
,
most
)
{
if
!
isCommitDone
(
nodes
,
most
)
{
superManagerPass
:=
false
superManagerPass
:=
false
if
isSuperManager
(
a
.
fromaddr
)
{
if
isSuperManager
(
a
.
fromaddr
)
{
//如果主链执行失败,交易不会过滤到平行链,如果主链成功,平行链直接成功
//如果主链执行失败,交易不会过滤到平行链,如果主链成功,平行链直接成功
...
@@ -612,6 +612,15 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -612,6 +612,15 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
}
}
receipt
=
mergeReceipt
(
receipt
,
r
)
receipt
=
mergeReceipt
(
receipt
,
r
)
if
a
.
exec
.
GetMainHeight
()
>
getDappForkHeight
(
pt
.
ForkLoopCheckCommitTxDone
){
//node quit后,如果committx满足2/3目标,自动触发commitDone
r
,
err
=
a
.
loopCommitTxDone
(
config
.
Title
)
if
err
!=
nil
{
clog
.
Error
(
"unpdateNodeGroup.loopCommitTxDone"
,
"title"
,
title
,
"err"
,
err
.
Error
())
}
receipt
=
mergeReceipt
(
receipt
,
r
)
}
stat
.
Status
=
pt
.
ParacrossNodeClosed
stat
.
Status
=
pt
.
ParacrossNodeClosed
stat
.
Height
=
a
.
height
stat
.
Height
=
a
.
height
}
}
...
@@ -664,7 +673,10 @@ func unpdateNodeGroup(db dbm.KV, title, addr string, add bool) (*types.Receipt,
...
@@ -664,7 +673,10 @@ func unpdateNodeGroup(db dbm.KV, title, addr string, add bool) (*types.Receipt,
}
}
}
}
}
}
err
=
db
.
Set
(
key
,
types
.
Encode
(
&
item
))
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
err
,
"unpdateNodeGroup set dbkey=%s"
,
key
)
}
return
makeParaNodeGroupReceipt
(
title
,
&
copyItem
,
&
item
),
nil
return
makeParaNodeGroupReceipt
(
title
,
&
copyItem
,
&
item
),
nil
}
}
...
...
plugin/dapp/paracross/proto/paracross.proto
View file @
29629ee7
...
@@ -9,8 +9,12 @@ package types;
...
@@ -9,8 +9,12 @@ package types;
// stateDB
// stateDB
message
ParacrossStatusDetails
{
message
ParacrossStatusDetails
{
repeated
string
addrs
=
1
;
repeated
string
addrs
=
1
;
repeated
bytes
blockHash
=
2
;
repeated
bytes
blockHash
=
2
;
repeated
bytes
txResult
=
3
;
repeated
bytes
txHashs
=
4
;
repeated
bytes
crossTxResult
=
5
;
repeated
bytes
crossTxHashs
=
6
;
}
}
message
ParacrossHeightStatus
{
message
ParacrossHeightStatus
{
...
@@ -35,9 +39,11 @@ message ParacrossHeightStatusRsp {
...
@@ -35,9 +39,11 @@ message ParacrossHeightStatusRsp {
}
}
message
ParacrossStatus
{
message
ParacrossStatus
{
string
title
=
1
;
string
title
=
1
;
int64
height
=
2
;
int64
height
=
2
;
bytes
blockHash
=
3
;
bytes
blockHash
=
3
;
int64
mainHeight
=
4
;
bytes
mainHash
=
5
;
}
}
message
ParacrossConsensusStatus
{
message
ParacrossConsensusStatus
{
...
@@ -219,14 +225,20 @@ message ReceiptParacrossMiner {
...
@@ -219,14 +225,20 @@ message ReceiptParacrossMiner {
}
}
message
ReceiptParacrossDone
{
message
ReceiptParacrossDone
{
int32
totalNodes
=
1
;
int32
totalNodes
=
1
;
int32
totalCommit
=
2
;
int32
totalCommit
=
2
;
int32
mostSameCommit
=
3
;
int32
mostSameCommit
=
3
;
string
title
=
4
;
string
title
=
4
;
int64
height
=
5
;
int64
height
=
5
;
bytes
stateHash
=
6
;
bytes
stateHash
=
6
;
uint32
txCounts
=
7
;
uint32
txCounts
=
7
;
bytes
txResult
=
8
;
bytes
txResult
=
8
;
bytes
blockHash
=
9
;
repeated
bytes
txHashs
=
10
;
bytes
crossTxResult
=
11
;
repeated
bytes
crossTxHashs
=
12
;
bytes
mainBlockHash
=
13
;
int64
mainBlockHeight
=
14
;
}
}
message
ReceiptParacrossRecord
{
message
ReceiptParacrossRecord
{
...
...
plugin/dapp/paracross/types/errors.go
View file @
29629ee7
...
@@ -49,4 +49,6 @@ var (
...
@@ -49,4 +49,6 @@ var (
ErrParaNodeOpStatusWrong
=
errors
.
New
(
"ErrParaNodeOpStatusWrong"
)
ErrParaNodeOpStatusWrong
=
errors
.
New
(
"ErrParaNodeOpStatusWrong"
)
//ErrParaConsensStopBlocksNotReach consensus stop blocks not reach
//ErrParaConsensStopBlocksNotReach consensus stop blocks not reach
ErrParaConsensStopBlocksNotReach
=
errors
.
New
(
"ErrParaConsensStopBlocksNotReach"
)
ErrParaConsensStopBlocksNotReach
=
errors
.
New
(
"ErrParaConsensStopBlocksNotReach"
)
//ErrForkHeightNotReach fork height not reach
ErrForkHeightNotReach
=
errors
.
New
(
"ErrForkHeightNotReach"
)
)
)
plugin/dapp/paracross/types/type.go
View file @
29629ee7
...
@@ -18,8 +18,14 @@ var (
...
@@ -18,8 +18,14 @@ var (
glog
=
log
.
New
(
"module"
,
ParaX
)
glog
=
log
.
New
(
"module"
,
ParaX
)
// ForkCommitTx main chain support paracross commit tx
// ForkCommitTx main chain support paracross commit tx
ForkCommitTx
=
"ForkParacrossCommitTx"
ForkCommitTx
=
"ForkParacrossCommitTx"
//平行链配置项对应主链的ForkCommitTx 高度
MainForkParacrossCommitTx
=
"MainForkParacrossCommitTx"
// ParaSelfConsensForkHeight para self consens height string
// ParaSelfConsensForkHeight para self consens height string
ParaSelfConsensForkHeight
=
"MainParaSelfConsensusForkHeight"
ParaSelfConsensForkHeight
=
"MainParaSelfConsensusForkHeight"
//ForkLoopCheckCommitTxDone 循环检查共识交易done的fork
ForkLoopCheckCommitTxDone
=
"ForkLoopCheckCommitTxDone"
//MainLoopCheckCommitTxDoneForkHeight 平行链的配置项,对应主链的ForkLoopCheckCommitTxDone高度
MainLoopCheckCommitTxDoneForkHeight
=
"MainLoopCheckCommitTxDoneForkHeight"
)
)
func
init
()
{
func
init
()
{
...
@@ -29,6 +35,7 @@ func init() {
...
@@ -29,6 +35,7 @@ func init() {
types
.
RegisterDappFork
(
ParaX
,
"Enable"
,
0
)
types
.
RegisterDappFork
(
ParaX
,
"Enable"
,
0
)
types
.
RegisterDappFork
(
ParaX
,
"ForkParacrossWithdrawFromParachain"
,
1298600
)
types
.
RegisterDappFork
(
ParaX
,
"ForkParacrossWithdrawFromParachain"
,
1298600
)
types
.
RegisterDappFork
(
ParaX
,
ForkCommitTx
,
1850000
)
types
.
RegisterDappFork
(
ParaX
,
ForkCommitTx
,
1850000
)
types
.
RegisterDappFork
(
ParaX
,
ForkLoopCheckCommitTxDone
,
-
1
)
}
}
// GetExecName get para exec name
// GetExecName get para exec name
...
...
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