diff --git a/agglayer/mock_agglayer_client.go b/agglayer/mock_agglayer_client.go index 943198fd..1497cc24 100644 --- a/agglayer/mock_agglayer_client.go +++ b/agglayer/mock_agglayer_client.go @@ -81,7 +81,7 @@ func (_c *AgglayerClientMock_GetCertificateHeader_Call) RunAndReturn(run func(co return _c } -// GetEpochConfiguration provides a mock function with given fields: +// GetEpochConfiguration provides a mock function with no fields func (_m *AgglayerClientMock) GetEpochConfiguration() (*ClockConfiguration, error) { ret := _m.Called() diff --git a/agglayer/types.go b/agglayer/types.go index 223a84bc..23e259b1 100644 --- a/agglayer/types.go +++ b/agglayer/types.go @@ -132,7 +132,7 @@ type Certificate struct { BridgeExits []*BridgeExit `json:"bridge_exits"` ImportedBridgeExits []*ImportedBridgeExit `json:"imported_bridge_exits"` Metadata common.Hash `json:"metadata"` - AggchainProof string `json:"aggchain_proof,omitempty"` + AggchainProof []byte `json:"aggchain_proof,omitempty"` } // Brief returns a string with a brief cert diff --git a/aggsender/flow_aggchain_prover.go b/aggsender/flow_aggchain_prover.go index bdeba340..e04e07e1 100644 --- a/aggsender/flow_aggchain_prover.go +++ b/aggsender/flow_aggchain_prover.go @@ -68,9 +68,9 @@ func (a *aggchainProverFlow) GetCertificateBuildParams(ctx context.Context) (*ty proof := lastSentCertificateInfo.AggchainProof toBlock := lastSentCertificateInfo.ToBlock - if proof == "" { + if len(proof) == 0 { aggchainProof, err := a.aggchainProofClient.GenerateAggchainProof(lastSentCertificateInfo.FromBlock, - lastSentCertificateInfo.ToBlock, common.Hash{}) + lastSentCertificateInfo.ToBlock, common.Hash{}, common.Hash{}, [32]common.Hash{}) if err != nil { return nil, fmt.Errorf("aggchainProverFlow - error fetching aggchain proof for block range %d : %d : %w", lastSentCertificateInfo.FromBlock, lastSentCertificateInfo.ToBlock, err) @@ -117,7 +117,7 @@ func (a *aggchainProverFlow) GetCertificateBuildParams(ctx context.Context) (*ty } aggchainProof, err := a.aggchainProofClient.GenerateAggchainProof( - buildParams.FromBlock, buildParams.ToBlock, common.Hash{}) + buildParams.FromBlock, buildParams.ToBlock, common.Hash{}, common.Hash{}, [32]common.Hash{}) if err != nil { return nil, fmt.Errorf("aggchainProverFlow - error fetching aggchain proof for block range %d : %d : %w", buildParams.FromBlock, buildParams.ToBlock, err) diff --git a/aggsender/flow_aggchain_prover_test.go b/aggsender/flow_aggchain_prover_test.go index f290780e..afeb505e 100644 --- a/aggsender/flow_aggchain_prover_test.go +++ b/aggsender/flow_aggchain_prover_test.go @@ -61,8 +61,8 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { }, nil) mockL2Syncer.On("GetBridgesPublished", ctx, uint64(1), uint64(10)).Return([]bridgesync.Bridge{{}}, nil) mockL2Syncer.On("GetClaims", ctx, uint64(1), uint64(10)).Return([]bridgesync.Claim{{}}, nil) - mockClient.On("GenerateAggchainProof", uint64(1), uint64(10), common.Hash{}).Return(&types.AggchainProof{ - Proof: "some-proof", StartBlock: 1, EndBlock: 10}, nil) + mockClient.On("GenerateAggchainProof", uint64(1), uint64(10), common.Hash{}, common.Hash{}, [32]common.Hash{}).Return(&types.AggchainProof{ + Proof: []byte("some-proof"), StartBlock: 1, EndBlock: 10}, nil) }, expectedParams: &types.CertificateBuildParams{ FromBlock: 1, @@ -70,7 +70,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { RetryCount: 1, Bridges: []bridgesync.Bridge{{}}, Claims: []bridgesync.Claim{{}}, - AggchainProof: "some-proof", + AggchainProof: []byte("some-proof"), LastSentCertificate: &types.CertificateInfo{ FromBlock: 1, ToBlock: 10, @@ -92,8 +92,8 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { {BlockNum: 5}, {BlockNum: 10}}, nil) mockL2Syncer.On("GetClaims", ctx, uint64(1), uint64(10)).Return([]bridgesync.Claim{ {BlockNum: 6}, {BlockNum: 9}}, nil) - mockClient.On("GenerateAggchainProof", uint64(1), uint64(10), common.Hash{}).Return(&types.AggchainProof{ - Proof: "some-proof", StartBlock: 1, EndBlock: 8}, nil) + mockClient.On("GenerateAggchainProof", uint64(1), uint64(10), common.Hash{}, common.Hash{}, [32]common.Hash{}).Return(&types.AggchainProof{ + Proof: []byte("some-proof"), StartBlock: 1, EndBlock: 8}, nil) }, expectedParams: &types.CertificateBuildParams{ FromBlock: 1, @@ -101,7 +101,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { RetryCount: 1, Bridges: []bridgesync.Bridge{{BlockNum: 5}}, Claims: []bridgesync.Claim{{BlockNum: 6}}, - AggchainProof: "some-proof", + AggchainProof: []byte("some-proof"), LastSentCertificate: &types.CertificateInfo{ FromBlock: 1, ToBlock: 10, @@ -118,7 +118,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { FromBlock: 1, ToBlock: 10, Status: agglayer.InError, - AggchainProof: "existing-proof", + AggchainProof: []byte("existing-proof"), }, nil) mockL2Syncer.On("GetBridgesPublished", ctx, uint64(1), uint64(10)).Return([]bridgesync.Bridge{{}}, nil) mockL2Syncer.On("GetClaims", ctx, uint64(1), uint64(10)).Return([]bridgesync.Claim{{}}, nil) @@ -129,12 +129,12 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { RetryCount: 1, Bridges: []bridgesync.Bridge{{}}, Claims: []bridgesync.Claim{{}}, - AggchainProof: "existing-proof", + AggchainProof: []byte("existing-proof"), LastSentCertificate: &types.CertificateInfo{ FromBlock: 1, ToBlock: 10, Status: agglayer.InError, - AggchainProof: "existing-proof", + AggchainProof: []byte("existing-proof"), }, }, }, @@ -147,7 +147,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { mockL2Syncer.On("GetLastProcessedBlock", ctx).Return(uint64(10), nil) mockL2Syncer.On("GetBridgesPublished", ctx, uint64(1), uint64(10)).Return([]bridgesync.Bridge{{}}, nil) mockL2Syncer.On("GetClaims", ctx, uint64(1), uint64(10)).Return([]bridgesync.Claim{{}}, nil) - mockClient.On("GenerateAggchainProof", uint64(1), uint64(10), common.Hash{}).Return(nil, errors.New("some error")) + mockClient.On("GenerateAggchainProof", uint64(1), uint64(10), common.Hash{}, common.Hash{}, [32]common.Hash{}).Return(nil, errors.New("some error")) }, expectedError: "error fetching aggchain proof for block range 1 : 10 : some error", }, @@ -160,8 +160,8 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { mockL2Syncer.On("GetLastProcessedBlock", ctx).Return(uint64(10), nil) mockL2Syncer.On("GetBridgesPublished", ctx, uint64(6), uint64(10)).Return([]bridgesync.Bridge{{}}, nil) mockL2Syncer.On("GetClaims", ctx, uint64(6), uint64(10)).Return([]bridgesync.Claim{{}}, nil) - mockClient.On("GenerateAggchainProof", uint64(6), uint64(10), common.Hash{}).Return(&types.AggchainProof{ - Proof: "some-proof", StartBlock: 6, EndBlock: 10}, nil) + mockClient.On("GenerateAggchainProof", uint64(6), uint64(10), common.Hash{}, common.Hash{}, [32]common.Hash{}).Return(&types.AggchainProof{ + Proof: []byte("some-proof"), StartBlock: 6, EndBlock: 10}, nil) }, expectedParams: &types.CertificateBuildParams{ FromBlock: 6, @@ -170,7 +170,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { LastSentCertificate: &types.CertificateInfo{ToBlock: 5}, Bridges: []bridgesync.Bridge{{}}, Claims: []bridgesync.Claim{{}}, - AggchainProof: "some-proof", + AggchainProof: []byte("some-proof"), CreatedAt: uint32(time.Now().UTC().Unix()), }, }, @@ -185,8 +185,8 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { {BlockNum: 6}, {BlockNum: 10}}, nil) mockL2Syncer.On("GetClaims", ctx, uint64(6), uint64(10)).Return([]bridgesync.Claim{ {BlockNum: 8}, {BlockNum: 9}}, nil) - mockClient.On("GenerateAggchainProof", uint64(6), uint64(10), common.Hash{}).Return(&types.AggchainProof{ - Proof: "some-proof", StartBlock: 6, EndBlock: 8}, nil) + mockClient.On("GenerateAggchainProof", uint64(6), uint64(10), common.Hash{}, common.Hash{}, [32]common.Hash{}).Return(&types.AggchainProof{ + Proof: []byte("some-proof"), StartBlock: 6, EndBlock: 8}, nil) }, expectedParams: &types.CertificateBuildParams{ FromBlock: 6, @@ -195,7 +195,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { LastSentCertificate: &types.CertificateInfo{ToBlock: 5}, Bridges: []bridgesync.Bridge{{BlockNum: 6}}, Claims: []bridgesync.Claim{{BlockNum: 8}}, - AggchainProof: "some-proof", + AggchainProof: []byte("some-proof"), CreatedAt: uint32(time.Now().UTC().Unix()), }, }, diff --git a/aggsender/grpc/aggchain_proof_client.go b/aggsender/grpc/aggchain_proof_client.go index d477a73e..e7898f3d 100644 --- a/aggsender/grpc/aggchain_proof_client.go +++ b/aggsender/grpc/aggchain_proof_client.go @@ -5,6 +5,7 @@ import ( "time" "github.com/agglayer/aggkit/aggsender/types" + treeTypes "github.com/agglayer/aggkit/tree/types" "github.com/ethereum/go-ethereum/common" ) @@ -12,7 +13,13 @@ const TIMEOUT = 2 // AggchainProofClientInterface defines an interface for aggchain proof client type AggchainProofClientInterface interface { - GenerateAggchainProof(startBlock uint64, maxEndBlock uint64, l1infoTreeHash common.Hash) (*types.AggchainProof, error) + GenerateAggchainProof( + startBlock uint64, + maxEndBlock uint64, + l1InfoTreeHash common.Hash, + l1InfoTreeLeaf common.Hash, + l1InfoTreeProof [treeTypes.DefaultHeight]common.Hash, + ) (*types.AggchainProof, error) } // AggchainProofClient provides an implementation for the AggchainProofClient interface @@ -31,22 +38,34 @@ func NewAggchainProofClient(serverAddr string) (*AggchainProofClient, error) { }, nil } -func (c *AggchainProofClient) GenerateAggchainProof(startBlock uint64, - maxEndBlock uint64, l1infoTreeHash common.Hash) (*types.AggchainProof, error) { +func (c *AggchainProofClient) GenerateAggchainProof( + startBlock uint64, + maxEndBlock uint64, + l1InfoTreeHash common.Hash, + l1InfoTreeLeaf common.Hash, + l1InfoTreeProof [treeTypes.DefaultHeight]common.Hash, +) (*types.AggchainProof, error) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute*TIMEOUT) defer cancel() + convertedProof := make([][]byte, treeTypes.DefaultHeight) + for i := 0; i < int(treeTypes.DefaultHeight); i++ { + convertedProof[i] = l1InfoTreeProof[i].Bytes() + } + resp, err := c.client.GenerateAggchainProof(ctx, &types.GenerateAggchainProofRequest{ - StartBlock: startBlock, - MaxEndBlock: maxEndBlock, - L1InfoTreeHash: l1infoTreeHash.Bytes(), + StartBlock: startBlock, + MaxEndBlock: maxEndBlock, + L1InfoTreeHash: l1InfoTreeHash.Bytes(), + L1InfoTreeLeaf: l1InfoTreeLeaf.Bytes(), + L1InfoTreeProof: convertedProof, }) if err != nil { return nil, err } return &types.AggchainProof{ - Proof: string(resp.AggchainProof), + Proof: resp.AggchainProof, StartBlock: resp.StartBlock, EndBlock: resp.EndBlock, }, nil diff --git a/aggsender/grpc/aggchain_proof_client_test.go b/aggsender/grpc/aggchain_proof_client_test.go index 13347a9e..71efceef 100644 --- a/aggsender/grpc/aggchain_proof_client_test.go +++ b/aggsender/grpc/aggchain_proof_client_test.go @@ -6,6 +6,7 @@ import ( "github.com/agglayer/aggkit/aggsender/mocks" "github.com/agglayer/aggkit/aggsender/types" + treeTypes "github.com/agglayer/aggkit/tree/types" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -26,16 +27,23 @@ func TestGenerateAggchainProof_Success(t *testing.T) { EndBlock: 200, } + convertedProof := make([][]byte, treeTypes.DefaultHeight) + for i := 0; i < int(treeTypes.DefaultHeight); i++ { + convertedProof[i] = common.Hash{}.Bytes() + } + mockClient.On("GenerateAggchainProof", mock.Anything, &types.GenerateAggchainProofRequest{ - StartBlock: 100, - MaxEndBlock: 200, - L1InfoTreeHash: common.Hash{}.Bytes(), + StartBlock: 100, + MaxEndBlock: 200, + L1InfoTreeHash: common.Hash{}.Bytes(), + L1InfoTreeLeaf: common.Hash{}.Bytes(), + L1InfoTreeProof: convertedProof, }).Return(expectedResponse, nil) - result, err := client.GenerateAggchainProof(100, 200, common.BytesToHash([]byte{})) + result, err := client.GenerateAggchainProof(100, 200, common.Hash{}, common.Hash{}, [32]common.Hash{}) assert.NoError(t, err) - assert.Equal(t, "dummy-proof", result.Proof) + assert.Equal(t, []byte("dummy-proof"), result.Proof) assert.Equal(t, uint64(100), result.StartBlock) assert.Equal(t, uint64(200), result.EndBlock) mockClient.AssertExpectations(t) @@ -47,13 +55,20 @@ func TestGenerateAggchainProof_Error(t *testing.T) { expectedError := errors.New("Generate error") + convertedProof := make([][]byte, treeTypes.DefaultHeight) + for i := 0; i < int(treeTypes.DefaultHeight); i++ { + convertedProof[i] = common.Hash{}.Bytes() + } + mockClient.On("GenerateAggchainProof", mock.Anything, &types.GenerateAggchainProofRequest{ - StartBlock: 300, - MaxEndBlock: 400, - L1InfoTreeHash: common.Hash{}.Bytes(), + StartBlock: 300, + MaxEndBlock: 400, + L1InfoTreeHash: common.Hash{}.Bytes(), + L1InfoTreeLeaf: common.Hash{}.Bytes(), + L1InfoTreeProof: convertedProof, }).Return((*types.GenerateAggchainProofResponse)(nil), expectedError) - result, err := client.GenerateAggchainProof(300, 400, common.Hash{}) + result, err := client.GenerateAggchainProof(300, 400, common.Hash{}, common.Hash{}, [32]common.Hash{}) assert.Error(t, err) assert.Nil(t, result) diff --git a/aggsender/mocks/mock_aggchain_proof_client_interface.go b/aggsender/mocks/mock_aggchain_proof_client_interface.go index 15d86cf8..5ee4cc6b 100644 --- a/aggsender/mocks/mock_aggchain_proof_client_interface.go +++ b/aggsender/mocks/mock_aggchain_proof_client_interface.go @@ -23,9 +23,9 @@ func (_m *AggchainProofClientInterface) EXPECT() *AggchainProofClientInterface_E return &AggchainProofClientInterface_Expecter{mock: &_m.Mock} } -// GenerateAggchainProof provides a mock function with given fields: startBlock, maxEndBlock, l1infoTreeHash -func (_m *AggchainProofClientInterface) GenerateAggchainProof(startBlock uint64, maxEndBlock uint64, l1infoTreeHash common.Hash) (*types.AggchainProof, error) { - ret := _m.Called(startBlock, maxEndBlock, l1infoTreeHash) +// GenerateAggchainProof provides a mock function with given fields: startBlock, maxEndBlock, l1InfoTreeHash, l1InfoTreeLeaf, l1InfoTreeProof +func (_m *AggchainProofClientInterface) GenerateAggchainProof(startBlock uint64, maxEndBlock uint64, l1InfoTreeHash common.Hash, l1InfoTreeLeaf common.Hash, l1InfoTreeProof [32]common.Hash) (*types.AggchainProof, error) { + ret := _m.Called(startBlock, maxEndBlock, l1InfoTreeHash, l1InfoTreeLeaf, l1InfoTreeProof) if len(ret) == 0 { panic("no return value specified for GenerateAggchainProof") @@ -33,19 +33,19 @@ func (_m *AggchainProofClientInterface) GenerateAggchainProof(startBlock uint64, var r0 *types.AggchainProof var r1 error - if rf, ok := ret.Get(0).(func(uint64, uint64, common.Hash) (*types.AggchainProof, error)); ok { - return rf(startBlock, maxEndBlock, l1infoTreeHash) + if rf, ok := ret.Get(0).(func(uint64, uint64, common.Hash, common.Hash, [32]common.Hash) (*types.AggchainProof, error)); ok { + return rf(startBlock, maxEndBlock, l1InfoTreeHash, l1InfoTreeLeaf, l1InfoTreeProof) } - if rf, ok := ret.Get(0).(func(uint64, uint64, common.Hash) *types.AggchainProof); ok { - r0 = rf(startBlock, maxEndBlock, l1infoTreeHash) + if rf, ok := ret.Get(0).(func(uint64, uint64, common.Hash, common.Hash, [32]common.Hash) *types.AggchainProof); ok { + r0 = rf(startBlock, maxEndBlock, l1InfoTreeHash, l1InfoTreeLeaf, l1InfoTreeProof) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.AggchainProof) } } - if rf, ok := ret.Get(1).(func(uint64, uint64, common.Hash) error); ok { - r1 = rf(startBlock, maxEndBlock, l1infoTreeHash) + if rf, ok := ret.Get(1).(func(uint64, uint64, common.Hash, common.Hash, [32]common.Hash) error); ok { + r1 = rf(startBlock, maxEndBlock, l1InfoTreeHash, l1InfoTreeLeaf, l1InfoTreeProof) } else { r1 = ret.Error(1) } @@ -61,14 +61,16 @@ type AggchainProofClientInterface_GenerateAggchainProof_Call struct { // GenerateAggchainProof is a helper method to define mock.On call // - startBlock uint64 // - maxEndBlock uint64 -// - l1infoTreeHash common.Hash -func (_e *AggchainProofClientInterface_Expecter) GenerateAggchainProof(startBlock interface{}, maxEndBlock interface{}, l1infoTreeHash interface{}) *AggchainProofClientInterface_GenerateAggchainProof_Call { - return &AggchainProofClientInterface_GenerateAggchainProof_Call{Call: _e.mock.On("GenerateAggchainProof", startBlock, maxEndBlock, l1infoTreeHash)} +// - l1InfoTreeHash common.Hash +// - l1InfoTreeLeaf common.Hash +// - l1InfoTreeProof [32]common.Hash +func (_e *AggchainProofClientInterface_Expecter) GenerateAggchainProof(startBlock interface{}, maxEndBlock interface{}, l1InfoTreeHash interface{}, l1InfoTreeLeaf interface{}, l1InfoTreeProof interface{}) *AggchainProofClientInterface_GenerateAggchainProof_Call { + return &AggchainProofClientInterface_GenerateAggchainProof_Call{Call: _e.mock.On("GenerateAggchainProof", startBlock, maxEndBlock, l1InfoTreeHash, l1InfoTreeLeaf, l1InfoTreeProof)} } -func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) Run(run func(startBlock uint64, maxEndBlock uint64, l1infoTreeHash common.Hash)) *AggchainProofClientInterface_GenerateAggchainProof_Call { +func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) Run(run func(startBlock uint64, maxEndBlock uint64, l1InfoTreeHash common.Hash, l1InfoTreeLeaf common.Hash, l1InfoTreeProof [32]common.Hash)) *AggchainProofClientInterface_GenerateAggchainProof_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(uint64), args[2].(common.Hash)) + run(args[0].(uint64), args[1].(uint64), args[2].(common.Hash), args[3].(common.Hash), args[4].([32]common.Hash)) }) return _c } @@ -78,7 +80,7 @@ func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) Return(_a0 *t return _c } -func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) RunAndReturn(run func(uint64, uint64, common.Hash) (*types.AggchainProof, error)) *AggchainProofClientInterface_GenerateAggchainProof_Call { +func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) RunAndReturn(run func(uint64, uint64, common.Hash, common.Hash, [32]common.Hash) (*types.AggchainProof, error)) *AggchainProofClientInterface_GenerateAggchainProof_Call { _c.Call.Return(run) return _c } diff --git a/aggsender/proto/aggsender.proto b/aggsender/proto/aggchain_proof_generation.proto similarity index 84% rename from aggsender/proto/aggsender.proto rename to aggsender/proto/aggchain_proof_generation.proto index 34303722..648b1fd7 100644 --- a/aggsender/proto/aggsender.proto +++ b/aggsender/proto/aggchain_proof_generation.proto @@ -16,8 +16,12 @@ message GenerateAggchainProofRequest { uint64 start_block = 1; // The max end block for which the aggchain proof is requested. uint64 max_end_block = 2; - // L1 Info tree hash for the nearest finalized block. - bytes l1info_tree_hash = 3; + // L1 Info tree hash. + bytes l1_info_tree_hash = 3; + // L1 Info tree leaf. + bytes l1_info_tree_leaf = 4; + // L1 Info tree proof. + repeated bytes l1_info_tree_proof = 5; } // The aggchain proof response message. diff --git a/aggsender/types/aggchain_proof_generation.pb.go b/aggsender/types/aggchain_proof_generation.pb.go new file mode 100644 index 00000000..4814a30b --- /dev/null +++ b/aggsender/types/aggchain_proof_generation.pb.go @@ -0,0 +1,264 @@ +// Proto definition for AggSender service + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.3 +// protoc v5.29.3 +// source: aggchain_proof_generation.proto + +package types + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The request message for generating aggchain proof. +type GenerateAggchainProofRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The start block for which the aggchain proof is requested. + StartBlock uint64 `protobuf:"varint,1,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` + // The max end block for which the aggchain proof is requested. + MaxEndBlock uint64 `protobuf:"varint,2,opt,name=max_end_block,json=maxEndBlock,proto3" json:"max_end_block,omitempty"` + // L1 Info tree hash. + L1InfoTreeHash []byte `protobuf:"bytes,3,opt,name=l1_info_tree_hash,json=l1InfoTreeHash,proto3" json:"l1_info_tree_hash,omitempty"` + // L1 Info tree leaf. + L1InfoTreeLeaf []byte `protobuf:"bytes,4,opt,name=l1_info_tree_leaf,json=l1InfoTreeLeaf,proto3" json:"l1_info_tree_leaf,omitempty"` + // L1 Info tree proof. + L1InfoTreeProof [][]byte `protobuf:"bytes,5,rep,name=l1_info_tree_proof,json=l1InfoTreeProof,proto3" json:"l1_info_tree_proof,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GenerateAggchainProofRequest) Reset() { + *x = GenerateAggchainProofRequest{} + mi := &file_aggchain_proof_generation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GenerateAggchainProofRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateAggchainProofRequest) ProtoMessage() {} + +func (x *GenerateAggchainProofRequest) ProtoReflect() protoreflect.Message { + mi := &file_aggchain_proof_generation_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateAggchainProofRequest.ProtoReflect.Descriptor instead. +func (*GenerateAggchainProofRequest) Descriptor() ([]byte, []int) { + return file_aggchain_proof_generation_proto_rawDescGZIP(), []int{0} +} + +func (x *GenerateAggchainProofRequest) GetStartBlock() uint64 { + if x != nil { + return x.StartBlock + } + return 0 +} + +func (x *GenerateAggchainProofRequest) GetMaxEndBlock() uint64 { + if x != nil { + return x.MaxEndBlock + } + return 0 +} + +func (x *GenerateAggchainProofRequest) GetL1InfoTreeHash() []byte { + if x != nil { + return x.L1InfoTreeHash + } + return nil +} + +func (x *GenerateAggchainProofRequest) GetL1InfoTreeLeaf() []byte { + if x != nil { + return x.L1InfoTreeLeaf + } + return nil +} + +func (x *GenerateAggchainProofRequest) GetL1InfoTreeProof() [][]byte { + if x != nil { + return x.L1InfoTreeProof + } + return nil +} + +// The aggchain proof response message. +type GenerateAggchainProofResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // TODO - Define the type of aggchain proof. + // The start block of the aggchain proof. + AggchainProof []byte `protobuf:"bytes,1,opt,name=aggchain_proof,json=aggchainProof,proto3" json:"aggchain_proof,omitempty"` + // The start block of the aggchain proof. + StartBlock uint64 `protobuf:"varint,2,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` + // The end block of the aggchain proof. + EndBlock uint64 `protobuf:"varint,3,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GenerateAggchainProofResponse) Reset() { + *x = GenerateAggchainProofResponse{} + mi := &file_aggchain_proof_generation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GenerateAggchainProofResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateAggchainProofResponse) ProtoMessage() {} + +func (x *GenerateAggchainProofResponse) ProtoReflect() protoreflect.Message { + mi := &file_aggchain_proof_generation_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateAggchainProofResponse.ProtoReflect.Descriptor instead. +func (*GenerateAggchainProofResponse) Descriptor() ([]byte, []int) { + return file_aggchain_proof_generation_proto_rawDescGZIP(), []int{1} +} + +func (x *GenerateAggchainProofResponse) GetAggchainProof() []byte { + if x != nil { + return x.AggchainProof + } + return nil +} + +func (x *GenerateAggchainProofResponse) GetStartBlock() uint64 { + if x != nil { + return x.StartBlock + } + return 0 +} + +func (x *GenerateAggchainProofResponse) GetEndBlock() uint64 { + if x != nil { + return x.EndBlock + } + return 0 +} + +var File_aggchain_proof_generation_proto protoreflect.FileDescriptor + +var file_aggchain_proof_generation_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0xe6, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x22, 0x0a, 0x0d, 0x6d, 0x61, + 0x78, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x29, + 0x0a, 0x11, 0x6c, 0x31, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6c, 0x31, 0x49, 0x6e, 0x66, + 0x6f, 0x54, 0x72, 0x65, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x11, 0x6c, 0x31, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, + 0x4c, 0x65, 0x61, 0x66, 0x12, 0x2b, 0x0a, 0x12, 0x6c, 0x31, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, + 0x74, 0x72, 0x65, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x0f, 0x6c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x22, 0x84, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x67, + 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x67, 0x67, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x65, + 0x6e, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, + 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x32, 0x7a, 0x0a, 0x14, 0x41, 0x67, 0x67, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x62, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x67, 0x67, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x23, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, + 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, + 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_aggchain_proof_generation_proto_rawDescOnce sync.Once + file_aggchain_proof_generation_proto_rawDescData = file_aggchain_proof_generation_proto_rawDesc +) + +func file_aggchain_proof_generation_proto_rawDescGZIP() []byte { + file_aggchain_proof_generation_proto_rawDescOnce.Do(func() { + file_aggchain_proof_generation_proto_rawDescData = protoimpl.X.CompressGZIP(file_aggchain_proof_generation_proto_rawDescData) + }) + return file_aggchain_proof_generation_proto_rawDescData +} + +var file_aggchain_proof_generation_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_aggchain_proof_generation_proto_goTypes = []any{ + (*GenerateAggchainProofRequest)(nil), // 0: types.GenerateAggchainProofRequest + (*GenerateAggchainProofResponse)(nil), // 1: types.GenerateAggchainProofResponse +} +var file_aggchain_proof_generation_proto_depIdxs = []int32{ + 0, // 0: types.AggchainProofService.GenerateAggchainProof:input_type -> types.GenerateAggchainProofRequest + 1, // 1: types.AggchainProofService.GenerateAggchainProof:output_type -> types.GenerateAggchainProofResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_aggchain_proof_generation_proto_init() } +func file_aggchain_proof_generation_proto_init() { + if File_aggchain_proof_generation_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_aggchain_proof_generation_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_aggchain_proof_generation_proto_goTypes, + DependencyIndexes: file_aggchain_proof_generation_proto_depIdxs, + MessageInfos: file_aggchain_proof_generation_proto_msgTypes, + }.Build() + File_aggchain_proof_generation_proto = out.File + file_aggchain_proof_generation_proto_rawDesc = nil + file_aggchain_proof_generation_proto_goTypes = nil + file_aggchain_proof_generation_proto_depIdxs = nil +} diff --git a/aggsender/types/aggsender_grpc.pb.go b/aggsender/types/aggchain_proof_generation_grpc.pb.go similarity index 98% rename from aggsender/types/aggsender_grpc.pb.go rename to aggsender/types/aggchain_proof_generation_grpc.pb.go index 678fd8a3..baa99685 100644 --- a/aggsender/types/aggsender_grpc.pb.go +++ b/aggsender/types/aggchain_proof_generation_grpc.pb.go @@ -4,7 +4,7 @@ // versions: // - protoc-gen-go-grpc v1.5.1 // - protoc v5.29.3 -// source: aggsender.proto +// source: aggchain_proof_generation.proto package types @@ -125,5 +125,5 @@ var AggchainProofService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "aggsender.proto", + Metadata: "aggchain_proof_generation.proto", } diff --git a/aggsender/types/aggsender.pb.go b/aggsender/types/aggsender.pb.go deleted file mode 100644 index 8b5c2242..00000000 --- a/aggsender/types/aggsender.pb.go +++ /dev/null @@ -1,240 +0,0 @@ -// Proto definition for AggSender service - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.3 -// protoc v5.29.3 -// source: aggsender.proto - -package types - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The request message for generating aggchain proof. -type GenerateAggchainProofRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The start block for which the aggchain proof is requested. - StartBlock uint64 `protobuf:"varint,1,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - // The max end block for which the aggchain proof is requested. - MaxEndBlock uint64 `protobuf:"varint,2,opt,name=max_end_block,json=maxEndBlock,proto3" json:"max_end_block,omitempty"` - // L1 Hash - L1InfoTreeHash []byte `protobuf:"bytes,3,opt,name=l1info_tree_hash,json=l1infoTreeHash,proto3" json:"l1info_tree_hash,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GenerateAggchainProofRequest) Reset() { - *x = GenerateAggchainProofRequest{} - mi := &file_aggsender_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GenerateAggchainProofRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateAggchainProofRequest) ProtoMessage() {} - -func (x *GenerateAggchainProofRequest) ProtoReflect() protoreflect.Message { - mi := &file_aggsender_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenerateAggchainProofRequest.ProtoReflect.Descriptor instead. -func (*GenerateAggchainProofRequest) Descriptor() ([]byte, []int) { - return file_aggsender_proto_rawDescGZIP(), []int{0} -} - -func (x *GenerateAggchainProofRequest) GetStartBlock() uint64 { - if x != nil { - return x.StartBlock - } - return 0 -} - -func (x *GenerateAggchainProofRequest) GetMaxEndBlock() uint64 { - if x != nil { - return x.MaxEndBlock - } - return 0 -} - -func (x *GenerateAggchainProofRequest) GetL1InfoTreeHash() []byte { - if x != nil { - return x.L1InfoTreeHash - } - return nil -} - -// The aggchain proof response message. -type GenerateAggchainProofResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // TODO - Define the type of aggchain proof. - // The start block of the aggchain proof. - AggchainProof []byte `protobuf:"bytes,1,opt,name=aggchain_proof,json=aggchainProof,proto3" json:"aggchain_proof,omitempty"` - // The start block of the aggchain proof. - StartBlock uint64 `protobuf:"varint,2,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` - // The end block of the aggchain proof. - EndBlock uint64 `protobuf:"varint,3,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GenerateAggchainProofResponse) Reset() { - *x = GenerateAggchainProofResponse{} - mi := &file_aggsender_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GenerateAggchainProofResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateAggchainProofResponse) ProtoMessage() {} - -func (x *GenerateAggchainProofResponse) ProtoReflect() protoreflect.Message { - mi := &file_aggsender_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenerateAggchainProofResponse.ProtoReflect.Descriptor instead. -func (*GenerateAggchainProofResponse) Descriptor() ([]byte, []int) { - return file_aggsender_proto_rawDescGZIP(), []int{1} -} - -func (x *GenerateAggchainProofResponse) GetAggchainProof() []byte { - if x != nil { - return x.AggchainProof - } - return nil -} - -func (x *GenerateAggchainProofResponse) GetStartBlock() uint64 { - if x != nil { - return x.StartBlock - } - return 0 -} - -func (x *GenerateAggchainProofResponse) GetEndBlock() uint64 { - if x != nil { - return x.EndBlock - } - return 0 -} - -var File_aggsender_proto protoreflect.FileDescriptor - -var file_aggsender_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, - 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x22, 0x0a, 0x0d, 0x6d, 0x61, - 0x78, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x45, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x28, - 0x0a, 0x10, 0x6c, 0x31, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6c, 0x31, 0x69, 0x6e, 0x66, 0x6f, - 0x54, 0x72, 0x65, 0x65, 0x48, 0x61, 0x73, 0x68, 0x22, 0x84, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, - 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x67, - 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x32, - 0x7a, 0x0a, 0x14, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x12, 0x23, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_aggsender_proto_rawDescOnce sync.Once - file_aggsender_proto_rawDescData = file_aggsender_proto_rawDesc -) - -func file_aggsender_proto_rawDescGZIP() []byte { - file_aggsender_proto_rawDescOnce.Do(func() { - file_aggsender_proto_rawDescData = protoimpl.X.CompressGZIP(file_aggsender_proto_rawDescData) - }) - return file_aggsender_proto_rawDescData -} - -var file_aggsender_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_aggsender_proto_goTypes = []any{ - (*GenerateAggchainProofRequest)(nil), // 0: types.GenerateAggchainProofRequest - (*GenerateAggchainProofResponse)(nil), // 1: types.GenerateAggchainProofResponse -} -var file_aggsender_proto_depIdxs = []int32{ - 0, // 0: types.AggchainProofService.GenerateAggchainProof:input_type -> types.GenerateAggchainProofRequest - 1, // 1: types.AggchainProofService.GenerateAggchainProof:output_type -> types.GenerateAggchainProofResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_aggsender_proto_init() } -func file_aggsender_proto_init() { - if File_aggsender_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_aggsender_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_aggsender_proto_goTypes, - DependencyIndexes: file_aggsender_proto_depIdxs, - MessageInfos: file_aggsender_proto_msgTypes, - }.Build() - File_aggsender_proto = out.File - file_aggsender_proto_rawDesc = nil - file_aggsender_proto_goTypes = nil - file_aggsender_proto_depIdxs = nil -} diff --git a/aggsender/types/certificate_build_params.go b/aggsender/types/certificate_build_params.go index 9767b5f8..c0dc4f07 100644 --- a/aggsender/types/certificate_build_params.go +++ b/aggsender/types/certificate_build_params.go @@ -21,7 +21,7 @@ type CertificateBuildParams struct { CreatedAt uint32 RetryCount int LastSentCertificate *CertificateInfo - AggchainProof string + AggchainProof []byte } func (c *CertificateBuildParams) String() string { diff --git a/aggsender/types/types.go b/aggsender/types/types.go index 7282dcba..6bdb1cd1 100644 --- a/aggsender/types/types.go +++ b/aggsender/types/types.go @@ -74,7 +74,7 @@ type Logger interface { type AggchainProof struct { StartBlock uint64 EndBlock uint64 - Proof string + Proof []byte } type CertificateInfo struct { @@ -90,7 +90,7 @@ type CertificateInfo struct { CreatedAt uint32 `meddler:"created_at"` UpdatedAt uint32 `meddler:"updated_at"` SignedCertificate string `meddler:"signed_certificate"` - AggchainProof string `meddler:"aggchain_proof"` + AggchainProof []byte `meddler:"aggchain_proof"` } func (c *CertificateInfo) String() string { diff --git a/sync/mock_evm_downloader_full.go b/sync/mock_evm_downloader_full.go index 943b2aad..ce7f7c58 100644 --- a/sync/mock_evm_downloader_full.go +++ b/sync/mock_evm_downloader_full.go @@ -53,7 +53,7 @@ func (_c *EVMDownloaderMock_Download_Call) Return() *EVMDownloaderMock_Download_ } func (_c *EVMDownloaderMock_Download_Call) RunAndReturn(run func(context.Context, uint64, chan EVMBlock)) *EVMDownloaderMock_Download_Call { - _c.Call.Return(run) + _c.Run(run) return _c }