diff --git a/Makefile b/Makefile index 9c668cc..51386fe 100644 --- a/Makefile +++ b/Makefile @@ -66,14 +66,26 @@ test: vet .PHONY: test ### proto-gen: Generate protobuf files. Requires docker. -#proto-gen: -# @echo "--> Generating Protobuf files" -# ./proto/get_deps.sh -# ./proto/gen.sh -#.PHONY: proto-gen +# proto-gen: +# @echo "--> Generating Protobuf files" +# ./proto/gen.sh +# .PHONY: proto-gen + +#? check-proto-deps: Check protobuf deps +check-proto-deps: +ifeq (,$(shell which protoc-gen-gocosmos)) + @go install github.com/cosmos/gogoproto/protoc-gen-gocosmos@latest +endif +.PHONY: check-proto-deps + +#? proto-gen: Generate protobuf files +proto-gen: check-proto-deps + @echo "Generating Protobuf files" + @go run github.com/bufbuild/buf/cmd/buf@latest generate --path proto/sequencing +.PHONY: proto-gen # ### proto-lint: Lint protobuf files. Requires docker. -#proto-lint: -# @echo "--> Linting Protobuf files" -# @$(DOCKER_BUF) lint --error-format=json -#.PHONY: proto-lint +proto-lint: + @echo "--> Linting Protobuf files" + @$(DOCKER_BUF) lint --error-format=json +.PHONY: proto-lint diff --git a/README.md b/README.md index bf48f81..1da4bb7 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,70 @@ go-sequencing defines a generic sequencing interface for modular blockchains + +[![build-and-test](https://github.com/rollkit/go-sequencing/actions/workflows/ci_release.yml/badge.svg)](https://github.com/rollkit/go-sequencing/actions/workflows/ci_release.yml) +[![golangci-lint](https://github.com/rollkit/go-sequencing/actions/workflows/lint.yml/badge.svg)](https://github.com/rollkit/go-sequencing/actions/workflows/lint.yml) +[![Go Report Card](https://goreportcard.com/badge/github.com/rollkit/go-sequencing)](https://goreportcard.com/report/github.com/rollkit/go-sequencing) +[![codecov](https://codecov.io/gh/rollkit/go-sequencing/branch/main/graph/badge.svg?token=CWGA4RLDS9)](https://codecov.io/gh/rollkit/go-sequencing) +[![GoDoc](https://godoc.org/github.com/rollkit/go-sequencing?status.svg)](https://godoc.org/github.com/rollkit/go-sequencing) + + ## Sequencing Interface +| Method | Params | Return | +| ------------- | -------------------------------------------------------- | --------------- | +| `SubmitRollupTransaction` | `context.Context`, `rollupId RollupId`, `tx Tx` | `error` | +| `GetNextBatch` | `context.Context`, `lastBatchHash Hash` | `batch Batch`, `error` | +| `VerifyBatch` | `context.Context`, `lastBatchHash Hash` | `success bool`, `error` | + +Note: `Batch` is []`Tx` and `Tx` is `[]byte`. Also `Hash` and `RollupId` are `[]byte`. + ## Implementations + +The following implementations are available: + +* [centralized-sequencer](https://github.com/rollkit/centralized-sequencer) implements a centralized sequencer that posts rollup transactions to Celestia DA. +* [astria-sequencer](https://github.com/rollkit/astria-sequencer) implements a Astria sequencer middleware that connects to Astria shared sequencer. + +In addition the following helper implementations are available: + +* [DummySequencer](https://github.com/rollkit/go-sequencing/blob/main/test/dummy.go) implements +a Mock sequencer useful for testing. +* [Proxy](https://github.com/rollkit/go-sequencing/tree/main/proxy) implements a proxy +server that forwards requests to a gRPC server. The proxy client +can be used directly to interact with the sequencer service. + +## Helpful commands + +```sh +# Generate protobuf files. Requires docker. +make proto-gen + +# Lint protobuf files. Requires docker. +make proto-lint + +# Run tests. +make test + +# Run linters (requires golangci-lint, markdownlint, hadolint, and yamllint) +make lint +``` + +## Contributing + +We welcome your contributions! Everyone is welcome to contribute, whether it's +in the form of code, documentation, bug reports, feature +requests, or anything else. + +If you're looking for issues to work on, try looking at the +[good first issue list](https://github.com/rollkit/go-da/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). +Issues with this tag are suitable for a new external contributor and is a great +way to find something you can help with! + +Please join our +[Community Discord](https://discord.com/invite/YsnTPcSfWQ) +to ask questions, discuss your ideas, and connect with other contributors. + +## Code of Conduct + +See our Code of Conduct [here](https://docs.celestia.org/community/coc). \ No newline at end of file diff --git a/buf.gen.yaml b/buf.gen.yaml index bbf312a..9fc7a0d 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -3,8 +3,13 @@ version: v1beta1 # The plugins to run. plugins: # The name of the plugin. - - name: gogofaster + - name: gocosmos # The the relative output directory. out: types/pb # Any options to provide to the plugin. - opt: plugins=grpc,paths=source_relative \ No newline at end of file + opt: + - Mgoogle/protobuf/timestamp.proto=github.com/cosmos/gogoproto/types + - Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration + - Mgoogle/protobuf/wrappers.proto=github.com/cosmos/gogoproto/types + - plugins=grpc + - paths=source_relative \ No newline at end of file diff --git a/buf.yaml b/buf.yaml index a9b0f7d..5bfe5e3 100644 --- a/buf.yaml +++ b/buf.yaml @@ -1,5 +1,6 @@ version: v1beta1 - +deps: + - buf.build/cosmos/gogo-proto build: roots: - proto diff --git a/go.mod b/go.mod index e8a18bf..d9ba403 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,15 @@ module github.com/rollkit/go-sequencing go 1.21.0 require ( - github.com/gogo/protobuf v1.3.2 - google.golang.org/grpc v1.65.0 + github.com/cosmos/gogoproto v1.7.0 + google.golang.org/grpc v1.66.0 ) require ( - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/protobuf v1.34.1 // indirect + github.com/google/go-cmp v0.6.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect + google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/go.sum b/go.sum index a2f09e3..3b5acdd 100644 --- a/go.sum +++ b/go.sum @@ -1,45 +1,18 @@ -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= diff --git a/proto/gen.sh b/proto/gen.sh deleted file mode 100644 index a34875d..0000000 --- a/proto/gen.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# see: https://stackoverflow.com/a/246128 -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"/.. -TARGET_DIR=./types/pb - -cd $SCRIPT_DIR -mkdir -p $TARGET_DIR -rm -rf $TARGET_DIR/* -docker run -u $UID:$(id -g) -e XDG_CACHE_HOME=/tmp/.cache -v $PWD:/workspace --workdir /workspace tendermintdev/docker-build-proto sh ./proto/protoc.sh \ No newline at end of file diff --git a/proto/protoc.sh b/proto/protoc.sh deleted file mode 100644 index 60d8606..0000000 --- a/proto/protoc.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -eo pipefail - -buf generate --path="./proto/sequencing" --template="buf.gen.yaml" --config="buf.yaml" \ No newline at end of file diff --git a/types/pb/sequencing/sequencing.pb.go b/types/pb/sequencing/sequencing.pb.go index 4ed37af..b907935 100644 --- a/types/pb/sequencing/sequencing.pb.go +++ b/types/pb/sequencing/sequencing.pb.go @@ -1,12 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: sequencing/sequencing.proto -package rollkit +package sequencing import ( context "context" fmt "fmt" - proto "github.com/gogo/protobuf/proto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/cosmos/gogoproto/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -118,6 +120,105 @@ func (m *SubmitRollupTransactionResponse) XXX_DiscardUnknown() { var xxx_messageInfo_SubmitRollupTransactionResponse proto.InternalMessageInfo +// GetNextBatchRequest ... +type GetNextBatchRequest struct { + // Merkle tree hash of the last batch + LastBatchHash [][]byte `protobuf:"bytes,1,rep,name=last_batch_hash,json=lastBatchHash,proto3" json:"last_batch_hash,omitempty"` +} + +func (m *GetNextBatchRequest) Reset() { *m = GetNextBatchRequest{} } +func (m *GetNextBatchRequest) String() string { return proto.CompactTextString(m) } +func (*GetNextBatchRequest) ProtoMessage() {} +func (*GetNextBatchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b389fdbc59f03c95, []int{2} +} +func (m *GetNextBatchRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNextBatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNextBatchRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetNextBatchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNextBatchRequest.Merge(m, src) +} +func (m *GetNextBatchRequest) XXX_Size() int { + return m.Size() +} +func (m *GetNextBatchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetNextBatchRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNextBatchRequest proto.InternalMessageInfo + +func (m *GetNextBatchRequest) GetLastBatchHash() [][]byte { + if m != nil { + return m.LastBatchHash + } + return nil +} + +// GetNextBatchResponse ... +type GetNextBatchResponse struct { + Batch *Batch `protobuf:"bytes,1,opt,name=batch,proto3" json:"batch,omitempty"` + Timestamp *types.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (m *GetNextBatchResponse) Reset() { *m = GetNextBatchResponse{} } +func (m *GetNextBatchResponse) String() string { return proto.CompactTextString(m) } +func (*GetNextBatchResponse) ProtoMessage() {} +func (*GetNextBatchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b389fdbc59f03c95, []int{3} +} +func (m *GetNextBatchResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNextBatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNextBatchResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetNextBatchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNextBatchResponse.Merge(m, src) +} +func (m *GetNextBatchResponse) XXX_Size() int { + return m.Size() +} +func (m *GetNextBatchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetNextBatchResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNextBatchResponse proto.InternalMessageInfo + +func (m *GetNextBatchResponse) GetBatch() *Batch { + if m != nil { + return m.Batch + } + return nil +} + +func (m *GetNextBatchResponse) GetTimestamp() *types.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + // Batch holds a list of transactions type Batch struct { Transactions [][]byte `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"` @@ -127,7 +228,7 @@ func (m *Batch) Reset() { *m = Batch{} } func (m *Batch) String() string { return proto.CompactTextString(m) } func (*Batch) ProtoMessage() {} func (*Batch) Descriptor() ([]byte, []int) { - return fileDescriptor_b389fdbc59f03c95, []int{2} + return fileDescriptor_b389fdbc59f03c95, []int{4} } func (m *Batch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -163,23 +264,70 @@ func (m *Batch) GetTransactions() [][]byte { return nil } -// VerificationResponse -type VerificationResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +// VerifyBatchRequest ... +type VerifyBatchRequest struct { + // Merkle tree hash of the batch + BatchHash [][]byte `protobuf:"bytes,1,rep,name=batch_hash,json=batchHash,proto3" json:"batch_hash,omitempty"` } -func (m *VerificationResponse) Reset() { *m = VerificationResponse{} } -func (m *VerificationResponse) String() string { return proto.CompactTextString(m) } -func (*VerificationResponse) ProtoMessage() {} -func (*VerificationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b389fdbc59f03c95, []int{3} +func (m *VerifyBatchRequest) Reset() { *m = VerifyBatchRequest{} } +func (m *VerifyBatchRequest) String() string { return proto.CompactTextString(m) } +func (*VerifyBatchRequest) ProtoMessage() {} +func (*VerifyBatchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b389fdbc59f03c95, []int{5} +} +func (m *VerifyBatchRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VerifyBatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VerifyBatchRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VerifyBatchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_VerifyBatchRequest.Merge(m, src) +} +func (m *VerifyBatchRequest) XXX_Size() int { + return m.Size() +} +func (m *VerifyBatchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_VerifyBatchRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_VerifyBatchRequest proto.InternalMessageInfo + +func (m *VerifyBatchRequest) GetBatchHash() [][]byte { + if m != nil { + return m.BatchHash + } + return nil +} + +// VerifyBatchResponse +type VerifyBatchResponse struct { + // status indicates the verification results + Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (m *VerifyBatchResponse) Reset() { *m = VerifyBatchResponse{} } +func (m *VerifyBatchResponse) String() string { return proto.CompactTextString(m) } +func (*VerifyBatchResponse) ProtoMessage() {} +func (*VerifyBatchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b389fdbc59f03c95, []int{6} } -func (m *VerificationResponse) XXX_Unmarshal(b []byte) error { +func (m *VerifyBatchResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *VerificationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *VerifyBatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_VerificationResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_VerifyBatchResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -189,56 +337,66 @@ func (m *VerificationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *VerificationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_VerificationResponse.Merge(m, src) +func (m *VerifyBatchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_VerifyBatchResponse.Merge(m, src) } -func (m *VerificationResponse) XXX_Size() int { +func (m *VerifyBatchResponse) XXX_Size() int { return m.Size() } -func (m *VerificationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_VerificationResponse.DiscardUnknown(m) +func (m *VerifyBatchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_VerifyBatchResponse.DiscardUnknown(m) } -var xxx_messageInfo_VerificationResponse proto.InternalMessageInfo +var xxx_messageInfo_VerifyBatchResponse proto.InternalMessageInfo -func (m *VerificationResponse) GetSuccess() bool { +func (m *VerifyBatchResponse) GetStatus() bool { if m != nil { - return m.Success + return m.Status } return false } func init() { - proto.RegisterType((*SubmitRollupTransactionRequest)(nil), "rollkit.SubmitRollupTransactionRequest") - proto.RegisterType((*SubmitRollupTransactionResponse)(nil), "rollkit.SubmitRollupTransactionResponse") - proto.RegisterType((*Batch)(nil), "rollkit.Batch") - proto.RegisterType((*VerificationResponse)(nil), "rollkit.VerificationResponse") + proto.RegisterType((*SubmitRollupTransactionRequest)(nil), "sequencing.SubmitRollupTransactionRequest") + proto.RegisterType((*SubmitRollupTransactionResponse)(nil), "sequencing.SubmitRollupTransactionResponse") + proto.RegisterType((*GetNextBatchRequest)(nil), "sequencing.GetNextBatchRequest") + proto.RegisterType((*GetNextBatchResponse)(nil), "sequencing.GetNextBatchResponse") + proto.RegisterType((*Batch)(nil), "sequencing.Batch") + proto.RegisterType((*VerifyBatchRequest)(nil), "sequencing.VerifyBatchRequest") + proto.RegisterType((*VerifyBatchResponse)(nil), "sequencing.VerifyBatchResponse") } func init() { proto.RegisterFile("sequencing/sequencing.proto", fileDescriptor_b389fdbc59f03c95) } var fileDescriptor_b389fdbc59f03c95 = []byte{ - // 318 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xcd, 0x4e, 0xc2, 0x40, - 0x18, 0xec, 0xfa, 0x07, 0x7e, 0x56, 0x4c, 0x36, 0x26, 0x36, 0x10, 0x57, 0xdc, 0x8b, 0x24, 0x26, - 0x48, 0xf0, 0xee, 0x01, 0x0f, 0x86, 0x8b, 0xc4, 0x62, 0xbc, 0x9a, 0x52, 0x56, 0xdd, 0x58, 0xb7, - 0x75, 0xf7, 0xdb, 0x44, 0x6f, 0x3e, 0x82, 0x8f, 0xe5, 0x91, 0xa3, 0x47, 0x03, 0x2f, 0x62, 0xd8, - 0x22, 0xa8, 0x01, 0xbd, 0xcd, 0xcc, 0xd7, 0x4e, 0x66, 0x26, 0x0b, 0x15, 0x23, 0x1e, 0xad, 0x50, - 0xb1, 0x54, 0xb7, 0x47, 0x33, 0x58, 0xcf, 0x74, 0x8a, 0x29, 0x2d, 0xe8, 0x34, 0x49, 0xee, 0x25, - 0xf2, 0x0b, 0x60, 0x5d, 0xdb, 0x7b, 0x90, 0x18, 0xa6, 0x49, 0x62, 0xb3, 0x4b, 0x1d, 0x29, 0x13, - 0xc5, 0x28, 0x53, 0x15, 0x8e, 0xff, 0x31, 0x48, 0x2b, 0xb0, 0xae, 0xdd, 0xed, 0x5a, 0xf6, 0x03, - 0x52, 0x25, 0x35, 0x3f, 0x2c, 0xe6, 0x42, 0xbb, 0x4f, 0x29, 0xac, 0xf4, 0x23, 0x8c, 0x82, 0x25, - 0xa7, 0x3b, 0xcc, 0xf7, 0x61, 0x6f, 0xa1, 0xa5, 0xc9, 0x52, 0x65, 0x04, 0x3f, 0x84, 0xd5, 0x56, - 0x84, 0xf1, 0x1d, 0xe5, 0xe0, 0xe3, 0xec, 0x6e, 0x02, 0x52, 0x5d, 0xae, 0xf9, 0xe1, 0x0f, 0x8d, - 0x37, 0x60, 0xfb, 0x4a, 0x68, 0x79, 0x23, 0xe3, 0xe8, 0xbb, 0x09, 0x0d, 0xa0, 0x60, 0x6c, 0x1c, - 0x0b, 0x63, 0x5c, 0xac, 0x62, 0xf8, 0x45, 0x9b, 0x2f, 0x04, 0x4a, 0xdd, 0xbc, 0xb2, 0xd0, 0x6d, - 0x95, 0x59, 0xa4, 0x0a, 0x76, 0x16, 0x84, 0xa2, 0x07, 0xf5, 0xc9, 0x18, 0xf5, 0xbf, 0x97, 0x28, - 0xd7, 0xfe, 0xff, 0x70, 0xd2, 0xcf, 0x6b, 0x9e, 0xc2, 0xd6, 0x34, 0x41, 0xc7, 0xe2, 0x38, 0x42, - 0x03, 0xfc, 0x33, 0x81, 0xe7, 0xe2, 0x09, 0xf3, 0xee, 0xa5, 0xa9, 0x9d, 0xe3, 0xe5, 0x5f, 0x9c, - 0x7b, 0xcd, 0x0e, 0x6c, 0x3a, 0x98, 0xd7, 0x17, 0x9a, 0x9e, 0xc0, 0x86, 0xc3, 0xcf, 0xf3, 0x1d, - 0x76, 0xa7, 0x7c, 0xde, 0x60, 0xdc, 0x6b, 0x05, 0x6f, 0x43, 0x46, 0x06, 0x43, 0x46, 0x3e, 0x86, - 0x8c, 0xbc, 0x8e, 0x98, 0x37, 0x18, 0x31, 0xef, 0x7d, 0xc4, 0xbc, 0xde, 0x9a, 0x7b, 0x17, 0xc7, - 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xde, 0xcd, 0xfe, 0xc7, 0x36, 0x02, 0x00, 0x00, + // 431 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x3d, 0x8f, 0xd3, 0x40, + 0x10, 0xb5, 0x81, 0x3b, 0x5d, 0x26, 0x3e, 0x4e, 0xec, 0x21, 0xb0, 0x7c, 0x62, 0x1d, 0x5c, 0xc0, + 0x89, 0x13, 0x8e, 0xe4, 0x6b, 0x68, 0x68, 0xae, 0x81, 0x34, 0x7c, 0x38, 0x11, 0x6d, 0xb4, 0x4e, + 0x36, 0xb1, 0x25, 0xc7, 0x36, 0xde, 0xb1, 0x44, 0xfe, 0x00, 0x35, 0x3f, 0x8b, 0x32, 0x25, 0x25, + 0x4a, 0xfe, 0x08, 0xf2, 0xfa, 0x5b, 0xc1, 0x88, 0xce, 0x7e, 0xf3, 0xe6, 0xcd, 0xbc, 0x37, 0x0b, + 0x57, 0x82, 0x7f, 0xcd, 0x78, 0xb4, 0x08, 0xa2, 0xf5, 0xb8, 0xf9, 0xb4, 0x93, 0x34, 0xc6, 0x98, + 0x40, 0x83, 0x18, 0xe6, 0x3a, 0x8e, 0xd7, 0x21, 0x1f, 0xcb, 0x8a, 0x97, 0xad, 0xc6, 0x18, 0x6c, + 0xb8, 0x40, 0xb6, 0x49, 0x0a, 0xb2, 0xf5, 0x19, 0xe8, 0x34, 0xf3, 0x36, 0x01, 0xba, 0x71, 0x18, + 0x66, 0xc9, 0x2c, 0x65, 0x91, 0x60, 0x0b, 0x0c, 0xe2, 0xc8, 0xcd, 0x55, 0x04, 0x92, 0x2b, 0x18, + 0xa4, 0xb2, 0x36, 0x0f, 0x96, 0xba, 0x3a, 0x52, 0xaf, 0x35, 0xf7, 0xac, 0x00, 0x26, 0x4b, 0x42, + 0xe0, 0xc1, 0x92, 0x21, 0xd3, 0xef, 0x49, 0x5c, 0x7e, 0x5b, 0xcf, 0xc1, 0xec, 0x95, 0x14, 0x49, + 0x1c, 0x09, 0x6e, 0xbd, 0x85, 0xcb, 0x77, 0x1c, 0x3f, 0xf0, 0x6f, 0x78, 0xc7, 0x70, 0xe1, 0x57, + 0xa3, 0x5e, 0xc0, 0x45, 0xc8, 0x04, 0xce, 0xbd, 0x1c, 0x9c, 0xfb, 0x4c, 0xf8, 0xba, 0x3a, 0xba, + 0x7f, 0xad, 0xb9, 0xe7, 0x39, 0x2c, 0xa9, 0xef, 0x99, 0xf0, 0xad, 0x2d, 0x3c, 0xee, 0xb6, 0x17, + 0xb2, 0xe4, 0x25, 0x9c, 0xc8, 0x56, 0xb9, 0xe6, 0xd0, 0x79, 0x64, 0xb7, 0xb2, 0x29, 0x98, 0x45, + 0x9d, 0xbc, 0x81, 0x41, 0x1d, 0x84, 0xdc, 0x7d, 0xe8, 0x18, 0x76, 0x11, 0x95, 0x5d, 0x45, 0x65, + 0xcf, 0x2a, 0x86, 0xdb, 0x90, 0xad, 0x1b, 0x38, 0x91, 0x4a, 0xc4, 0x02, 0x0d, 0x1b, 0x67, 0xa2, + 0x5c, 0xb4, 0x83, 0x59, 0xb7, 0x40, 0xbe, 0xf0, 0x34, 0x58, 0x6d, 0x3b, 0x2e, 0x9f, 0x01, 0x1c, + 0x19, 0x1c, 0x78, 0xb5, 0xb9, 0xd7, 0x70, 0xd9, 0x69, 0x2a, 0xbd, 0x3d, 0x81, 0x53, 0x81, 0x0c, + 0x33, 0x21, 0xcd, 0x9d, 0xb9, 0xe5, 0x9f, 0xf3, 0x5d, 0x85, 0x87, 0xd3, 0xc2, 0x26, 0x4f, 0x27, + 0x51, 0x92, 0x21, 0x41, 0x78, 0xda, 0x73, 0x00, 0xf2, 0xaa, 0x1d, 0xc9, 0xbf, 0x0f, 0x6f, 0xdc, + 0xfc, 0x17, 0xb7, 0xbc, 0xa8, 0xe2, 0xac, 0xe0, 0xa2, 0xde, 0xe3, 0x63, 0x86, 0xf9, 0x22, 0x53, + 0xd0, 0xda, 0x77, 0x22, 0x66, 0x5b, 0xf1, 0x2f, 0x0f, 0xc0, 0x18, 0xf5, 0x13, 0xea, 0x39, 0x0c, + 0xce, 0x25, 0x24, 0x43, 0x0a, 0x78, 0x4a, 0x3e, 0xc1, 0xb0, 0x15, 0x18, 0xa1, 0x6d, 0x8d, 0xe3, + 0xf8, 0x0d, 0xb3, 0xb7, 0x5e, 0x8d, 0xb8, 0xd3, 0x7f, 0xee, 0xa9, 0xba, 0xdb, 0x53, 0xf5, 0xf7, + 0x9e, 0xaa, 0x3f, 0x0e, 0x54, 0xd9, 0x1d, 0xa8, 0xf2, 0xeb, 0x40, 0x15, 0xef, 0x54, 0xbe, 0x8e, + 0xdb, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xee, 0x96, 0x4b, 0x33, 0x81, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -258,16 +416,16 @@ type SequencerInputClient interface { } type sequencerInputClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewSequencerInputClient(cc *grpc.ClientConn) SequencerInputClient { +func NewSequencerInputClient(cc grpc1.ClientConn) SequencerInputClient { return &sequencerInputClient{cc} } func (c *sequencerInputClient) SubmitRollupTransaction(ctx context.Context, in *SubmitRollupTransactionRequest, opts ...grpc.CallOption) (*SubmitRollupTransactionResponse, error) { out := new(SubmitRollupTransactionResponse) - err := c.cc.Invoke(ctx, "/rollkit.SequencerInput/SubmitRollupTransaction", in, out, opts...) + err := c.cc.Invoke(ctx, "/sequencing.SequencerInput/SubmitRollupTransaction", in, out, opts...) if err != nil { return nil, err } @@ -288,7 +446,7 @@ func (*UnimplementedSequencerInputServer) SubmitRollupTransaction(ctx context.Co return nil, status.Errorf(codes.Unimplemented, "method SubmitRollupTransaction not implemented") } -func RegisterSequencerInputServer(s *grpc.Server, srv SequencerInputServer) { +func RegisterSequencerInputServer(s grpc1.Server, srv SequencerInputServer) { s.RegisterService(&_SequencerInput_serviceDesc, srv) } @@ -302,7 +460,7 @@ func _SequencerInput_SubmitRollupTransaction_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/rollkit.SequencerInput/SubmitRollupTransaction", + FullMethod: "/sequencing.SequencerInput/SubmitRollupTransaction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SequencerInputServer).SubmitRollupTransaction(ctx, req.(*SubmitRollupTransactionRequest)) @@ -310,8 +468,9 @@ func _SequencerInput_SubmitRollupTransaction_Handler(srv interface{}, ctx contex return interceptor(ctx, in, info, handler) } +var SequencerInput_serviceDesc = _SequencerInput_serviceDesc var _SequencerInput_serviceDesc = grpc.ServiceDesc{ - ServiceName: "rollkit.SequencerInput", + ServiceName: "sequencing.SequencerInput", HandlerType: (*SequencerInputServer)(nil), Methods: []grpc.MethodDesc{ { @@ -327,21 +486,21 @@ var _SequencerInput_serviceDesc = grpc.ServiceDesc{ // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type SequencerOutputClient interface { - // SubmitRollupTransaction ... - GetNextBatch(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*Batch, error) + // GetNextBatch ... + GetNextBatch(ctx context.Context, in *GetNextBatchRequest, opts ...grpc.CallOption) (*GetNextBatchResponse, error) } type sequencerOutputClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewSequencerOutputClient(cc *grpc.ClientConn) SequencerOutputClient { +func NewSequencerOutputClient(cc grpc1.ClientConn) SequencerOutputClient { return &sequencerOutputClient{cc} } -func (c *sequencerOutputClient) GetNextBatch(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*Batch, error) { - out := new(Batch) - err := c.cc.Invoke(ctx, "/rollkit.SequencerOutput/GetNextBatch", in, out, opts...) +func (c *sequencerOutputClient) GetNextBatch(ctx context.Context, in *GetNextBatchRequest, opts ...grpc.CallOption) (*GetNextBatchResponse, error) { + out := new(GetNextBatchResponse) + err := c.cc.Invoke(ctx, "/sequencing.SequencerOutput/GetNextBatch", in, out, opts...) if err != nil { return nil, err } @@ -350,24 +509,24 @@ func (c *sequencerOutputClient) GetNextBatch(ctx context.Context, in *Batch, opt // SequencerOutputServer is the server API for SequencerOutput service. type SequencerOutputServer interface { - // SubmitRollupTransaction ... - GetNextBatch(context.Context, *Batch) (*Batch, error) + // GetNextBatch ... + GetNextBatch(context.Context, *GetNextBatchRequest) (*GetNextBatchResponse, error) } // UnimplementedSequencerOutputServer can be embedded to have forward compatible implementations. type UnimplementedSequencerOutputServer struct { } -func (*UnimplementedSequencerOutputServer) GetNextBatch(ctx context.Context, req *Batch) (*Batch, error) { +func (*UnimplementedSequencerOutputServer) GetNextBatch(ctx context.Context, req *GetNextBatchRequest) (*GetNextBatchResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNextBatch not implemented") } -func RegisterSequencerOutputServer(s *grpc.Server, srv SequencerOutputServer) { +func RegisterSequencerOutputServer(s grpc1.Server, srv SequencerOutputServer) { s.RegisterService(&_SequencerOutput_serviceDesc, srv) } func _SequencerOutput_GetNextBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Batch) + in := new(GetNextBatchRequest) if err := dec(in); err != nil { return nil, err } @@ -376,16 +535,17 @@ func _SequencerOutput_GetNextBatch_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/rollkit.SequencerOutput/GetNextBatch", + FullMethod: "/sequencing.SequencerOutput/GetNextBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SequencerOutputServer).GetNextBatch(ctx, req.(*Batch)) + return srv.(SequencerOutputServer).GetNextBatch(ctx, req.(*GetNextBatchRequest)) } return interceptor(ctx, in, info, handler) } +var SequencerOutput_serviceDesc = _SequencerOutput_serviceDesc var _SequencerOutput_serviceDesc = grpc.ServiceDesc{ - ServiceName: "rollkit.SequencerOutput", + ServiceName: "sequencing.SequencerOutput", HandlerType: (*SequencerOutputServer)(nil), Methods: []grpc.MethodDesc{ { @@ -402,20 +562,20 @@ var _SequencerOutput_serviceDesc = grpc.ServiceDesc{ // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type BatchVerifierClient interface { // VerifyBatch ... - VerifyBatch(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*VerificationResponse, error) + VerifyBatch(ctx context.Context, in *VerifyBatchRequest, opts ...grpc.CallOption) (*VerifyBatchResponse, error) } type batchVerifierClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewBatchVerifierClient(cc *grpc.ClientConn) BatchVerifierClient { +func NewBatchVerifierClient(cc grpc1.ClientConn) BatchVerifierClient { return &batchVerifierClient{cc} } -func (c *batchVerifierClient) VerifyBatch(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*VerificationResponse, error) { - out := new(VerificationResponse) - err := c.cc.Invoke(ctx, "/rollkit.BatchVerifier/VerifyBatch", in, out, opts...) +func (c *batchVerifierClient) VerifyBatch(ctx context.Context, in *VerifyBatchRequest, opts ...grpc.CallOption) (*VerifyBatchResponse, error) { + out := new(VerifyBatchResponse) + err := c.cc.Invoke(ctx, "/sequencing.BatchVerifier/VerifyBatch", in, out, opts...) if err != nil { return nil, err } @@ -425,23 +585,23 @@ func (c *batchVerifierClient) VerifyBatch(ctx context.Context, in *Batch, opts . // BatchVerifierServer is the server API for BatchVerifier service. type BatchVerifierServer interface { // VerifyBatch ... - VerifyBatch(context.Context, *Batch) (*VerificationResponse, error) + VerifyBatch(context.Context, *VerifyBatchRequest) (*VerifyBatchResponse, error) } // UnimplementedBatchVerifierServer can be embedded to have forward compatible implementations. type UnimplementedBatchVerifierServer struct { } -func (*UnimplementedBatchVerifierServer) VerifyBatch(ctx context.Context, req *Batch) (*VerificationResponse, error) { +func (*UnimplementedBatchVerifierServer) VerifyBatch(ctx context.Context, req *VerifyBatchRequest) (*VerifyBatchResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VerifyBatch not implemented") } -func RegisterBatchVerifierServer(s *grpc.Server, srv BatchVerifierServer) { +func RegisterBatchVerifierServer(s grpc1.Server, srv BatchVerifierServer) { s.RegisterService(&_BatchVerifier_serviceDesc, srv) } func _BatchVerifier_VerifyBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Batch) + in := new(VerifyBatchRequest) if err := dec(in); err != nil { return nil, err } @@ -450,16 +610,17 @@ func _BatchVerifier_VerifyBatch_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/rollkit.BatchVerifier/VerifyBatch", + FullMethod: "/sequencing.BatchVerifier/VerifyBatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BatchVerifierServer).VerifyBatch(ctx, req.(*Batch)) + return srv.(BatchVerifierServer).VerifyBatch(ctx, req.(*VerifyBatchRequest)) } return interceptor(ctx, in, info, handler) } +var BatchVerifier_serviceDesc = _BatchVerifier_serviceDesc var _BatchVerifier_serviceDesc = grpc.ServiceDesc{ - ServiceName: "rollkit.BatchVerifier", + ServiceName: "sequencing.BatchVerifier", HandlerType: (*BatchVerifierServer)(nil), Methods: []grpc.MethodDesc{ { @@ -531,6 +692,85 @@ func (m *SubmitRollupTransactionResponse) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } +func (m *GetNextBatchRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetNextBatchRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNextBatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LastBatchHash) > 0 { + for iNdEx := len(m.LastBatchHash) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.LastBatchHash[iNdEx]) + copy(dAtA[i:], m.LastBatchHash[iNdEx]) + i = encodeVarintSequencing(dAtA, i, uint64(len(m.LastBatchHash[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GetNextBatchResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetNextBatchResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNextBatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Batch != nil { + { + size, err := m.Batch.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *Batch) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -563,7 +803,7 @@ func (m *Batch) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *VerificationResponse) Marshal() (dAtA []byte, err error) { +func (m *VerifyBatchRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -573,19 +813,51 @@ func (m *VerificationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *VerificationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *VerifyBatchRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *VerificationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *VerifyBatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Success { + if len(m.BatchHash) > 0 { + for iNdEx := len(m.BatchHash) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.BatchHash[iNdEx]) + copy(dAtA[i:], m.BatchHash[iNdEx]) + i = encodeVarintSequencing(dAtA, i, uint64(len(m.BatchHash[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *VerifyBatchResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VerifyBatchResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VerifyBatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status { i-- - if m.Success { + if m.Status { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -633,6 +905,38 @@ func (m *SubmitRollupTransactionResponse) Size() (n int) { return n } +func (m *GetNextBatchRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LastBatchHash) > 0 { + for _, b := range m.LastBatchHash { + l = len(b) + n += 1 + l + sovSequencing(uint64(l)) + } + } + return n +} + +func (m *GetNextBatchResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Batch != nil { + l = m.Batch.Size() + n += 1 + l + sovSequencing(uint64(l)) + } + if m.Timestamp != nil { + l = m.Timestamp.Size() + n += 1 + l + sovSequencing(uint64(l)) + } + return n +} + func (m *Batch) Size() (n int) { if m == nil { return 0 @@ -648,13 +952,28 @@ func (m *Batch) Size() (n int) { return n } -func (m *VerificationResponse) Size() (n int) { +func (m *VerifyBatchRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Success { + if len(m.BatchHash) > 0 { + for _, b := range m.BatchHash { + l = len(b) + n += 1 + l + sovSequencing(uint64(l)) + } + } + return n +} + +func (m *VerifyBatchResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status { n += 2 } return n @@ -834,6 +1153,210 @@ func (m *SubmitRollupTransactionResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *GetNextBatchRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetNextBatchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNextBatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastBatchHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSequencing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSequencing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastBatchHash = append(m.LastBatchHash, make([]byte, postIndex-iNdEx)) + copy(m.LastBatchHash[len(m.LastBatchHash)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetNextBatchResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetNextBatchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNextBatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Batch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Batch == nil { + m.Batch = &Batch{} + } + if err := m.Batch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timestamp == nil { + m.Timestamp = &types.Timestamp{} + } + if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Batch) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -916,7 +1439,89 @@ func (m *Batch) Unmarshal(dAtA []byte) error { } return nil } -func (m *VerificationResponse) Unmarshal(dAtA []byte) error { +func (m *VerifyBatchRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VerifyBatchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VerifyBatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSequencing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSequencing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BatchHash = append(m.BatchHash, make([]byte, postIndex-iNdEx)) + copy(m.BatchHash[len(m.BatchHash)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VerifyBatchResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -939,15 +1544,15 @@ func (m *VerificationResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VerificationResponse: wiretype end group for non-group") + return fmt.Errorf("proto: VerifyBatchResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VerificationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: VerifyBatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -964,7 +1569,7 @@ func (m *VerificationResponse) Unmarshal(dAtA []byte) error { break } } - m.Success = bool(v != 0) + m.Status = bool(v != 0) default: iNdEx = preIndex skippy, err := skipSequencing(dAtA[iNdEx:])