Commit a4d2f2fb authored by madengji's avatar madengji Committed by 33cn

fix review comments

parent ef9e3ebe
......@@ -2,7 +2,7 @@
>平行链多个共识节点间通过P2P组成内部局域网,把之前每个节点发送到主链的共识交易转而先互相内部广播,leader节点负责把多个共识交易聚合成一个共识交易发送给主链
#. 订阅P2P topic
#1. 订阅P2P topic
1. 以PARA-BLS-SIGN-TOPIC为topic在P2P订阅,平行链内部节点间通过p2p广播同步消息,比如这里bls签名交易和leader同步消息
#2. 协商leader
......@@ -22,7 +22,7 @@
1. BLS公钥注册到主链nodegroup里面,和聚合签名一起验证BLS签名,同时防止BLS leader节点作弊
1. 对同一高度,每个节点签名的共识消息是一样的,只需要保留一份,签名聚合成一个,公钥信息压缩到一个bitmap,作为一个交易发送
1. BLS签名有两种paring曲线,G1和G2,G1产生msg较短,G2的较长,一般公钥放G2上,签名消息放G1上,ETH采用公钥放G1,签名放G2,公钥较短,消息较长,
我们由于公钥静态配置在数据库里,主链验证,签名经过消息发送,占用空间,和ETH相反比较好,但是目前静态库似乎不支持翻转,将来支持了可以改
我们由于公钥静态配置在数据库里,主链验证,签名经过消息发送,占用空间,和ETH相反比较好,静态库可以编译支持反转,但目前还是和ETH 2.0一致。
......
......@@ -49,11 +49,6 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
reply, err = mem.mainGrpcCli.SendTransaction(context.Background(), tx)
case types.EventGetProperFee:
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:
msg.Reply(client.NewMessage(mem.key, types.EventReply, types.ErrActionNotSupport))
continue
......
......@@ -43,17 +43,4 @@ func TestParaNodeMempool(t *testing.T) {
tx := util.CreateTxWithExecer(chainCfg, mockpara.Para.GetGenesisKey(), "user.p.guodun.none")
hash := mockpara.Para.SendTx(tx)
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)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment