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
a4d2f2fb
Commit
a4d2f2fb
authored
Jun 23, 2020
by
madengji
Committed by
33cn
Jun 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix review comments
parent
ef9e3ebe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
20 deletions
+2
-20
parablssign.md
plugin/consensus/para/parablssign.md
+2
-2
base.go
plugin/mempool/para/base.go
+0
-5
para_test.go
plugin/mempool/para/para_test.go
+0
-13
No files found.
plugin/consensus/para/parablssign.md
View file @
a4d2f2fb
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
>平行链多个共识节点间通过P2P组成内部局域网,把之前每个节点发送到主链的共识交易转而先互相内部广播,leader节点负责把多个共识交易聚合成一个共识交易发送给主链
>平行链多个共识节点间通过P2P组成内部局域网,把之前每个节点发送到主链的共识交易转而先互相内部广播,leader节点负责把多个共识交易聚合成一个共识交易发送给主链
#
1
. 订阅P2P topic
#
1
. 订阅P2P topic
1.
以PARA-BLS-SIGN-TOPIC为topic在P2P订阅,平行链内部节点间通过p2p广播同步消息,比如这里bls签名交易和leader同步消息
1.
以PARA-BLS-SIGN-TOPIC为topic在P2P订阅,平行链内部节点间通过p2p广播同步消息,比如这里bls签名交易和leader同步消息
#2. 协商leader
#2. 协商leader
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
1.
BLS公钥注册到主链nodegroup里面,和聚合签名一起验证BLS签名,同时防止BLS leader节点作弊
1.
BLS公钥注册到主链nodegroup里面,和聚合签名一起验证BLS签名,同时防止BLS leader节点作弊
1.
对同一高度,每个节点签名的共识消息是一样的,只需要保留一份,签名聚合成一个,公钥信息压缩到一个bitmap,作为一个交易发送
1.
对同一高度,每个节点签名的共识消息是一样的,只需要保留一份,签名聚合成一个,公钥信息压缩到一个bitmap,作为一个交易发送
1.
BLS签名有两种paring曲线,G1和G2,G1产生msg较短,G2的较长,一般公钥放G2上,签名消息放G1上,ETH采用公钥放G1,签名放G2,公钥较短,消息较长,
1.
BLS签名有两种paring曲线,G1和G2,G1产生msg较短,G2的较长,一般公钥放G2上,签名消息放G1上,ETH采用公钥放G1,签名放G2,公钥较短,消息较长,
我们由于公钥静态配置在数据库里,主链验证,签名经过消息发送,占用空间,和ETH相反比较好,
但是目前静态库似乎不支持翻转,将来支持了可以改
我们由于公钥静态配置在数据库里,主链验证,签名经过消息发送,占用空间,和ETH相反比较好,
静态库可以编译支持反转,但目前还是和ETH 2.0一致。
...
...
plugin/mempool/para/base.go
View file @
a4d2f2fb
...
@@ -49,11 +49,6 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
...
@@ -49,11 +49,6 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
reply
,
err
=
mem
.
mainGrpcCli
.
SendTransaction
(
context
.
Background
(),
tx
)
reply
,
err
=
mem
.
mainGrpcCli
.
SendTransaction
(
context
.
Background
(),
tx
)
case
types
.
EventGetProperFee
:
case
types
.
EventGetProperFee
:
reply
,
err
=
mem
.
mainGrpcCli
.
GetProperFee
(
context
.
Background
(),
&
types
.
ReqProperFee
{})
reply
,
err
=
mem
.
mainGrpcCli
.
GetProperFee
(
context
.
Background
(),
&
types
.
ReqProperFee
{})
case
types
.
EventGetMempoolSize
:
// 消息类型EventGetMempoolSize:获取mempool大小
size
:=
types
.
Conf
(
client
.
GetConfig
(),
"config.mempool"
)
.
GInt
(
"poolCacheSize"
)
msg
.
Reply
(
mem
.
client
.
NewMessage
(
"rpc"
,
types
.
EventMempoolSize
,
&
types
.
MempoolSize
{
Size
:
size
}))
continue
default
:
default
:
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
types
.
ErrActionNotSupport
))
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
types
.
ErrActionNotSupport
))
continue
continue
...
...
plugin/mempool/para/para_test.go
View file @
a4d2f2fb
...
@@ -43,17 +43,4 @@ func TestParaNodeMempool(t *testing.T) {
...
@@ -43,17 +43,4 @@ func TestParaNodeMempool(t *testing.T) {
tx
:=
util
.
CreateTxWithExecer
(
chainCfg
,
mockpara
.
Para
.
GetGenesisKey
(),
"user.p.guodun.none"
)
tx
:=
util
.
CreateTxWithExecer
(
chainCfg
,
mockpara
.
Para
.
GetGenesisKey
(),
"user.p.guodun.none"
)
hash
:=
mockpara
.
Para
.
SendTx
(
tx
)
hash
:=
mockpara
.
Para
.
SendTx
(
tx
)
assert
.
Equal
(
t
,
tx
.
Hash
(),
hash
)
assert
.
Equal
(
t
,
tx
.
Hash
(),
hash
)
_
,
err
:=
mockpara
.
Para
.
GetAPI
()
.
GetMempool
(
&
types
.
ReqGetMempool
{})
assert
.
Equal
(
t
,
err
,
types
.
ErrActionNotSupport
)
t
.
Log
(
err
)
msg
:=
para
.
GetClient
()
.
NewMessage
(
"mempool"
,
types
.
EventGetMempoolSize
,
nil
)
para
.
GetClient
()
.
Send
(
msg
,
true
)
reply
,
err
:=
para
.
GetClient
()
.
Wait
(
msg
)
if
err
!=
nil
{
t
.
Error
(
err
)
return
}
t
.
Log
(
"TestGetMempoolSize "
,
reply
.
GetData
()
.
(
*
types
.
MempoolSize
)
.
Size
)
}
}
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