Commit 521b6f8d authored by duanjinfei's avatar duanjinfei

batch broadcastTx test

parent f1fb7079
......@@ -134,7 +134,6 @@ func (m *Sha3Request) GetData() []byte {
}
type Sha3Response struct {
//
Hash *github_com_CaduceusMetaverseProtocol_MetaTypes_types.Hash `protobuf:"bytes,1,opt,name=hash,proto3,customtype=github.com/CaduceusMetaverseProtocol/MetaTypes/types.Hash" json:"hash,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
......
......@@ -68,6 +68,82 @@ func (m *BroadcastEthTxWithFromRequest) GetFrom() string {
return ""
}
type BroadcastEthTxWithFromRequests struct {
List []*BroadcastEthTxWithFromRequest `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BroadcastEthTxWithFromRequests) Reset() { *m = BroadcastEthTxWithFromRequests{} }
func (m *BroadcastEthTxWithFromRequests) String() string { return proto.CompactTextString(m) }
func (*BroadcastEthTxWithFromRequests) ProtoMessage() {}
func (*BroadcastEthTxWithFromRequests) Descriptor() ([]byte, []int) {
return fileDescriptor_2dc67120507b0009, []int{1}
}
func (m *BroadcastEthTxWithFromRequests) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BroadcastEthTxWithFromRequests.Unmarshal(m, b)
}
func (m *BroadcastEthTxWithFromRequests) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BroadcastEthTxWithFromRequests.Marshal(b, m, deterministic)
}
func (m *BroadcastEthTxWithFromRequests) XXX_Merge(src proto.Message) {
xxx_messageInfo_BroadcastEthTxWithFromRequests.Merge(m, src)
}
func (m *BroadcastEthTxWithFromRequests) XXX_Size() int {
return xxx_messageInfo_BroadcastEthTxWithFromRequests.Size(m)
}
func (m *BroadcastEthTxWithFromRequests) XXX_DiscardUnknown() {
xxx_messageInfo_BroadcastEthTxWithFromRequests.DiscardUnknown(m)
}
var xxx_messageInfo_BroadcastEthTxWithFromRequests proto.InternalMessageInfo
func (m *BroadcastEthTxWithFromRequests) GetList() []*BroadcastEthTxWithFromRequest {
if m != nil {
return m.List
}
return nil
}
type ResponseBroadcastTxs struct {
List []*ResponseBroadcastTx `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ResponseBroadcastTxs) Reset() { *m = ResponseBroadcastTxs{} }
func (m *ResponseBroadcastTxs) String() string { return proto.CompactTextString(m) }
func (*ResponseBroadcastTxs) ProtoMessage() {}
func (*ResponseBroadcastTxs) Descriptor() ([]byte, []int) {
return fileDescriptor_2dc67120507b0009, []int{2}
}
func (m *ResponseBroadcastTxs) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ResponseBroadcastTxs.Unmarshal(m, b)
}
func (m *ResponseBroadcastTxs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ResponseBroadcastTxs.Marshal(b, m, deterministic)
}
func (m *ResponseBroadcastTxs) XXX_Merge(src proto.Message) {
xxx_messageInfo_ResponseBroadcastTxs.Merge(m, src)
}
func (m *ResponseBroadcastTxs) XXX_Size() int {
return xxx_messageInfo_ResponseBroadcastTxs.Size(m)
}
func (m *ResponseBroadcastTxs) XXX_DiscardUnknown() {
xxx_messageInfo_ResponseBroadcastTxs.DiscardUnknown(m)
}
var xxx_messageInfo_ResponseBroadcastTxs proto.InternalMessageInfo
func (m *ResponseBroadcastTxs) GetList() []*ResponseBroadcastTx {
if m != nil {
return m.List
}
return nil
}
type RequestPing struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
......@@ -78,7 +154,7 @@ func (m *RequestPing) Reset() { *m = RequestPing{} }
func (m *RequestPing) String() string { return proto.CompactTextString(m) }
func (*RequestPing) ProtoMessage() {}
func (*RequestPing) Descriptor() ([]byte, []int) {
return fileDescriptor_2dc67120507b0009, []int{1}
return fileDescriptor_2dc67120507b0009, []int{3}
}
func (m *RequestPing) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RequestPing.Unmarshal(m, b)
......@@ -108,7 +184,7 @@ func (m *ResponsePing) Reset() { *m = ResponsePing{} }
func (m *ResponsePing) String() string { return proto.CompactTextString(m) }
func (*ResponsePing) ProtoMessage() {}
func (*ResponsePing) Descriptor() ([]byte, []int) {
return fileDescriptor_2dc67120507b0009, []int{2}
return fileDescriptor_2dc67120507b0009, []int{4}
}
func (m *ResponsePing) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ResponsePing.Unmarshal(m, b)
......@@ -139,7 +215,7 @@ func (m *RequestBroadcastTx) Reset() { *m = RequestBroadcastTx{} }
func (m *RequestBroadcastTx) String() string { return proto.CompactTextString(m) }
func (*RequestBroadcastTx) ProtoMessage() {}
func (*RequestBroadcastTx) Descriptor() ([]byte, []int) {
return fileDescriptor_2dc67120507b0009, []int{3}
return fileDescriptor_2dc67120507b0009, []int{5}
}
func (m *RequestBroadcastTx) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RequestBroadcastTx.Unmarshal(m, b)
......@@ -177,7 +253,7 @@ func (m *ResponseBroadcastTx) Reset() { *m = ResponseBroadcastTx{} }
func (m *ResponseBroadcastTx) String() string { return proto.CompactTextString(m) }
func (*ResponseBroadcastTx) ProtoMessage() {}
func (*ResponseBroadcastTx) Descriptor() ([]byte, []int) {
return fileDescriptor_2dc67120507b0009, []int{4}
return fileDescriptor_2dc67120507b0009, []int{6}
}
func (m *ResponseBroadcastTx) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ResponseBroadcastTx.Unmarshal(m, b)
......@@ -206,6 +282,8 @@ func (m *ResponseBroadcastTx) GetHash() []byte {
func init() {
proto.RegisterType((*BroadcastEthTxWithFromRequest)(nil), "ring.v1.broadcastEthTxWithFromRequest")
proto.RegisterType((*BroadcastEthTxWithFromRequests)(nil), "ring.v1.broadcastEthTxWithFromRequests")
proto.RegisterType((*ResponseBroadcastTxs)(nil), "ring.v1.ResponseBroadcastTxs")
proto.RegisterType((*RequestPing)(nil), "ring.v1.RequestPing")
proto.RegisterType((*ResponsePing)(nil), "ring.v1.ResponsePing")
proto.RegisterType((*RequestBroadcastTx)(nil), "ring.v1.RequestBroadcastTx")
......@@ -215,85 +293,88 @@ func init() {
func init() { proto.RegisterFile("ring/v1/service.proto", fileDescriptor_2dc67120507b0009) }
var fileDescriptor_2dc67120507b0009 = []byte{
// 1270 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0xdd, 0x6e, 0x1b, 0x45,
0x14, 0xc6, 0x26, 0x6d, 0xda, 0x71, 0x9a, 0xc2, 0xb6, 0x49, 0x8d, 0x83, 0x93, 0x60, 0x10, 0x4a,
0x29, 0x5d, 0xe3, 0x46, 0x48, 0xa8, 0x15, 0x3f, 0xb5, 0x49, 0x53, 0xc0, 0xb1, 0x2c, 0xbb, 0x0d,
0x05, 0x45, 0x8a, 0xc6, 0xeb, 0xe9, 0x7a, 0xc5, 0x7a, 0xc6, 0xd9, 0x1d, 0x3b, 0x09, 0x57, 0x48,
0x5c, 0xf1, 0x02, 0x3c, 0x00, 0x37, 0x48, 0x3c, 0x0a, 0x8f, 0xc1, 0x25, 0x4f, 0x81, 0x66, 0x77,
0x66, 0x7c, 0x76, 0x67, 0xd7, 0x31, 0x57, 0xd9, 0xfd, 0xbe, 0xef, 0x7c, 0x67, 0x66, 0x7c, 0x66,
0xce, 0x6c, 0xd0, 0x46, 0xe0, 0x51, 0xb7, 0x3e, 0x6b, 0xd4, 0x43, 0x12, 0xcc, 0x3c, 0x87, 0xd8,
0x93, 0x80, 0x71, 0x66, 0xad, 0x0a, 0xd8, 0x9e, 0x35, 0x2a, 0x5b, 0x2e, 0x63, 0xae, 0x4f, 0xea,
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 0x6a, 0x3e, 0xab, 0xa9, 0x7f, 0x0c, 0x3d, 0x91, 0x7f, 0xa7, 0xf5, 0xdf, 0x8a,
0x97, 0xba, 0xaf, 0x5e, 0xfd, 0x51, 0x5c, 0xed, 0xca, 0x74, 0x47, 0xf5, 0x3f, 0x93, 0x4f, 0xc7,
0x47, 0xf5, 0xbf, 0x8a, 0x37, 0xd5, 0xa7, 0xe3, 0x83, 0x4e, 0x43, 0xfa, 0x0d, 0xb0, 0xc0, 0x7f,
0x17, 0xaf, 0xca, 0xe8, 0xe3, 0xc7, 0x47, 0xf5, 0xfe, 0x95, 0xd8, 0xf3, 0xd1, 0xbf, 0x01, 0x00,
0x00, 0xff, 0xff, 0xe6, 0x63, 0x18, 0x9d, 0xc9, 0x12, 0x00, 0x00,
}
......@@ -24,7 +24,8 @@ const _ = grpc.SupportPackageIsVersion7
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type RingServiceClient interface {
Ping(ctx context.Context, in *RequestPing, opts ...grpc.CallOption) (*ResponsePing, error)
//rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx);
// rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx);
BroadcastTxs(ctx context.Context, in *BroadcastEthTxWithFromRequests, opts ...grpc.CallOption) (*ResponseBroadcastTxs, error)
BroadcastTx(ctx context.Context, in *BroadcastEthTxWithFromRequest, opts ...grpc.CallOption) (*ResponseBroadcastTx, error)
// web3
Sha3(ctx context.Context, in *Sha3Request, opts ...grpc.CallOption) (*Sha3Response, error)
......@@ -101,6 +102,15 @@ func (c *ringServiceClient) Ping(ctx context.Context, in *RequestPing, opts ...g
return out, nil
}
func (c *ringServiceClient) BroadcastTxs(ctx context.Context, in *BroadcastEthTxWithFromRequests, opts ...grpc.CallOption) (*ResponseBroadcastTxs, error) {
out := new(ResponseBroadcastTxs)
err := c.cc.Invoke(ctx, "/ring.v1.RingService/BroadcastTxs", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ringServiceClient) BroadcastTx(ctx context.Context, in *BroadcastEthTxWithFromRequest, opts ...grpc.CallOption) (*ResponseBroadcastTx, error) {
out := new(ResponseBroadcastTx)
err := c.cc.Invoke(ctx, "/ring.v1.RingService/BroadcastTx", in, out, opts...)
......@@ -538,7 +548,8 @@ func (c *ringServiceClient) Logs(ctx context.Context, in *LogsRequest, opts ...g
// for forward compatibility
type RingServiceServer interface {
Ping(context.Context, *RequestPing) (*ResponsePing, error)
//rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx);
// rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx);
BroadcastTxs(context.Context, *BroadcastEthTxWithFromRequests) (*ResponseBroadcastTxs, error)
BroadcastTx(context.Context, *BroadcastEthTxWithFromRequest) (*ResponseBroadcastTx, error)
// web3
Sha3(context.Context, *Sha3Request) (*Sha3Response, error)
......@@ -606,6 +617,9 @@ type UnimplementedRingServiceServer struct {
func (UnimplementedRingServiceServer) Ping(context.Context, *RequestPing) (*ResponsePing, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedRingServiceServer) BroadcastTxs(context.Context, *BroadcastEthTxWithFromRequests) (*ResponseBroadcastTxs, error) {
return nil, status.Errorf(codes.Unimplemented, "method BroadcastTxs not implemented")
}
func (UnimplementedRingServiceServer) BroadcastTx(context.Context, *BroadcastEthTxWithFromRequest) (*ResponseBroadcastTx, error) {
return nil, status.Errorf(codes.Unimplemented, "method BroadcastTx not implemented")
}
......@@ -781,6 +795,24 @@ func _RingService_Ping_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler)
}
func _RingService_BroadcastTxs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BroadcastEthTxWithFromRequests)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RingServiceServer).BroadcastTxs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ring.v1.RingService/BroadcastTxs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RingServiceServer).BroadcastTxs(ctx, req.(*BroadcastEthTxWithFromRequests))
}
return interceptor(ctx, in, info, handler)
}
func _RingService_BroadcastTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BroadcastEthTxWithFromRequest)
if err := dec(in); err != nil {
......@@ -1656,6 +1688,10 @@ var RingService_ServiceDesc = grpc.ServiceDesc{
MethodName: "Ping",
Handler: _RingService_Ping_Handler,
},
{
MethodName: "BroadcastTxs",
Handler: _RingService_BroadcastTxs_Handler,
},
{
MethodName: "BroadcastTx",
Handler: _RingService_BroadcastTx_Handler,
......
......@@ -9,8 +9,8 @@ import (
)
var (
initAcc, initCmp, batchSign, batchRecover, batchRecoverTx, batchVerify bool
txCount, goRoutineCount, cmpAmount, batchCount int
initAcc, initCmp, broadcastTxArr bool
txCount, goRoutineCount, cmpAmount, batchCount, startCount, endCount int
cpuProfile string
cfg *tool.Config
)
......@@ -20,12 +20,11 @@ func init() {
initCmd.PersistentFlags().BoolVar(&initAcc, "initAcc", false, "Start after initializing the account")
initCmd.PersistentFlags().BoolVar(&initCmp, "initCmp", false, "Start after initializing the account cmp balance")
startCmd.PersistentFlags().StringVar(&cpuProfile, "cpuProfile", "cpuProfile.prof", "Statistics cpu profile")
startCmd.PersistentFlags().BoolVar(&batchSign, "batchSign", false, "test grpc interface -> batchSign")
startCmd.PersistentFlags().BoolVar(&batchRecover, "batchRecover", false, "test grpc interface -> batchRecover")
startCmd.PersistentFlags().BoolVar(&batchRecoverTx, "batchRecoverTx", false, "test grpc interface -> batchRecoverTx")
startCmd.PersistentFlags().BoolVar(&batchVerify, "batchVerify", false, "test grpc interface -> batchVerify")
startCmd.PersistentFlags().IntVar(&startCount, "startCount", 0, "read excel start count")
startCmd.PersistentFlags().IntVar(&endCount, "endCount", 100, "read excel end count")
startCmd.PersistentFlags().BoolVar(&broadcastTxArr, "broadcastTxArr", false, "test grpc interface -> broadcastTxArr")
startCmd.PersistentFlags().IntVar(&txCount, "txCount", 1000, "send tran count")
startCmd.PersistentFlags().IntVar(&goRoutineCount, "goRoutineCount", 100, "send tran goRoutine count")
startCmd.PersistentFlags().IntVar(&goRoutineCount, "goRoutineCount", 10, "send tran goRoutine count")
startCmd.PersistentFlags().IntVar(&batchCount, "batchCount", 100, "batch send tran count")
startCmd.AddCommand(initCmd)
}
......
......@@ -18,35 +18,17 @@ func init() {
return
}
cfg.StorageAccFileName += ".xlsx"
SendTxAccountArr = tool.ReadExcel(cfg.Count, cfg.StorageAccFileName)
}
func startTest() {
SendTxAccountArr = tool.ReadExcelOfStartEnd(startCount, endCount, cfg.StorageAccFileName)
log.Infof("Program start initAccCount:%d tranCount", cfg.Count)
cfg.GoRoutineCount = goRoutineCount
cfg.SignCount = txCount / 100
cfg.BatchCount = batchCount
arr, fromAddrArr := transaction.SignedTxArr(SendTxAccountArr, cfg)
if batchSign {
if err := transaction.BatchSignHandler(arr, cfg); err != nil {
log.Errorf("Bath Send Tran error: %s", err)
return
}
}
if batchRecover {
if err := transaction.BatchRecoverHandler(arr, cfg); err != nil {
log.Errorf("Bath Send Tran error: %s", err)
return
}
}
if batchRecoverTx {
if err := transaction.BatchRecoverTxHandler(arr, fromAddrArr, cfg); err != nil {
log.Errorf("Bath Send Tran error: %s", err)
return
}
}
if batchVerify {
if err := transaction.BatchVerifyHandler(arr, cfg); err != nil {
arr := transaction.SignedTxArr(SendTxAccountArr, cfg)
if broadcastTxArr {
if err := transaction.BroadcastTxArr(arr, cfg); err != nil {
log.Errorf("Bath Send Tran error: %s", err)
return
}
......
......@@ -141,7 +141,7 @@ func ReadExcelOfStartEnd(start int, end int, fileName string) [][]string {
return nil
}
res := make([][]string, 0)
for i := start; i <= end; i++ {
for i := start; i < end; i++ {
res = append(res, rows[i])
}
return res
......
......@@ -6,10 +6,10 @@ import (
"ChainGrpcTest/txcache"
"context"
v1 "github.com/CaduceusMetaverseProtocol/MetaProtocol/gen/proto/go/base/v1"
crypterv1 "github.com/CaduceusMetaverseProtocol/MetaProtocol/gen/proto/go/crypter/v1"
ring "github.com/CaduceusMetaverseProtocol/MetaProtocol/gen/proto/go/ring/v1"
metatypes "github.com/CaduceusMetaverseProtocol/MetaTypes/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
gogotypes "github.com/gogo/protobuf/types"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"sync/atomic"
......@@ -17,299 +17,103 @@ import (
)
var (
batchSignRequest chan *crypterv1.BatchSignRequest
batchRecoverRequest chan *crypterv1.BatchRecoverRequest
batchRecoverTxRequest chan *crypterv1.BatchRecoverTxRequest
batchVerifyRequest chan *crypterv1.BatchVerifyRequest
bathHandleSendCount, allSignedTxCount, totalSendTime int64
set Set
broadcastEthTxWithFromRequestsArr chan *ring.BroadcastEthTxWithFromRequests
)
type Set struct {
txArr []*v1.MetaTxBase
}
func init() {
batchSignRequest = make(chan *crypterv1.BatchSignRequest, 1000000)
batchRecoverRequest = make(chan *crypterv1.BatchRecoverRequest, 1000000)
batchRecoverTxRequest = make(chan *crypterv1.BatchRecoverTxRequest, 1000000)
batchVerifyRequest = make(chan *crypterv1.BatchVerifyRequest, 1000000)
set.txArr = make([]*v1.MetaTxBase, 0)
broadcastEthTxWithFromRequestsArr = make(chan *ring.BroadcastEthTxWithFromRequests, 1000000)
}
// batchSign 发送的签名交易
func batchSign(client crypterv1.CrypterServiceClient, sleepTime int) {
var beforeSendTxTime time.Time
for {
select {
case batchSign := <-batchSignRequest:
if sleepTime != 0 {
time.Sleep(time.Millisecond * time.Duration(sleepTime))
}
sendTranStartTime := time.Now()
if beforeSendTxTime.UnixMilli() > 0 && time.Since(beforeSendTxTime).Milliseconds() < 1 {
time.Sleep(time.Millisecond * time.Duration(1))
}
sign, err := client.BatchSign(context.Background(), batchSign, grpc.CallContentSubtype(""))
if err != nil {
log.Errorf("SendTranErr: %s", err)
sign, err = client.BatchSign(context.Background(), batchSign, grpc.CallContentSubtype(""))
if err != nil {
log.Errorf("Send tran twice err: %s", err)
continue
}
}
beforeSendTxTime = time.Now()
atomic.AddInt64(&bathHandleSendCount, 1)
sinceTime := time.Since(sendTranStartTime).Milliseconds()
atomic.AddInt64(&totalSendTime, sinceTime)
log.Infof("Send transaction time: %d ms, sign: %s ", sinceTime, sign.String())
}
}
}
// BatchSignHandler 处理批量发送的签名交易
func BatchSignHandler(tranArr []*types.Transaction, cfg *tool.Config) error {
func BroadcastTxArr(tranArr []*types.Transaction, cfg *tool.Config) error {
client, err := grpc.Dial(cfg.RpcNode, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Error("dial nebula failed", "err", err)
return err
}
ringServiceClient := ring.NewRingServiceClient(client)
for i := 0; i < cfg.GoRoutineCount; i++ {
go batchSign(crypterv1.NewCrypterServiceClient(client), cfg.SleepTime)
go broadcastTx(ringServiceClient)
}
allSignedTxCount = int64(len(tranArr))
startTime := time.Now()
ethTxArr := make([]*ring.BroadcastEthTxWithFromRequest, 0)
for i := 0; i < int(allSignedTxCount); i++ {
req := crypterv1.BatchSignRequest{}
batchSignRequest <- &req
}
for {
if bathHandleSendCount == allSignedTxCount {
log.Infof("Send tran count: %d", bathHandleSendCount)
log.Infof("Since time: %d ms", time.Since(startTime).Milliseconds())
break
}
}
return nil
}
// BatchRecover 发送的签名交易
func batchRecover(client crypterv1.CrypterServiceClient, sleepTime int) {
var beforeSendTxTime time.Time
for {
select {
case batchRecover := <-batchRecoverRequest:
if sleepTime != 0 {
time.Sleep(time.Millisecond * time.Duration(sleepTime))
}
sendTranStartTime := time.Now()
if beforeSendTxTime.UnixMilli() > 0 && time.Since(beforeSendTxTime).Milliseconds() < 1 {
time.Sleep(time.Millisecond * time.Duration(1))
}
sign, err := client.BatchRecover(context.Background(), batchRecover, grpc.CallContentSubtype(""))
inner := constructionEthLegacyTx(tranArr[i])
ethTxAsAny, err := gogotypes.MarshalAny(&inner)
if err != nil {
log.Errorf("SendTranErr: %s", err)
sign, err = client.BatchRecover(context.Background(), batchRecover, grpc.CallContentSubtype(""))
if err != nil {
log.Errorf("Send tran twice err: %s", err)
continue
}
}
beforeSendTxTime = time.Now()
atomic.AddInt64(&bathHandleSendCount, 1)
sinceTime := time.Since(sendTranStartTime).Milliseconds()
atomic.AddInt64(&totalSendTime, sinceTime)
log.Infof("Send transaction time: %d ms, sign: %s ", sinceTime, sign.String())
}
}
}
// BatchRecoverHandler 处理批量发送的签名交易
func BatchRecoverHandler(tranArr []*types.Transaction, cfg *tool.Config) error {
grpcClient, err := grpc.Dial(cfg.RpcNode, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Error("dial nebula failed", "err", err)
}
serviceClient := crypterv1.NewCrypterServiceClient(grpcClient)
for i := 0; i < cfg.GoRoutineCount; i++ {
go batchRecover(serviceClient, cfg.SleepTime)
}
allSignedTxCount = int64(len(tranArr))
startTime := time.Now()
for i := 0; i < int(allSignedTxCount); i++ {
req := crypterv1.BatchRecoverRequest{}
batchRecoverRequest <- &req
}
for {
if bathHandleSendCount == allSignedTxCount {
log.Infof("Send tran count: %d", bathHandleSendCount)
log.Infof("Since time: %d ms", time.Since(startTime).Milliseconds())
break
}
}
return nil
}
// BatchVerify 发送的签名交易
func batchVerify(client crypterv1.CrypterServiceClient, sleepTime int) {
var beforeSendTxTime time.Time
for {
select {
case batchVerify := <-batchVerifyRequest:
if sleepTime != 0 {
time.Sleep(time.Millisecond * time.Duration(sleepTime))
}
sendTranStartTime := time.Now()
if beforeSendTxTime.UnixMilli() > 0 && time.Since(beforeSendTxTime).Milliseconds() < 1 {
time.Sleep(time.Millisecond * time.Duration(1))
log.Error("gogo types.MarshalAny error:", err)
}
sign, err := client.BatchVerify(context.Background(), batchVerify, grpc.CallContentSubtype(""))
if err != nil {
log.Errorf("SendTranErr: %s", err)
sign, err = client.BatchVerify(context.Background(), batchVerify, grpc.CallContentSubtype(""))
if err != nil {
log.Errorf("Send tran twice err: %s", err)
fromAddr, b := txcache.GetFromAddr(tranArr[i].Hash().Hex())
if !b {
continue
}
request := ring.BroadcastEthTxWithFromRequest{
From: fromAddr,
EthTx: &v1.EthTransaction{Tx: ethTxAsAny},
}
beforeSendTxTime = time.Now()
atomic.AddInt64(&bathHandleSendCount, 1)
sinceTime := time.Since(sendTranStartTime).Milliseconds()
atomic.AddInt64(&totalSendTime, sinceTime)
log.Infof("Send transaction time: %d ms, sign: %s ", sinceTime, sign.String())
ethTxArr = append(ethTxArr, &request)
if len(ethTxArr) == cfg.BatchCount {
requests := ring.BroadcastEthTxWithFromRequests{
List: ethTxArr,
}
broadcastEthTxWithFromRequestsArr <- &requests
ethTxArr = make([]*ring.BroadcastEthTxWithFromRequest, 0)
}
}
// BatchVerifyHandler 处理批量发送的签名交易
func BatchVerifyHandler(tranArr []*types.Transaction, cfg *tool.Config) error {
client, err := grpc.Dial(cfg.RpcNode, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Error("dial nebula failed", "err", err)
}
for i := 0; i < cfg.GoRoutineCount; i++ {
go batchVerify(crypterv1.NewCrypterServiceClient(client), cfg.SleepTime)
}
allSignedTxCount = int64(len(tranArr))
startTime := time.Now()
for i := 0; i < int(allSignedTxCount); i++ {
req := crypterv1.BatchVerifyRequest{}
batchVerifyRequest <- &req
}
for {
if bathHandleSendCount == allSignedTxCount {
log.Infof("Send tran count: %d", bathHandleSendCount)
log.Infof("Since time: %d ms", time.Since(startTime).Milliseconds())
log.Infof("Send tran total time: %d ms", totalSendTime)
break
}
}
return nil
}
// batchRecoverTx 发送的签名交易
func batchRecoverTx(client crypterv1.CrypterServiceClient, sleepTime int) {
// BatchSendTran 处理批量发送的签名交易
func broadcastTx(client ring.RingServiceClient) error {
var beforeSendTxTime time.Time
for {
select {
case batchRecoverTx := <-batchRecoverTxRequest:
if sleepTime != 0 {
time.Sleep(time.Millisecond * time.Duration(sleepTime))
}
case broadcastEthTxWithFromRequests := <-broadcastEthTxWithFromRequestsArr:
sendTranStartTime := time.Now()
if beforeSendTxTime.UnixMilli() > 0 && time.Since(beforeSendTxTime).Milliseconds() < 1 {
time.Sleep(time.Millisecond * time.Duration(1))
}
sign, err := client.BatchRecoverTx(context.Background(), batchRecoverTx, grpc.CallContentSubtype(""))
if err != nil {
log.Errorf("SendTranErr: %s", err)
sign, err = client.BatchRecoverTx(context.Background(), batchRecoverTx, grpc.CallContentSubtype(""))
txs, err := client.BroadcastTxs(context.Background(), broadcastEthTxWithFromRequests, nil)
if err != nil {
log.Errorf("Send tran twice err: %s", err)
continue
}
log.Error("BroadcastTxs Error:", err)
}
log.Info("BroadcastTxs Res:", txs)
beforeSendTxTime = time.Now()
atomic.AddInt64(&bathHandleSendCount, int64(len(batchRecoverTx.RawTx)))
atomic.AddInt64(&bathHandleSendCount, int64(len(broadcastEthTxWithFromRequests.List)))
sinceTime := time.Since(sendTranStartTime).Milliseconds()
atomic.AddInt64(&totalSendTime, sinceTime)
for _, tx := range sign.GetRecoverdTx() {
if !txcache.CompareAddress(tx.TxHash.Hex(), tx.From.Hex()) {
log.Error("tx.TxHash:", tx.TxHash.Hex(), "tx.From", tx.From.Hex())
}
}
log.Infof("Send transaction time: %d ms", sinceTime)
log.Infof("Send transaction time: %d ms ", sinceTime)
}
}
}
// BatchRecoverTxHandler 处理批量发送的签名交易
func BatchRecoverTxHandler(tranArr []*types.Transaction, fromAddrArr []common.Address, cfg *tool.Config) error {
client, err := grpc.Dial(cfg.RpcNode, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Error("dial nebula failed", "err", err)
}
for i := 0; i < cfg.GoRoutineCount; i++ {
go batchRecoverTx(crypterv1.NewCrypterServiceClient(client), cfg.SleepTime)
}
allSignedTxCount = int64(len(tranArr))
startTime := time.Now()
rawTxArr := make([]*v1.MetaTxBase, 0)
for i := 0; i < int(allSignedTxCount); i++ {
tran := tranArr[i]
rawTx := constructionRawTx(tran)
rawTxArr = append(rawTxArr, &rawTx)
if len(rawTxArr) == cfg.BatchCount {
req := crypterv1.BatchRecoverTxRequest{
RawTx: rawTxArr,
}
batchRecoverTxRequest <- &req
rawTxArr = make([]*v1.MetaTxBase, 0)
}
}
for {
if bathHandleSendCount == allSignedTxCount {
log.Infof("Send tran count: %d", bathHandleSendCount)
log.Infof("Since time: %d ms", time.Since(startTime).Milliseconds())
break
}
}
return nil
}
func constructionRawTx(tran *types.Transaction) v1.MetaTxBase {
func constructionEthLegacyTx(tran *types.Transaction) v1.EthLegacyTx {
v, r, s := tran.RawSignatureValues()
toAddr := metatypes.BytesToAddress(tran.To().Bytes())
hash := metatypes.HexToHash(tran.Hash().Hex())
nv := metatypes.NewBigInt(0)
nv.Set(v)
nr := metatypes.NewBigInt(0)
nr.Set(r)
ns := metatypes.NewBigInt(0)
ns.Set(s)
rawTx := v1.MetaTxBase{
TxType: uint32(tran.Type()),
ChainId: metatypes.NewBigInt(tran.ChainId().Int64()),
rawTx := v1.EthLegacyTx{
Nonce: tran.Nonce(),
GasPrice: metatypes.NewBigInt(tran.GasPrice().Int64()),
Gas: tran.Gas(),
To: &toAddr,
Value: metatypes.NewBigInt(tran.Value().Int64()),
Data: tran.Data(),
AccessList: nil,
V: nv,
R: nr,
S: ns,
TxHash: &hash,
}
return rawTx
}
func (s *Set) contain(metaBase metatypes.Address) bool {
for _, tx := range s.txArr {
if tx.From.Equal(metaBase) {
return true
}
}
return false
}
......@@ -4,12 +4,17 @@ import (
"ChainGrpcTest/log"
"ChainGrpcTest/tool"
"ChainGrpcTest/txcache"
"context"
"crypto/ecdsa"
ring "github.com/CaduceusMetaverseProtocol/MetaProtocol/gen/proto/go/ring/v1"
metatypes "github.com/CaduceusMetaverseProtocol/MetaTypes/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"math/big"
"sync"
"sync/atomic"
"time"
)
......@@ -28,6 +33,12 @@ type Transactor struct {
receivedAddr common.Address
}
var (
tran = make(chan *Transactor, 0)
tranArr = make([]*types.Transaction, 0)
batchSignCount int32
)
func newTransactor(cfg TranConfig) (*Transactor, error) {
signerKey, err := crypto.HexToECDSA(cfg.PrivateKey)
if err != nil {
......@@ -50,17 +61,29 @@ func newTransactor(cfg TranConfig) (*Transactor, error) {
return &res, nil
}
var accountsNonceMap sync.Map
// SignedTxArr 获取全部签名数据
func SignedTxArr(sendTxAccountArr [][]string, cfg *tool.Config) ([]*types.Transaction, []common.Address) {
tranArr := make([]*types.Transaction, 0)
fromAddrArr := make([]common.Address, 0)
var signedTx *types.Transaction
func SignedTxArr(sendTxAccountArr [][]string, cfg *tool.Config) []*types.Transaction {
for i := 0; i < cfg.GoRoutineCount; i++ {
go signedTxFunc()
}
client, err := grpc.Dial(cfg.RpcNode, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Error("grpc dial error:", err)
return nil
}
defer client.Close()
serviceClient := ring.NewRingServiceClient(client)
for _, rows := range sendTxAccountArr {
fromAddrArr = append(fromAddrArr, common.HexToAddress(rows[0]))
privateKey := rows[1]
nonce := big.NewInt(1)
fromAddr := metatypes.HexToAddress(rows[0])
nonceReq := &ring.NonceRequest{
Address: &fromAddr,
}
response, err := serviceClient.Nonce(context.Background(), nonceReq, nil)
if err != nil {
return nil
}
nonce := new(big.Int).SetUint64(response.Nonce)
for signCount := 0; signCount < cfg.SignCount; signCount++ {
tranCfg := TranConfig{
Amount: cfg.Amount,
......@@ -71,21 +94,26 @@ func SignedTxArr(sendTxAccountArr [][]string, cfg *tool.Config) ([]*types.Transa
Nonce: nonce,
}
t, err := newTransactor(tranCfg)
signedTx, err = t.signedTx()
txcache.Add(signedTx.Hash().Hex(), rows[0])
nonce = big.NewInt(1).Add(nonce, big.NewInt(1))
if err != nil || signedTx == nil {
if err != nil {
log.Errorf("signed tx error %s ", err)
continue
}
tranArr = append(tranArr, signedTx)
tran <- t
nonce = big.NewInt(1).Add(nonce, big.NewInt(1))
}
}
for {
if len(sendTxAccountArr)*cfg.SignCount == int(batchSignCount) {
return tranArr
}
}
return tranArr, fromAddrArr
}
// signedTx 签名本币转账交易
func (t *Transactor) signedTx() (*types.Transaction, error) {
// signedTxFunc 签名本币转账交易
func signedTxFunc() (*types.Transaction, error) {
for {
select {
case t := <-tran:
txData := types.LegacyTx{
Nonce: t.config.Nonce.Uint64(),
To: &t.receivedAddr,
......@@ -101,5 +129,9 @@ func (t *Transactor) signedTx() (*types.Transaction, error) {
time.Sleep(time.Second)
return nil, err
}
return signedTx, nil
txcache.Add(signedTx.Hash().Hex(), t.sender.Hex())
tranArr = append(tranArr, signedTx)
atomic.AddInt32(&batchSignCount, 1)
}
}
}
......@@ -6,7 +6,7 @@ import (
)
var (
gtxcache = &TxCache{
gtxCache = &TxCache{
cache: make(map[string]string),
}
)
......@@ -16,18 +16,25 @@ type TxCache struct {
mux sync.RWMutex
}
func Add(txhash string, address string) {
gtxcache.mux.Lock()
defer gtxcache.mux.Unlock()
gtxcache.cache[txhash] = address
func Add(txHash string, address string) {
gtxCache.mux.Lock()
defer gtxCache.mux.Unlock()
gtxCache.cache[txHash] = address
}
func CompareAddress(txhash string, newer string) bool {
gtxcache.mux.RLock()
defer gtxcache.mux.RUnlock()
o, exist := gtxcache.cache[txhash]
func CompareAddress(txHash string, newer string) bool {
gtxCache.mux.RLock()
defer gtxCache.mux.RUnlock()
o, exist := gtxCache.cache[txHash]
if !exist {
return false
}
return strings.Compare(newer, o) == 0
}
func GetFromAddr(txHash string) (string, bool) {
gtxCache.mux.RLock()
defer gtxCache.mux.RUnlock()
o, exist := gtxCache.cache[txHash]
return o, exist
}
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