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
66d7594d
Commit
66d7594d
authored
May 22, 2020
by
madengji
Committed by
33cn
Jun 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct collect addr error
parent
5ea68097
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
49 deletions
+39
-49
para.go
plugin/consensus/para/para.go
+1
-1
parablssign.go
plugin/consensus/para/parablssign.go
+34
-26
paracommitmsg.go
plugin/consensus/para/paracommitmsg.go
+3
-11
paracommitmsg_test.go
plugin/consensus/para/paracommitmsg_test.go
+0
-9
action.go
plugin/dapp/paracross/executor/action.go
+0
-0
exec.go
plugin/dapp/paracross/executor/exec.go
+1
-2
No files found.
plugin/consensus/para/para.go
View file @
66d7594d
...
@@ -93,7 +93,7 @@ type subConfig struct {
...
@@ -93,7 +93,7 @@ type subConfig struct {
MultiDownServerRspTime
uint32
`json:"multiDownServerRspTime,omitempty"`
MultiDownServerRspTime
uint32
`json:"multiDownServerRspTime,omitempty"`
RmCommitParamMainHeight
int64
`json:"rmCommitParamMainHeight,omitempty"`
RmCommitParamMainHeight
int64
`json:"rmCommitParamMainHeight,omitempty"`
JumpDownloadClose
bool
`json:"jumpDownloadClose,omitempty"`
JumpDownloadClose
bool
`json:"jumpDownloadClose,omitempty"`
BlsSign
Off
bool
`json:"blsSignOff
,omitempty"`
BlsSign
bool
`json:"blsSign
,omitempty"`
BlsLeaderSwitchInt
int32
`json:"blsLeaderSwitchInt,omitempty"`
BlsLeaderSwitchInt
int32
`json:"blsLeaderSwitchInt,omitempty"`
}
}
...
...
plugin/consensus/para/parablssign.go
View file @
66d7594d
...
@@ -24,8 +24,9 @@ const (
...
@@ -24,8 +24,9 @@ const (
maxRcvTxCount
=
100
//channel buffer, max 100 nodes, 1 height tx or 1 txgroup per node
maxRcvTxCount
=
100
//channel buffer, max 100 nodes, 1 height tx or 1 txgroup per node
leaderSyncInt
=
15
//15s heartbeat sync interval
leaderSyncInt
=
15
//15s heartbeat sync interval
defLeaderSwitchInt
=
100
//每隔100个共识高度切换一次leader,大约6小时(按50个空块间隔计算)
defLeaderSwitchInt
=
100
//每隔100个共识高度切换一次leader,大约6小时(按50个空块间隔计算)
delaySubP2pTopic
=
30
//30s to sub p2p topic
defaultP
araBlsSignTopic
=
"PARA-BLS-SIGN-TOPIC"
p
araBlsSignTopic
=
"PARA-BLS-SIGN-TOPIC"
)
)
//新增需要保证顺序
//新增需要保证顺序
...
@@ -82,7 +83,7 @@ func (b *blsClient) procLeaderSync() {
...
@@ -82,7 +83,7 @@ func (b *blsClient) procLeaderSync() {
var
feedDogTicker
<-
chan
time
.
Time
var
feedDogTicker
<-
chan
time
.
Time
var
watchDogTicker
<-
chan
time
.
Time
var
watchDogTicker
<-
chan
time
.
Time
p2pTimer
:=
time
.
After
(
time
.
Minute
)
p2pTimer
:=
time
.
After
(
delaySubP2pTopic
*
time
.
Second
)
out
:
out
:
for
{
for
{
select
{
select
{
...
@@ -92,7 +93,7 @@ out:
...
@@ -92,7 +93,7 @@ out:
if
isLeader
{
if
isLeader
{
act
:=
&
pt
.
ParaP2PSubMsg
{
Ty
:
P2pSubLeaderSyncMsg
}
act
:=
&
pt
.
ParaP2PSubMsg
{
Ty
:
P2pSubLeaderSyncMsg
}
act
.
Value
=
&
pt
.
ParaP2PSubMsg_SyncMsg
{
SyncMsg
:
&
pt
.
LeaderSyncInfo
{
ID
:
b
.
selfID
,
BaseIdx
:
base
,
Offset
:
off
}}
act
.
Value
=
&
pt
.
ParaP2PSubMsg_SyncMsg
{
SyncMsg
:
&
pt
.
LeaderSyncInfo
{
ID
:
b
.
selfID
,
BaseIdx
:
base
,
Offset
:
off
}}
err
:=
b
.
paraClient
.
SendPubP2PMsg
(
defaultP
araBlsSignTopic
,
types
.
Encode
(
act
))
err
:=
b
.
paraClient
.
SendPubP2PMsg
(
p
araBlsSignTopic
,
types
.
Encode
(
act
))
if
err
!=
nil
{
if
err
!=
nil
{
plog
.
Error
(
"para.procLeaderSync feed dog"
,
"err"
,
err
)
plog
.
Error
(
"para.procLeaderSync feed dog"
,
"err"
,
err
)
}
}
...
@@ -112,10 +113,10 @@ out:
...
@@ -112,10 +113,10 @@ out:
atomic
.
StoreUint32
(
&
b
.
feedDog
,
0
)
atomic
.
StoreUint32
(
&
b
.
feedDog
,
0
)
case
<-
p2pTimer
:
case
<-
p2pTimer
:
err
:=
b
.
paraClient
.
SendSubP2PTopic
(
defaultP
araBlsSignTopic
)
err
:=
b
.
paraClient
.
SendSubP2PTopic
(
p
araBlsSignTopic
)
if
err
!=
nil
{
if
err
!=
nil
{
plog
.
Error
(
"procLeaderSync.SubP2PTopic"
,
"err"
,
err
)
plog
.
Error
(
"procLeaderSync.SubP2PTopic"
,
"err"
,
err
)
p2pTimer
=
time
.
After
(
time
.
Minute
)
p2pTimer
=
time
.
After
(
delaySubP2pTopic
*
time
.
Second
)
continue
continue
}
}
feedDogTicker
=
time
.
NewTicker
(
leaderSyncInt
*
time
.
Second
)
.
C
feedDogTicker
=
time
.
NewTicker
(
leaderSyncInt
*
time
.
Second
)
.
C
...
@@ -201,7 +202,7 @@ out:
...
@@ -201,7 +202,7 @@ out:
if
isLeader
{
if
isLeader
{
b
.
sendAggregateTx
(
nodes
)
b
.
sendAggregateTx
(
nodes
)
}
}
//聚合签名总共消耗大约1.5ms
//清空txsBuff,重新收集
//清空txsBuff,重新收集
b
.
commitsPool
=
make
(
map
[
int64
]
*
pt
.
ParaBlsSignSumDetails
)
b
.
commitsPool
=
make
(
map
[
int64
]
*
pt
.
ParaBlsSignSumDetails
)
b
.
mutex
.
Unlock
()
b
.
mutex
.
Unlock
()
...
@@ -218,7 +219,7 @@ func (b *blsClient) sendAggregateTx(nodes []string) error {
...
@@ -218,7 +219,7 @@ func (b *blsClient) sendAggregateTx(nodes []string) error {
if
len
(
dones
)
<=
0
{
if
len
(
dones
)
<=
0
{
return
nil
return
nil
}
}
acts
,
err
:=
b
.
A
ggregateCommit2Action
(
nodes
,
dones
)
acts
,
err
:=
a
ggregateCommit2Action
(
nodes
,
dones
)
if
err
!=
nil
{
if
err
!=
nil
{
plog
.
Error
(
"sendAggregateTx AggregateCommit2Action"
,
"err"
,
err
)
plog
.
Error
(
"sendAggregateTx AggregateCommit2Action"
,
"err"
,
err
)
return
err
return
err
...
@@ -273,7 +274,7 @@ func (b *blsClient) checkCommitTx(txs []*types.Transaction) ([]*pt.ParacrossComm
...
@@ -273,7 +274,7 @@ func (b *blsClient) checkCommitTx(txs []*types.Transaction) ([]*pt.ParacrossComm
if
tx
.
From
()
!=
commit
.
Bls
.
Addrs
[
0
]
{
if
tx
.
From
()
!=
commit
.
Bls
.
Addrs
[
0
]
{
return
nil
,
errors
.
Wrapf
(
types
.
ErrFromAddr
,
"from=%s,bls addr=%s"
,
tx
.
From
(),
commit
.
Bls
.
Addrs
[
0
])
return
nil
,
errors
.
Wrapf
(
types
.
ErrFromAddr
,
"from=%s,bls addr=%s"
,
tx
.
From
(),
commit
.
Bls
.
Addrs
[
0
])
}
}
//验证bls 签名
//验证bls 签名
,大概40ms, 是secp 80倍
err
=
b
.
verifyBlsSign
(
tx
.
From
(),
commit
)
err
=
b
.
verifyBlsSign
(
tx
.
From
(),
commit
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
pt
.
ErrBlsSignVerify
,
"from=%s"
,
tx
.
From
())
return
nil
,
errors
.
Wrapf
(
pt
.
ErrBlsSignVerify
,
"from=%s"
,
tx
.
From
())
...
@@ -284,6 +285,15 @@ func (b *blsClient) checkCommitTx(txs []*types.Transaction) ([]*pt.ParacrossComm
...
@@ -284,6 +285,15 @@ func (b *blsClient) checkCommitTx(txs []*types.Transaction) ([]*pt.ParacrossComm
return
commits
,
nil
return
commits
,
nil
}
}
func
hasCommited
(
addrs
[]
string
,
addr
string
)
(
bool
,
int
)
{
for
i
,
a
:=
range
addrs
{
if
a
==
addr
{
return
true
,
i
}
}
return
false
,
0
}
//整合相同高度commits
//整合相同高度commits
func
integrateCommits
(
pool
map
[
int64
]
*
pt
.
ParaBlsSignSumDetails
,
commits
[]
*
pt
.
ParacrossCommitAction
)
{
func
integrateCommits
(
pool
map
[
int64
]
*
pt
.
ParaBlsSignSumDetails
,
commits
[]
*
pt
.
ParacrossCommitAction
)
{
for
_
,
cmt
:=
range
commits
{
for
_
,
cmt
:=
range
commits
{
...
@@ -291,14 +301,13 @@ func integrateCommits(pool map[int64]*pt.ParaBlsSignSumDetails, commits []*pt.Pa
...
@@ -291,14 +301,13 @@ func integrateCommits(pool map[int64]*pt.ParaBlsSignSumDetails, commits []*pt.Pa
pool
[
cmt
.
Status
.
Height
]
=
&
pt
.
ParaBlsSignSumDetails
{
Height
:
cmt
.
Status
.
Height
}
pool
[
cmt
.
Status
.
Height
]
=
&
pt
.
ParaBlsSignSumDetails
{
Height
:
cmt
.
Status
.
Height
}
}
}
a
:=
pool
[
cmt
.
Status
.
Height
]
a
:=
pool
[
cmt
.
Status
.
Height
]
for
i
,
v
:=
range
a
.
Addrs
{
found
,
i
:=
hasCommited
(
a
.
Addrs
,
cmt
.
Bls
.
Addrs
[
0
])
//节点更新交易参数的场景
if
found
{
if
v
==
cmt
.
Bls
.
Addrs
[
0
]
{
a
.
Msgs
[
i
]
=
types
.
Encode
(
cmt
.
Status
)
a
.
Msgs
[
i
]
=
types
.
Encode
(
cmt
.
Status
)
a
.
Signs
[
i
]
=
cmt
.
Bls
.
Sign
a
.
Signs
[
i
]
=
cmt
.
Bls
.
Sign
continue
continue
}
}
}
a
.
Addrs
=
append
(
a
.
Addrs
,
cmt
.
Bls
.
Addrs
[
0
])
a
.
Addrs
=
append
(
a
.
Addrs
,
cmt
.
Bls
.
Addrs
[
0
])
a
.
Msgs
=
append
(
a
.
Msgs
,
types
.
Encode
(
cmt
.
Status
))
a
.
Msgs
=
append
(
a
.
Msgs
,
types
.
Encode
(
cmt
.
Status
))
a
.
Signs
=
append
(
a
.
Signs
,
cmt
.
Bls
.
Sign
)
a
.
Signs
=
append
(
a
.
Signs
,
cmt
.
Bls
.
Sign
)
...
@@ -322,26 +331,25 @@ func isMostCommitDone(peers int, txsBuff map[int64]*pt.ParaBlsSignSumDetails) bo
...
@@ -322,26 +331,25 @@ func isMostCommitDone(peers int, txsBuff map[int64]*pt.ParaBlsSignSumDetails) bo
}
}
//找出共识并达到2/3的commits, 并去除与共识不同的commits,为后面聚合签名做准备
//找出共识并达到2/3的commits, 并去除与共识不同的commits,为后面聚合签名做准备
func
filterDoneCommits
(
peers
int
,
txs
map
[
int64
]
*
pt
.
ParaBlsSignSumDetails
)
[]
*
pt
.
ParaBlsSignSumDetails
{
func
filterDoneCommits
(
peers
int
,
pool
map
[
int64
]
*
pt
.
ParaBlsSignSumDetails
)
[]
*
pt
.
ParaBlsSignSumDetails
{
var
seq
[]
int64
var
seq
[]
int64
for
i
,
v
:=
range
txs
{
for
i
,
v
:=
range
pool
{
most
,
hash
:=
getMostCommit
(
v
.
Msgs
)
most
,
hash
:=
getMostCommit
(
v
.
Msgs
)
if
!
isCommitDone
(
peers
,
most
)
{
if
!
isCommitDone
(
peers
,
most
)
{
plog
.
Debug
(
"blssign.filterDoneCommits not commit done"
,
"height"
,
i
)
plog
.
Debug
(
"blssign.filterDoneCommits not commit done"
,
"height"
,
i
)
delete
(
txs
,
i
)
continue
continue
}
}
seq
=
append
(
seq
,
i
)
seq
=
append
(
seq
,
i
)
//只保留与most相同的commits做聚合签名使用
//只保留与most相同的commits做聚合签名使用
a
:=
&
pt
.
ParaBlsSignSumDetails
{
Msgs
:
[][]
byte
{[]
byte
(
hash
)}}
a
:=
&
pt
.
ParaBlsSignSumDetails
{
Height
:
i
,
Msgs
:
[][]
byte
{[]
byte
(
hash
)}}
for
j
,
m
:=
range
v
.
Msgs
{
for
j
,
m
:=
range
v
.
Msgs
{
if
bytes
.
Equal
([]
byte
(
hash
),
m
)
{
if
bytes
.
Equal
([]
byte
(
hash
),
m
)
{
a
.
Addrs
=
append
(
a
.
Addrs
,
v
.
Addrs
[
j
])
a
.
Addrs
=
append
(
a
.
Addrs
,
v
.
Addrs
[
j
])
a
.
Signs
=
append
(
a
.
Signs
,
v
.
Signs
[
j
])
a
.
Signs
=
append
(
a
.
Signs
,
v
.
Signs
[
j
])
}
}
}
}
txs
[
i
]
=
a
pool
[
i
]
=
a
}
}
if
len
(
seq
)
<=
0
{
if
len
(
seq
)
<=
0
{
...
@@ -350,7 +358,6 @@ func filterDoneCommits(peers int, txs map[int64]*pt.ParaBlsSignSumDetails) []*pt
...
@@ -350,7 +358,6 @@ func filterDoneCommits(peers int, txs map[int64]*pt.ParaBlsSignSumDetails) []*pt
//从低到高找出连续的commits
//从低到高找出连续的commits
sort
.
Slice
(
seq
,
func
(
i
,
j
int
)
bool
{
return
seq
[
i
]
<
seq
[
j
]
})
sort
.
Slice
(
seq
,
func
(
i
,
j
int
)
bool
{
return
seq
[
i
]
<
seq
[
j
]
})
plog
.
Debug
(
"blssign.filterDoneCommits"
,
"seq"
,
seq
)
var
signs
[]
*
pt
.
ParaBlsSignSumDetails
var
signs
[]
*
pt
.
ParaBlsSignSumDetails
//共识高度要连续,不连续则退出
//共识高度要连续,不连续则退出
lastSeq
:=
seq
[
0
]
-
1
lastSeq
:=
seq
[
0
]
-
1
...
@@ -358,7 +365,7 @@ func filterDoneCommits(peers int, txs map[int64]*pt.ParaBlsSignSumDetails) []*pt
...
@@ -358,7 +365,7 @@ func filterDoneCommits(peers int, txs map[int64]*pt.ParaBlsSignSumDetails) []*pt
if
lastSeq
+
1
!=
h
{
if
lastSeq
+
1
!=
h
{
return
signs
return
signs
}
}
signs
=
append
(
signs
,
txs
[
h
])
signs
=
append
(
signs
,
pool
[
h
])
lastSeq
=
h
lastSeq
=
h
}
}
return
signs
return
signs
...
@@ -366,7 +373,7 @@ func filterDoneCommits(peers int, txs map[int64]*pt.ParaBlsSignSumDetails) []*pt
...
@@ -366,7 +373,7 @@ func filterDoneCommits(peers int, txs map[int64]*pt.ParaBlsSignSumDetails) []*pt
}
}
//聚合多个签名为一个签名,并设置地址bitmap
//聚合多个签名为一个签名,并设置地址bitmap
func
(
b
*
blsClient
)
A
ggregateCommit2Action
(
nodes
[]
string
,
commits
[]
*
pt
.
ParaBlsSignSumDetails
)
([]
*
pt
.
ParacrossCommitAction
,
error
)
{
func
a
ggregateCommit2Action
(
nodes
[]
string
,
commits
[]
*
pt
.
ParaBlsSignSumDetails
)
([]
*
pt
.
ParacrossCommitAction
,
error
)
{
var
notify
[]
*
pt
.
ParacrossCommitAction
var
notify
[]
*
pt
.
ParacrossCommitAction
for
_
,
v
:=
range
commits
{
for
_
,
v
:=
range
commits
{
...
@@ -375,13 +382,14 @@ func (b *blsClient) AggregateCommit2Action(nodes []string, commits []*pt.ParaBls
...
@@ -375,13 +382,14 @@ func (b *blsClient) AggregateCommit2Action(nodes []string, commits []*pt.ParaBls
types
.
Decode
(
v
.
Msgs
[
0
],
s
)
types
.
Decode
(
v
.
Msgs
[
0
],
s
)
a
.
Status
=
s
a
.
Status
=
s
sign
,
err
:=
b
.
aggregateSigns
(
v
.
Signs
)
sign
,
err
:=
aggregateSigns
(
v
.
Signs
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
err
,
"bls aggreate=%s"
,
v
.
Addrs
)
return
nil
,
errors
.
Wrapf
(
err
,
"bls aggre
g
ate=%s"
,
v
.
Addrs
)
}
}
signData
:=
sign
.
Serialize
()
signData
:=
sign
.
Serialize
()
a
.
Bls
.
Sign
=
append
(
a
.
Bls
.
Sign
,
signData
[
:
]
...
)
a
.
Bls
.
Sign
=
append
(
a
.
Bls
.
Sign
,
signData
[
:
]
...
)
bits
,
remains
:=
setAddrsBitMap
(
nodes
,
v
.
Addrs
)
bits
,
remains
:=
setAddrsBitMap
(
nodes
,
v
.
Addrs
)
plog
.
Debug
(
"AggregateCommit2Action"
,
"nodes"
,
nodes
,
"addr"
,
v
.
Addrs
,
"bits"
,
common
.
ToHex
(
bits
),
"height"
,
v
.
Height
)
if
len
(
remains
)
>
0
{
if
len
(
remains
)
>
0
{
plog
.
Info
(
"bls.signDoneCommits"
,
"remains"
,
remains
)
plog
.
Info
(
"bls.signDoneCommits"
,
"remains"
,
remains
)
}
}
...
@@ -391,7 +399,7 @@ func (b *blsClient) AggregateCommit2Action(nodes []string, commits []*pt.ParaBls
...
@@ -391,7 +399,7 @@ func (b *blsClient) AggregateCommit2Action(nodes []string, commits []*pt.ParaBls
return
notify
,
nil
return
notify
,
nil
}
}
func
(
b
*
blsClient
)
aggregateSigns
(
signs
[][]
byte
)
(
*
g2pubs
.
Signature
,
error
)
{
func
aggregateSigns
(
signs
[][]
byte
)
(
*
g2pubs
.
Signature
,
error
)
{
var
signatures
[]
*
g2pubs
.
Signature
var
signatures
[]
*
g2pubs
.
Signature
for
_
,
data
:=
range
signs
{
for
_
,
data
:=
range
signs
{
var
s
[
48
]
byte
var
s
[
48
]
byte
...
...
plugin/consensus/para/paracommitmsg.go
View file @
66d7594d
...
@@ -188,11 +188,11 @@ func (client *commitMsgClient) createCommitTx() {
...
@@ -188,11 +188,11 @@ func (client *commitMsgClient) createCommitTx() {
return
return
}
}
//bls sign, send to p2p
//bls sign, send to p2p
if
!
client
.
paraClient
.
subCfg
.
BlsSignOff
{
if
client
.
paraClient
.
subCfg
.
BlsSign
{
//send to p2p pubsub
//send to p2p pubsub
plog
.
Info
(
"para commitMs send to p2p"
,
"hash"
,
common
.
ToHex
(
tx
.
Hash
()))
plog
.
Info
(
"para commitMs send to p2p"
,
"hash"
,
common
.
ToHex
(
tx
.
Hash
()))
act
:=
&
pt
.
ParaP2PSubMsg
{
Ty
:
P2pSubCommitTx
,
Value
:
&
pt
.
ParaP2PSubMsg_CommitTx
{
CommitTx
:
tx
}}
act
:=
&
pt
.
ParaP2PSubMsg
{
Ty
:
P2pSubCommitTx
,
Value
:
&
pt
.
ParaP2PSubMsg_CommitTx
{
CommitTx
:
tx
}}
client
.
paraClient
.
SendPubP2PMsg
(
defaultP
araBlsSignTopic
,
types
.
Encode
(
act
))
client
.
paraClient
.
SendPubP2PMsg
(
p
araBlsSignTopic
,
types
.
Encode
(
act
))
return
return
}
}
client
.
pushCommitTx
(
tx
)
client
.
pushCommitTx
(
tx
)
...
@@ -314,15 +314,7 @@ func (client *commitMsgClient) reSendCommitTx(tx *types.Transaction) bool {
...
@@ -314,15 +314,7 @@ func (client *commitMsgClient) reSendCommitTx(tx *types.Transaction) bool {
if
client
.
checkTxCommitTimes
<
client
.
waitMainBlocks
{
if
client
.
checkTxCommitTimes
<
client
.
waitMainBlocks
{
return
false
return
false
}
}
client
.
checkTxCommitTimes
=
0
client
.
checkTxCommitTimes
=
0
//bls聚合签名场景,发送未成功上链,继续发送交易
if
!
client
.
paraClient
.
subCfg
.
BlsSignOff
{
//resend tx
client
.
sendMsgCh
<-
tx
return
false
}
//非聚合签名场景,发送未成功,触发重新构建交易发送
client
.
resetSendEnv
()
client
.
resetSendEnv
()
return
true
return
true
}
}
...
@@ -429,7 +421,7 @@ func (client *commitMsgClient) getSendingTx(startHeight, endHeight int64) (*type
...
@@ -429,7 +421,7 @@ func (client *commitMsgClient) getSendingTx(startHeight, endHeight int64) (*type
commits
=
append
(
commits
,
&
pt
.
ParacrossCommitAction
{
Status
:
stat
})
commits
=
append
(
commits
,
&
pt
.
ParacrossCommitAction
{
Status
:
stat
})
}
}
if
!
client
.
paraClient
.
subCfg
.
BlsSignOff
{
if
client
.
paraClient
.
subCfg
.
BlsSign
{
err
=
client
.
paraClient
.
blsSignCli
.
blsSign
(
commits
)
err
=
client
.
paraClient
.
blsSignCli
.
blsSign
(
commits
)
if
err
!=
nil
{
if
err
!=
nil
{
plog
.
Error
(
"paracommitmsg bls sign"
,
"err"
,
err
)
plog
.
Error
(
"paracommitmsg bls sign"
,
"err"
,
err
)
...
...
plugin/consensus/para/paracommitmsg_test.go
View file @
66d7594d
...
@@ -7,8 +7,6 @@ package para
...
@@ -7,8 +7,6 @@ package para
import
(
import
(
"testing"
"testing"
"encoding/hex"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/queue"
_
"github.com/33cn/chain33/system"
_
"github.com/33cn/chain33/system"
drivers
"github.com/33cn/chain33/system/consensus"
drivers
"github.com/33cn/chain33/system/consensus"
...
@@ -73,10 +71,3 @@ func TestSetSelfConsEnable(t *testing.T) {
...
@@ -73,10 +71,3 @@ func TestSetSelfConsEnable(t *testing.T) {
assert
.
Equal
(
t
,
ep1
,
para
.
commitMsgClient
.
selfConsEnableList
)
assert
.
Equal
(
t
,
ep1
,
para
.
commitMsgClient
.
selfConsEnableList
)
}
}
func
TestSetAddrsBitMap
(
t
*
testing
.
T
)
{
nodes
:=
[]
string
{
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
,
"1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR"
,
"1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k"
,
"1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
}
addrs
:=
[]
string
{
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
}
val
,
remain
:=
setAddrsBitMap
(
nodes
,
addrs
)
t
.
Log
(
"val"
,
hex
.
EncodeToString
(
val
),
"remain"
,
remain
)
}
plugin/dapp/paracross/executor/action.go
View file @
66d7594d
This diff is collapsed.
Click to expand it.
plugin/dapp/paracross/executor/exec.go
View file @
66d7594d
...
@@ -9,7 +9,6 @@ import (
...
@@ -9,7 +9,6 @@ import (
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/pkg/errors"
)
)
//Exec_Commit consensus commit tx exec process
//Exec_Commit consensus commit tx exec process
...
@@ -18,7 +17,7 @@ func (e *Paracross) Exec_Commit(payload *pt.ParacrossCommitAction, tx *types.Tra
...
@@ -18,7 +17,7 @@ func (e *Paracross) Exec_Commit(payload *pt.ParacrossCommitAction, tx *types.Tra
receipt
,
err
:=
a
.
Commit
(
payload
)
receipt
,
err
:=
a
.
Commit
(
payload
)
if
err
!=
nil
{
if
err
!=
nil
{
clog
.
Error
(
"Paracross commit failed"
,
"error"
,
err
,
"hash"
,
hex
.
EncodeToString
(
tx
.
Hash
()))
clog
.
Error
(
"Paracross commit failed"
,
"error"
,
err
,
"hash"
,
hex
.
EncodeToString
(
tx
.
Hash
()))
return
nil
,
err
ors
.
Cause
(
err
)
return
nil
,
err
}
}
return
receipt
,
nil
return
receipt
,
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