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
978fa4d4
Commit
978fa4d4
authored
Apr 26, 2019
by
mdj33
Committed by
vipwzw
May 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
super manager can pass by consens stop height
parent
cdef5a14
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
4 deletions
+50
-4
chain33.toml
chain33.toml
+1
-0
chain33.para.toml
plugin/dapp/paracross/cmd/build/chain33.para.toml
+2
-0
testcase.sh
plugin/dapp/paracross/cmd/build/testcase.sh
+30
-1
superaccount.go
plugin/dapp/paracross/executor/superaccount.go
+17
-3
No files found.
chain33.toml
View file @
978fa4d4
...
@@ -214,5 +214,6 @@ superManager=[
...
@@ -214,5 +214,6 @@ superManager=[
]
]
[exec.sub.paracross]
[exec.sub.paracross]
nodeGroupFrozenCoins
=
0
nodeGroupFrozenCoins
=
0
paraConsensusStopBlocks
=
100
plugin/dapp/paracross/cmd/build/chain33.para.toml
View file @
978fa4d4
...
@@ -153,6 +153,8 @@ tokenApprs = [
...
@@ -153,6 +153,8 @@ tokenApprs = [
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
,
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
,
]
]
[exec.sub.paracross]
paraConsensusStopBlocks
=
100
[pprof]
[pprof]
listenAddr
=
"localhost:6061"
listenAddr
=
"localhost:6061"
plugin/dapp/paracross/cmd/build/testcase.sh
View file @
978fa4d4
...
@@ -446,7 +446,7 @@ function para_cross_transfer_withdraw_for_token() {
...
@@ -446,7 +446,7 @@ function para_cross_transfer_withdraw_for_token() {
done
done
}
}
function
para_nodemanage_
test
()
{
function
para_nodemanage_
node_join
()
{
echo
"================# para node manage test ================="
echo
"================# para node manage test ================="
balance
=
$(${
CLI
}
account balance
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-e
paracross | jq
-r
".balance"
)
balance
=
$(${
CLI
}
account balance
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-e
paracross | jq
-r
".balance"
)
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
...
@@ -472,6 +472,35 @@ function para_nodemanage_test() {
...
@@ -472,6 +472,35 @@ function para_nodemanage_test() {
exit
1
exit
1
fi
fi
}
function
para_nodemanage_quit_test
(){
para_nodemanage_node_join
echo
"=========== # para chain node quit ============="
hash
=
$(${
PARA_CLI
}
send para node
-o
quit
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-k
0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588
)
echo
"
${
hash
}
"
query_tx
"
${
PARA_CLI
}
"
"
${
hash
}
"
balance
=
$(${
CLI
}
account balance
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-e
paracross | jq
-r
".balance"
)
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
echo
"unfrozen coinfrozen error balance=
$balance
"
exit
1
fi
status
=
$(${
PARA_CLI
}
para node_status
-t
user.p.para.
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY | jq
-r
".status"
)
if
[
"
${
status
}
"
!=
"4"
]
;
then
echo
"wrong vote status"
${
PARA_CLI
}
para node_status
-t
user.p.para.
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
exit
1
fi
}
function
para_nodemanage_test
()
{
para_nodemanage_quit_test
para_nodemanage_node_join
echo
"=========== # para chain node vote ============="
echo
"=========== # para chain node vote ============="
${
PARA_CLI
}
send para node
-o
vote
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-v
yes
-k
0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
${
PARA_CLI
}
send para node
-o
vote
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-v
yes
-k
0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
${
PARA_CLI
}
send para node
-o
vote
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-v
yes
-k
0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4
${
PARA_CLI
}
send para node
-o
vote
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-v
yes
-k
0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4
...
...
plugin/dapp/paracross/executor/superaccount.go
View file @
978fa4d4
...
@@ -329,9 +329,23 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
...
@@ -329,9 +329,23 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
}
}
most
,
vote
:=
getMostVote
(
stat
)
most
,
vote
:=
getMostVote
(
stat
)
if
!
isCommitDone
(
stat
,
nodes
,
most
)
{
if
!
isCommitDone
(
stat
,
nodes
,
most
)
{
//超级用户投yes票,就可以通过,防止当前所有授权节点都忘掉私钥场景
superManagerPass
:=
false
//超级用户且当前group里面有任一账户投yes票也可以通过是备选方案 (most >1)即可
if
isSuperManager
(
a
.
fromaddr
){
if
!
(
isSuperManager
(
a
.
fromaddr
)
&&
most
>
0
&&
vote
==
pt
.
ParaNodeVoteYes
)
{
confStopBlocks
:=
conf
.
GInt
(
"paraConsensusStopBlocks"
)
data
,
err
:=
a
.
exec
.
paracrossGetHeight
(
config
.
Title
)
if
err
!=
nil
{
clog
.
Info
(
"paracross.nodeVote get consens height"
,
"err"
,
err
.
Error
())
return
nil
,
err
}
consensHeight
:=
data
.
(
*
pt
.
ParacrossStatus
)
.
Height
if
a
.
exec
.
GetMainHeight
()
>
consensHeight
+
confStopBlocks
{
clog
.
Info
(
"paracross.nodeVote, super manager pass"
,
"currHeight"
,
a
.
height
,
"consensHeight"
,
consensHeight
,
"confHeight"
,
confStopBlocks
)
superManagerPass
=
true
}
}
//超级用户投yes票,共识停止了一定高度就可以通过,防止当前所有授权节点都忘掉私钥场景
if
!
(
superManagerPass
&&
most
>
0
&&
vote
==
pt
.
ParaNodeVoteYes
)
{
saveNodeAddr
(
a
.
db
,
key
,
stat
)
saveNodeAddr
(
a
.
db
,
key
,
stat
)
return
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
&
copyStat
,
stat
),
nil
return
makeNodeConfigReceipt
(
a
.
fromaddr
,
config
,
&
copyStat
,
stat
),
nil
}
}
...
...
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