From 84d1fb0ab69b220a96d67c60cb5dff5fbdbe191f Mon Sep 17 00:00:00 2001 From: Bharath Date: Wed, 29 May 2024 23:41:59 +0530 Subject: [PATCH] Feature/grpc execution api (#1) * add buf config and generated grpc code * poc e2e grpc communication * comment out panicking code * logging help * now reads cli args. now stops grpc server on shutdown. * add mutex to GRPCServerHandler update readme containerize w/ github action to build and push to ghcr (#3) fix gh action syntax (#4) * containerize w/ github action to build and push to ghcr * fix gh action yml syntax * enable manual trigger * fix syntax build and push manually (#5) * containerize w/ github action to build and push to ghcr * fix gh action yml syntax * enable manual trigger * fix syntax * dont use github action, do it ourselves * push manually Feature/containerize (#6) * containerize w/ github action to build and push to ghcr * fix gh action yml syntax * enable manual trigger * fix syntax * dont use github action, do it ourselves * push manually * correct multi line update SubmitTransaction to send tx to metro ethclient: ensure returned subscription is nil on error (#26976) core/state, trie: remove Try prefix in Trie accessors (#26975) This change renames StateTrie methods to remove the Try* prefix. We added the Trie methods with prefix 'Try' a long time ago, working around the problem that most existing methods of Trie did not return the database error. This weird naming convention has persisted until now. Co-authored-by: Gary Rong metrics/librato: ensure resp.body closed (#26969) This change ensures that we call Close on a http response body, in various places in the source code (mostly tests) core/vm: use atomic.Bool (#26951) Make use of new atomic types --------- Co-authored-by: Felix Lange Co-authored-by: Martin Holst Swende core/bloombits: use atomic type (#26993) core/state: use atomic.Bool (#26992) graphql: fix data races (#26965) Fixes multiple data races caused by the fact that resolving fields are done concurrently by the graphql library. It also enforces caching at the stateobject level for account fields. eth/tracers/native: prevent panic for LOG edge-cases (#26848) This PR fixes OOM panic in the callTracer as well as panicing on opcode validation errors (e.g. stack underflow) in callTracer and prestateTracer. Co-authored-by: Martin Holst Swende internal/debug: add log.logfmt flag to set logging to use logfmt (#26970) docs: update outdated DeriveSha docs comment (#26968) add localnet genesis update metro-transactions dep Adding features to mempool to support our pre-ordered txs (#2) * Adding features to mempool to support our pre-ordered txs * Add framing for gRPC to execute blocks * Remove public engine API call * Fix circular dependencies * Updated to use new Init, and fill out starting attributes * Add clear astriaordered, cleanup * readme fix * add bash and jq to final docker image * make txpool interface * no more panics, update DoBlock to also update state + store block * cleanup * set post-merge at genesis * cleanup * doc update * remove txpool interface changes * cleanup * cleanup * build and push images wih tags defined by git tags * build for multiple architectures. use docker-metadata action for semver * add push: true * only build arm for git tags/releases --------- Co-authored-by: Jesse Snyder Co-authored-by: elizabeth tag image with latest for builds from astria branch (#8) rename state_root to block_hash use FROM --platform=$BUILDPLATFORM to build arm images correctly (#9) use v4 of build and push action (#10) * use FROM --platform=$BUILDPLATFORM to build arm images correctly * use v4 of docker build and push fix arm builds. only build arm for tags and merges to default branch. (#12) * fix arm builds. only build arm for tags and merges to default branch. * fix gh action function syntax * more correct comment * build for semver tags Features and fixes needed for contract deployment test (#13) * add and remove tx from geth mempool so forge can deploy a contract * pass metro addr and port by flag * fixes from pr feedback * formatting implement FinalizeBlock gRPC call bump metro-transactions dep Update Protos (#16) * uses new protos * remove old protos update deps update deps no more unknown/unknown image (#19) * no more unknown/unknown image * hardcode condition Changing from prev_state_root to prev_block_hash remove metro integrate submission to sequencer log updates use env vars for chain id/tendermint endpoint rename to cometbft Make the environment variables actually work cleaner simple logging change removed sleep before getPayload by removing goroutine in buildPayload removed unneeded comment removed for loop from buildPayload Remove direct sequencer submission cleanup go.mod Migrate to the v1alpha1 API Missed pieces set genesis block as head/safe/final remove all mentions of metro Initial implementation of Execution v1alpha2 api Integrate updates remove need for consensus api Updates small updates Update grpc/execution/server.go Co-authored-by: noot <36753753+noot@users.noreply.github.com> logging remove unused dependency Mark the chain 'finalized' on startup --- .../astria-build-and-publish-image.yml | 40 + core/txpool/txpool.go | 16 + grpc/README.md | 10 +- grpc/buf.gen.yaml | 22 + .../astria/execution/v1alpha1/execution.pb.go | 510 +++++++++++ .../execution/v1alpha1/execution_grpc.pb.go | 183 ++++ .../astria/execution/v1alpha2/execution.pb.go | 865 ++++++++++++++++++ .../execution/v1alpha2/execution_grpc.pb.go | 273 ++++++ miner/worker.go | 230 +---- node/node.go | 3 + 10 files changed, 1950 insertions(+), 202 deletions(-) create mode 100644 grpc/buf.gen.yaml create mode 100644 grpc/gen/astria/execution/v1alpha1/execution.pb.go create mode 100644 grpc/gen/astria/execution/v1alpha1/execution_grpc.pb.go create mode 100644 grpc/gen/astria/execution/v1alpha2/execution.pb.go create mode 100644 grpc/gen/astria/execution/v1alpha2/execution_grpc.pb.go diff --git a/.github/workflows/astria-build-and-publish-image.yml b/.github/workflows/astria-build-and-publish-image.yml index 648e38ec38..6c11dfdd87 100644 --- a/.github/workflows/astria-build-and-publish-image.yml +++ b/.github/workflows/astria-build-and-publish-image.yml @@ -5,6 +5,7 @@ on: workflow_dispatch: push: branches: +<<<<<<< HEAD - "main" tags: - "v[0-9]+.[0-9]+.[0-9]+" @@ -34,6 +35,31 @@ jobs: with: go-version: "^1.21.x" # The Go version to download (if necessary) and use. - run: go version +======= + - "astria" + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" + # trigger on pull request updates when target is `astria` branch + pull_request: + branches: + - "astria" + +jobs: + build-and-publish-latest: + runs-on: ubuntu-latest + steps: + # Checking out the repo + - uses: actions/checkout@v3 + # Setting up Go + - uses: actions/setup-go@v4 + with: + go-version: "^1.20.x" # The Go version to download (if necessary) and use. + - run: go version + +>>>>>>> 315c87d76 (Feature/grpc execution api (#1)) # https://github.com/docker/setup-qemu-action - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -53,6 +79,7 @@ jobs: uses: docker/metadata-action@v4 with: images: | +<<<<<<< HEAD ghcr.io/astriaorg/astria-geth tags: | type=ref,event=pr @@ -60,6 +87,15 @@ jobs: type=sha # set latest tag for `astria` branch type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} +======= + ghcr.io/astriaorg/go-ethereum + tags: | + type=ref,event=pr + type=semver,pattern={{major}}.{{minor}}.{{patch}} + type=sha + # set latest tag for `astria` branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'astria') }} +>>>>>>> 315c87d76 (Feature/grpc execution api (#1)) - name: Build and push uses: depot/build-push-action@v1 with: @@ -68,7 +104,11 @@ jobs: provenance: false context: . # It takes a long time to build the arm image right now, so we only build it on tags which is what we use for releases, or on merges to the default branch. +<<<<<<< HEAD platforms: ${{ (contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') && 'linux/amd64,linux/arm64' || 'linux/amd64' }} +======= + platforms: ${{ (contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/astria') && 'linux/amd64,linux/arm64' || 'linux/amd64' }} +>>>>>>> 315c87d76 (Feature/grpc execution api (#1)) push: true tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} diff --git a/core/txpool/txpool.go b/core/txpool/txpool.go index 9780a8d5f8..39ffce686f 100644 --- a/core/txpool/txpool.go +++ b/core/txpool/txpool.go @@ -75,6 +75,8 @@ type TxPool struct { term chan struct{} // Termination channel to detect a closed pool sync chan chan error // Testing / simulator channel to block until internal reset is done + + astria *astriaOrdered } // New creates a new transaction pool to gather, sort and filter inbound @@ -521,3 +523,17 @@ func (p *TxPool) Sync() error { return errors.New("pool already terminated") } } + +type astriaOrdered struct { + txs types.Transactions +} + +func newAstriaOrdered(txs types.Transactions) *astriaOrdered { + return &astriaOrdered{ + txs: txs, + } +} + +func (ao *astriaOrdered) clear() { + ao.txs = *&types.Transactions{} +} diff --git a/grpc/README.md b/grpc/README.md index ca97f9933c..804133a8ea 100644 --- a/grpc/README.md +++ b/grpc/README.md @@ -4,18 +4,15 @@ This package provides a gRPC server as an entrypoint to the EVM. ## Build and run from source: -```bash -# install necessary dependencies -brew install leveldb - -# build geth -make geth ``` See [private_network.md](../private_network.md) for running a local geth node. ### Running with remote Docker image: +<<<<<<< HEAD +======= +>>>>>>> 315c87d76 (Feature/grpc execution api (#1)) ```bash docker run --rm \ -p 8545:8545 -p 30303:30303 -p 50051:50051 \ @@ -24,7 +21,6 @@ docker run --rm \ ``` ### Local Docker workflow: - ```bash # build local docker image docker build \ diff --git a/grpc/buf.gen.yaml b/grpc/buf.gen.yaml new file mode 100644 index 0000000000..32ceca95f0 --- /dev/null +++ b/grpc/buf.gen.yaml @@ -0,0 +1,22 @@ +# buf.gen.yaml +version: v1 +managed: + enabled: true + go_package_prefix: + # : name in go.mod + # : where generated code should be output + # default: / + default: github.com/ethereum/go-ethereum/grpc + # Remove `except` field if googleapis is not used + # except: + # - buf.build/googleapis/googleapis +plugins: + - plugin: buf.build/grpc/go + out: gen + opt: + - paths=source_relative + # dependencies + - plugin: buf.build/protocolbuffers/go + out: gen + opt: + - paths=source_relative diff --git a/grpc/gen/astria/execution/v1alpha1/execution.pb.go b/grpc/gen/astria/execution/v1alpha1/execution.pb.go new file mode 100644 index 0000000000..cdd95aa5bf --- /dev/null +++ b/grpc/gen/astria/execution/v1alpha1/execution.pb.go @@ -0,0 +1,510 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: astria/execution/v1alpha1/execution.proto + +package executionv1alpha1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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) +) + +type DoBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PrevBlockHash []byte `protobuf:"bytes,1,opt,name=prev_block_hash,json=prevBlockHash,proto3" json:"prev_block_hash,omitempty"` + Transactions [][]byte `protobuf:"bytes,2,rep,name=transactions,proto3" json:"transactions,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *DoBlockRequest) Reset() { + *x = DoBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoBlockRequest) ProtoMessage() {} + +func (x *DoBlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DoBlockRequest.ProtoReflect.Descriptor instead. +func (*DoBlockRequest) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha1_execution_proto_rawDescGZIP(), []int{0} +} + +func (x *DoBlockRequest) GetPrevBlockHash() []byte { + if x != nil { + return x.PrevBlockHash + } + return nil +} + +func (x *DoBlockRequest) GetTransactions() [][]byte { + if x != nil { + return x.Transactions + } + return nil +} + +func (x *DoBlockRequest) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +type DoBlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` +} + +func (x *DoBlockResponse) Reset() { + *x = DoBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoBlockResponse) ProtoMessage() {} + +func (x *DoBlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DoBlockResponse.ProtoReflect.Descriptor instead. +func (*DoBlockResponse) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha1_execution_proto_rawDescGZIP(), []int{1} +} + +func (x *DoBlockResponse) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +type FinalizeBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` +} + +func (x *FinalizeBlockRequest) Reset() { + *x = FinalizeBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FinalizeBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FinalizeBlockRequest) ProtoMessage() {} + +func (x *FinalizeBlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FinalizeBlockRequest.ProtoReflect.Descriptor instead. +func (*FinalizeBlockRequest) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha1_execution_proto_rawDescGZIP(), []int{2} +} + +func (x *FinalizeBlockRequest) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +type FinalizeBlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FinalizeBlockResponse) Reset() { + *x = FinalizeBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FinalizeBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FinalizeBlockResponse) ProtoMessage() {} + +func (x *FinalizeBlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FinalizeBlockResponse.ProtoReflect.Descriptor instead. +func (*FinalizeBlockResponse) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha1_execution_proto_rawDescGZIP(), []int{3} +} + +type InitStateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *InitStateRequest) Reset() { + *x = InitStateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitStateRequest) ProtoMessage() {} + +func (x *InitStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitStateRequest.ProtoReflect.Descriptor instead. +func (*InitStateRequest) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha1_execution_proto_rawDescGZIP(), []int{4} +} + +type InitStateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockHash []byte `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` +} + +func (x *InitStateResponse) Reset() { + *x = InitStateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InitStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitStateResponse) ProtoMessage() {} + +func (x *InitStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha1_execution_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitStateResponse.ProtoReflect.Descriptor instead. +func (*InitStateResponse) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha1_execution_proto_rawDescGZIP(), []int{5} +} + +func (x *InitStateResponse) GetBlockHash() []byte { + if x != nil { + return x.BlockHash + } + return nil +} + +var File_astria_execution_v1alpha1_execution_proto protoreflect.FileDescriptor + +var file_astria_execution_v1alpha1_execution_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x61, 0x73, 0x74, + 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96, 0x01, 0x0a, 0x0e, 0x44, 0x6f, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x72, + 0x65, 0x76, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x76, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x22, 0x30, 0x0a, 0x0f, 0x44, 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x22, 0x35, 0x0a, 0x14, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0x17, 0x0a, 0x15, 0x46, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x32, 0x0a, 0x11, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x32, 0xd0, 0x02, 0x0a, 0x10, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x66, 0x0a, 0x09, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2b, 0x2e, 0x61, + 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x61, 0x73, 0x74, 0x72, + 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x07, 0x44, 0x6f, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x29, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, + 0x6f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, + 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x0d, 0x46, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2f, 0x2e, 0x61, 0x73, 0x74, + 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x61, 0x73, + 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x87, 0x02, + 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, + 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2f, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x3b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x45, 0x58, 0xaa, 0x02, 0x19, 0x41, 0x73, 0x74, 0x72, + 0x69, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x19, 0x41, 0x73, 0x74, 0x72, 0x69, 0x61, 0x5c, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0xe2, 0x02, 0x25, 0x41, 0x73, 0x74, 0x72, 0x69, 0x61, 0x5c, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x41, 0x73, 0x74, 0x72, + 0x69, 0x61, 0x3a, 0x3a, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_astria_execution_v1alpha1_execution_proto_rawDescOnce sync.Once + file_astria_execution_v1alpha1_execution_proto_rawDescData = file_astria_execution_v1alpha1_execution_proto_rawDesc +) + +func file_astria_execution_v1alpha1_execution_proto_rawDescGZIP() []byte { + file_astria_execution_v1alpha1_execution_proto_rawDescOnce.Do(func() { + file_astria_execution_v1alpha1_execution_proto_rawDescData = protoimpl.X.CompressGZIP(file_astria_execution_v1alpha1_execution_proto_rawDescData) + }) + return file_astria_execution_v1alpha1_execution_proto_rawDescData +} + +var file_astria_execution_v1alpha1_execution_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_astria_execution_v1alpha1_execution_proto_goTypes = []interface{}{ + (*DoBlockRequest)(nil), // 0: astria.execution.v1alpha1.DoBlockRequest + (*DoBlockResponse)(nil), // 1: astria.execution.v1alpha1.DoBlockResponse + (*FinalizeBlockRequest)(nil), // 2: astria.execution.v1alpha1.FinalizeBlockRequest + (*FinalizeBlockResponse)(nil), // 3: astria.execution.v1alpha1.FinalizeBlockResponse + (*InitStateRequest)(nil), // 4: astria.execution.v1alpha1.InitStateRequest + (*InitStateResponse)(nil), // 5: astria.execution.v1alpha1.InitStateResponse + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_astria_execution_v1alpha1_execution_proto_depIdxs = []int32{ + 6, // 0: astria.execution.v1alpha1.DoBlockRequest.timestamp:type_name -> google.protobuf.Timestamp + 4, // 1: astria.execution.v1alpha1.ExecutionService.InitState:input_type -> astria.execution.v1alpha1.InitStateRequest + 0, // 2: astria.execution.v1alpha1.ExecutionService.DoBlock:input_type -> astria.execution.v1alpha1.DoBlockRequest + 2, // 3: astria.execution.v1alpha1.ExecutionService.FinalizeBlock:input_type -> astria.execution.v1alpha1.FinalizeBlockRequest + 5, // 4: astria.execution.v1alpha1.ExecutionService.InitState:output_type -> astria.execution.v1alpha1.InitStateResponse + 1, // 5: astria.execution.v1alpha1.ExecutionService.DoBlock:output_type -> astria.execution.v1alpha1.DoBlockResponse + 3, // 6: astria.execution.v1alpha1.ExecutionService.FinalizeBlock:output_type -> astria.execution.v1alpha1.FinalizeBlockResponse + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_astria_execution_v1alpha1_execution_proto_init() } +func file_astria_execution_v1alpha1_execution_proto_init() { + if File_astria_execution_v1alpha1_execution_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_astria_execution_v1alpha1_execution_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha1_execution_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha1_execution_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FinalizeBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha1_execution_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FinalizeBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha1_execution_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitStateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha1_execution_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InitStateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_astria_execution_v1alpha1_execution_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_astria_execution_v1alpha1_execution_proto_goTypes, + DependencyIndexes: file_astria_execution_v1alpha1_execution_proto_depIdxs, + MessageInfos: file_astria_execution_v1alpha1_execution_proto_msgTypes, + }.Build() + File_astria_execution_v1alpha1_execution_proto = out.File + file_astria_execution_v1alpha1_execution_proto_rawDesc = nil + file_astria_execution_v1alpha1_execution_proto_goTypes = nil + file_astria_execution_v1alpha1_execution_proto_depIdxs = nil +} diff --git a/grpc/gen/astria/execution/v1alpha1/execution_grpc.pb.go b/grpc/gen/astria/execution/v1alpha1/execution_grpc.pb.go new file mode 100644 index 0000000000..7412181b22 --- /dev/null +++ b/grpc/gen/astria/execution/v1alpha1/execution_grpc.pb.go @@ -0,0 +1,183 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: astria/execution/v1alpha1/execution.proto + +package executionv1alpha1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ExecutionService_InitState_FullMethodName = "/astria.execution.v1alpha1.ExecutionService/InitState" + ExecutionService_DoBlock_FullMethodName = "/astria.execution.v1alpha1.ExecutionService/DoBlock" + ExecutionService_FinalizeBlock_FullMethodName = "/astria.execution.v1alpha1.ExecutionService/FinalizeBlock" +) + +// ExecutionServiceClient is the client API for ExecutionService service. +// +// 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 ExecutionServiceClient interface { + InitState(ctx context.Context, in *InitStateRequest, opts ...grpc.CallOption) (*InitStateResponse, error) + DoBlock(ctx context.Context, in *DoBlockRequest, opts ...grpc.CallOption) (*DoBlockResponse, error) + FinalizeBlock(ctx context.Context, in *FinalizeBlockRequest, opts ...grpc.CallOption) (*FinalizeBlockResponse, error) +} + +type executionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewExecutionServiceClient(cc grpc.ClientConnInterface) ExecutionServiceClient { + return &executionServiceClient{cc} +} + +func (c *executionServiceClient) InitState(ctx context.Context, in *InitStateRequest, opts ...grpc.CallOption) (*InitStateResponse, error) { + out := new(InitStateResponse) + err := c.cc.Invoke(ctx, ExecutionService_InitState_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionServiceClient) DoBlock(ctx context.Context, in *DoBlockRequest, opts ...grpc.CallOption) (*DoBlockResponse, error) { + out := new(DoBlockResponse) + err := c.cc.Invoke(ctx, ExecutionService_DoBlock_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionServiceClient) FinalizeBlock(ctx context.Context, in *FinalizeBlockRequest, opts ...grpc.CallOption) (*FinalizeBlockResponse, error) { + out := new(FinalizeBlockResponse) + err := c.cc.Invoke(ctx, ExecutionService_FinalizeBlock_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ExecutionServiceServer is the server API for ExecutionService service. +// All implementations must embed UnimplementedExecutionServiceServer +// for forward compatibility +type ExecutionServiceServer interface { + InitState(context.Context, *InitStateRequest) (*InitStateResponse, error) + DoBlock(context.Context, *DoBlockRequest) (*DoBlockResponse, error) + FinalizeBlock(context.Context, *FinalizeBlockRequest) (*FinalizeBlockResponse, error) + mustEmbedUnimplementedExecutionServiceServer() +} + +// UnimplementedExecutionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedExecutionServiceServer struct { +} + +func (UnimplementedExecutionServiceServer) InitState(context.Context, *InitStateRequest) (*InitStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitState not implemented") +} +func (UnimplementedExecutionServiceServer) DoBlock(context.Context, *DoBlockRequest) (*DoBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DoBlock not implemented") +} +func (UnimplementedExecutionServiceServer) FinalizeBlock(context.Context, *FinalizeBlockRequest) (*FinalizeBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FinalizeBlock not implemented") +} +func (UnimplementedExecutionServiceServer) mustEmbedUnimplementedExecutionServiceServer() {} + +// UnsafeExecutionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ExecutionServiceServer will +// result in compilation errors. +type UnsafeExecutionServiceServer interface { + mustEmbedUnimplementedExecutionServiceServer() +} + +func RegisterExecutionServiceServer(s grpc.ServiceRegistrar, srv ExecutionServiceServer) { + s.RegisterService(&ExecutionService_ServiceDesc, srv) +} + +func _ExecutionService_InitState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServiceServer).InitState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExecutionService_InitState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServiceServer).InitState(ctx, req.(*InitStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExecutionService_DoBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DoBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServiceServer).DoBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExecutionService_DoBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServiceServer).DoBlock(ctx, req.(*DoBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExecutionService_FinalizeBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FinalizeBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServiceServer).FinalizeBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExecutionService_FinalizeBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServiceServer).FinalizeBlock(ctx, req.(*FinalizeBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ExecutionService_ServiceDesc is the grpc.ServiceDesc for ExecutionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ExecutionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "astria.execution.v1alpha1.ExecutionService", + HandlerType: (*ExecutionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "InitState", + Handler: _ExecutionService_InitState_Handler, + }, + { + MethodName: "DoBlock", + Handler: _ExecutionService_DoBlock_Handler, + }, + { + MethodName: "FinalizeBlock", + Handler: _ExecutionService_FinalizeBlock_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "astria/execution/v1alpha1/execution.proto", +} diff --git a/grpc/gen/astria/execution/v1alpha2/execution.pb.go b/grpc/gen/astria/execution/v1alpha2/execution.pb.go new file mode 100644 index 0000000000..e62d75737f --- /dev/null +++ b/grpc/gen/astria/execution/v1alpha2/execution.pb.go @@ -0,0 +1,865 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: astria/execution/v1alpha2/execution.proto + +package executionv1alpha2 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 set of information which deterministic driver of block production +// must know about a given rollup Block +type Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The block number + Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + // The hash of the block + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` + // The hash from the parent block + ParentBlockHash []byte `protobuf:"bytes,3,opt,name=parent_block_hash,json=parentBlockHash,proto3" json:"parent_block_hash,omitempty"` + // Timestamp on the block, standardized to google protobuf standard. + Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *Block) Reset() { + *x = Block{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha2_execution_proto_rawDescGZIP(), []int{0} +} + +func (x *Block) GetNumber() uint32 { + if x != nil { + return x.Number + } + return 0 +} + +func (x *Block) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (x *Block) GetParentBlockHash() []byte { + if x != nil { + return x.ParentBlockHash + } + return nil +} + +func (x *Block) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +// Fields which are indexed for finding blocks on a blockchain. +type BlockIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Identifier: + // + // *BlockIdentifier_BlockNumber + // *BlockIdentifier_BlockHash + Identifier isBlockIdentifier_Identifier `protobuf_oneof:"identifier"` +} + +func (x *BlockIdentifier) Reset() { + *x = BlockIdentifier{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockIdentifier) ProtoMessage() {} + +func (x *BlockIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockIdentifier.ProtoReflect.Descriptor instead. +func (*BlockIdentifier) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha2_execution_proto_rawDescGZIP(), []int{1} +} + +func (m *BlockIdentifier) GetIdentifier() isBlockIdentifier_Identifier { + if m != nil { + return m.Identifier + } + return nil +} + +func (x *BlockIdentifier) GetBlockNumber() uint32 { + if x, ok := x.GetIdentifier().(*BlockIdentifier_BlockNumber); ok { + return x.BlockNumber + } + return 0 +} + +func (x *BlockIdentifier) GetBlockHash() []byte { + if x, ok := x.GetIdentifier().(*BlockIdentifier_BlockHash); ok { + return x.BlockHash + } + return nil +} + +type isBlockIdentifier_Identifier interface { + isBlockIdentifier_Identifier() +} + +type BlockIdentifier_BlockNumber struct { + BlockNumber uint32 `protobuf:"varint,1,opt,name=block_number,json=blockNumber,proto3,oneof"` +} + +type BlockIdentifier_BlockHash struct { + BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3,oneof"` +} + +func (*BlockIdentifier_BlockNumber) isBlockIdentifier_Identifier() {} + +func (*BlockIdentifier_BlockHash) isBlockIdentifier_Identifier() {} + +// Used in GetBlock to find a single block. +type GetBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier *BlockIdentifier `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` +} + +func (x *GetBlockRequest) Reset() { + *x = GetBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockRequest) ProtoMessage() {} + +func (x *GetBlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBlockRequest.ProtoReflect.Descriptor instead. +func (*GetBlockRequest) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha2_execution_proto_rawDescGZIP(), []int{2} +} + +func (x *GetBlockRequest) GetIdentifier() *BlockIdentifier { + if x != nil { + return x.Identifier + } + return nil +} + +// Used in BatchGetBlocks, will find all or none based on the list of +// identifiers. +type BatchGetBlocksRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifiers []*BlockIdentifier `protobuf:"bytes,1,rep,name=identifiers,proto3" json:"identifiers,omitempty"` +} + +func (x *BatchGetBlocksRequest) Reset() { + *x = BatchGetBlocksRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchGetBlocksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchGetBlocksRequest) ProtoMessage() {} + +func (x *BatchGetBlocksRequest) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchGetBlocksRequest.ProtoReflect.Descriptor instead. +func (*BatchGetBlocksRequest) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha2_execution_proto_rawDescGZIP(), []int{3} +} + +func (x *BatchGetBlocksRequest) GetIdentifiers() []*BlockIdentifier { + if x != nil { + return x.Identifiers + } + return nil +} + +// The list of blocks in response to BatchGetBlocks. +type BatchGetBlocksResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blocks []*Block `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` +} + +func (x *BatchGetBlocksResponse) Reset() { + *x = BatchGetBlocksResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchGetBlocksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchGetBlocksResponse) ProtoMessage() {} + +func (x *BatchGetBlocksResponse) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchGetBlocksResponse.ProtoReflect.Descriptor instead. +func (*BatchGetBlocksResponse) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha2_execution_proto_rawDescGZIP(), []int{4} +} + +func (x *BatchGetBlocksResponse) GetBlocks() []*Block { + if x != nil { + return x.Blocks + } + return nil +} + +// ExecuteBlockRequest contains all the information needed to create a new rollup +// block. +// +// This information comes from previous rollup blocks, as well as from sequencer +// blocks. +type ExecuteBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The hash of previous block, which new block will be created on top of. + PrevBlockHash []byte `protobuf:"bytes,1,opt,name=prev_block_hash,json=prevBlockHash,proto3" json:"prev_block_hash,omitempty"` + // List of transactions to include in the new block. + Transactions [][]byte `protobuf:"bytes,2,rep,name=transactions,proto3" json:"transactions,omitempty"` + // Timestamp to be used for new block. + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *ExecuteBlockRequest) Reset() { + *x = ExecuteBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExecuteBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecuteBlockRequest) ProtoMessage() {} + +func (x *ExecuteBlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecuteBlockRequest.ProtoReflect.Descriptor instead. +func (*ExecuteBlockRequest) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha2_execution_proto_rawDescGZIP(), []int{5} +} + +func (x *ExecuteBlockRequest) GetPrevBlockHash() []byte { + if x != nil { + return x.PrevBlockHash + } + return nil +} + +func (x *ExecuteBlockRequest) GetTransactions() [][]byte { + if x != nil { + return x.Transactions + } + return nil +} + +func (x *ExecuteBlockRequest) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +// The CommitmentState holds the block at each stage of sequencer commitment +// level +// +// A Valid CommitmentState: +// - Block numbers are such that soft >= firm. +// - No blocks ever decrease in block number. +// - The chain defined by soft is the head of the canonical chain the firm block +// must belong to. +type CommitmentState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Soft commitment is the rollup block matching latest sequencer block. + Soft *Block `protobuf:"bytes,1,opt,name=soft,proto3" json:"soft,omitempty"` + // Firm commitment is achieved when data has been seen in DA. + Firm *Block `protobuf:"bytes,2,opt,name=firm,proto3" json:"firm,omitempty"` +} + +func (x *CommitmentState) Reset() { + *x = CommitmentState{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommitmentState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitmentState) ProtoMessage() {} + +func (x *CommitmentState) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitmentState.ProtoReflect.Descriptor instead. +func (*CommitmentState) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha2_execution_proto_rawDescGZIP(), []int{6} +} + +func (x *CommitmentState) GetSoft() *Block { + if x != nil { + return x.Soft + } + return nil +} + +func (x *CommitmentState) GetFirm() *Block { + if x != nil { + return x.Firm + } + return nil +} + +// There is only one CommitmentState object, so the request is empty. +type GetCommitmentStateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetCommitmentStateRequest) Reset() { + *x = GetCommitmentStateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCommitmentStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCommitmentStateRequest) ProtoMessage() {} + +func (x *GetCommitmentStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCommitmentStateRequest.ProtoReflect.Descriptor instead. +func (*GetCommitmentStateRequest) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha2_execution_proto_rawDescGZIP(), []int{7} +} + +// The CommitmentState to set, must include complete state. +type UpdateCommitmentStateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommitmentState *CommitmentState `protobuf:"bytes,1,opt,name=commitment_state,json=commitmentState,proto3" json:"commitment_state,omitempty"` +} + +func (x *UpdateCommitmentStateRequest) Reset() { + *x = UpdateCommitmentStateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateCommitmentStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCommitmentStateRequest) ProtoMessage() {} + +func (x *UpdateCommitmentStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_astria_execution_v1alpha2_execution_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateCommitmentStateRequest.ProtoReflect.Descriptor instead. +func (*UpdateCommitmentStateRequest) Descriptor() ([]byte, []int) { + return file_astria_execution_v1alpha2_execution_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateCommitmentStateRequest) GetCommitmentState() *CommitmentState { + if x != nil { + return x.CommitmentState + } + return nil +} + +var File_astria_execution_v1alpha2_execution_proto protoreflect.FileDescriptor + +var file_astria_execution_v1alpha2_execution_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x61, 0x73, 0x74, + 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x99, 0x01, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, + 0x11, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x22, 0x65, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, + 0x00, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x42, 0x0c, 0x0a, 0x0a, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x5d, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a, + 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0a, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x65, 0x0a, 0x15, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x32, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, + 0x22, 0x52, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x73, 0x74, + 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x13, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, + 0x70, 0x72, 0x65, 0x76, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x76, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x22, 0x7d, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x73, 0x6f, 0x66, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x04, 0x73, 0x6f, 0x66, 0x74, 0x12, 0x34, 0x0a, 0x04, 0x66, + 0x69, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x73, 0x74, 0x72, + 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x04, 0x66, 0x69, 0x72, + 0x6d, 0x22, 0x1b, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x75, + 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x55, + 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, + 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x32, 0xbb, 0x04, 0x0a, 0x10, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x08, 0x47, 0x65, + 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2a, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x75, 0x0a, 0x0e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x30, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, + 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x32, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, + 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x32, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0c, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2e, 0x2e, 0x61, 0x73, + 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x73, + 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x76, 0x0a, + 0x12, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x34, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x61, 0x73, 0x74, 0x72, + 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x7c, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x37, + 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x61, 0x73, 0x74, 0x72, 0x69, 0x61, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x42, 0x87, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x73, 0x74, 0x72, + 0x69, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x32, 0x42, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x73, + 0x74, 0x72, 0x69, 0x61, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x3b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0xa2, 0x02, 0x03, 0x41, 0x45, 0x58, 0xaa, + 0x02, 0x19, 0x41, 0x73, 0x74, 0x72, 0x69, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0xca, 0x02, 0x19, 0x41, 0x73, + 0x74, 0x72, 0x69, 0x61, 0x5c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0xe2, 0x02, 0x25, 0x41, 0x73, 0x74, 0x72, 0x69, 0x61, + 0x5c, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x1b, 0x41, 0x73, 0x74, 0x72, 0x69, 0x61, 0x3a, 0x3a, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x32, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_astria_execution_v1alpha2_execution_proto_rawDescOnce sync.Once + file_astria_execution_v1alpha2_execution_proto_rawDescData = file_astria_execution_v1alpha2_execution_proto_rawDesc +) + +func file_astria_execution_v1alpha2_execution_proto_rawDescGZIP() []byte { + file_astria_execution_v1alpha2_execution_proto_rawDescOnce.Do(func() { + file_astria_execution_v1alpha2_execution_proto_rawDescData = protoimpl.X.CompressGZIP(file_astria_execution_v1alpha2_execution_proto_rawDescData) + }) + return file_astria_execution_v1alpha2_execution_proto_rawDescData +} + +var file_astria_execution_v1alpha2_execution_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_astria_execution_v1alpha2_execution_proto_goTypes = []interface{}{ + (*Block)(nil), // 0: astria.execution.v1alpha2.Block + (*BlockIdentifier)(nil), // 1: astria.execution.v1alpha2.BlockIdentifier + (*GetBlockRequest)(nil), // 2: astria.execution.v1alpha2.GetBlockRequest + (*BatchGetBlocksRequest)(nil), // 3: astria.execution.v1alpha2.BatchGetBlocksRequest + (*BatchGetBlocksResponse)(nil), // 4: astria.execution.v1alpha2.BatchGetBlocksResponse + (*ExecuteBlockRequest)(nil), // 5: astria.execution.v1alpha2.ExecuteBlockRequest + (*CommitmentState)(nil), // 6: astria.execution.v1alpha2.CommitmentState + (*GetCommitmentStateRequest)(nil), // 7: astria.execution.v1alpha2.GetCommitmentStateRequest + (*UpdateCommitmentStateRequest)(nil), // 8: astria.execution.v1alpha2.UpdateCommitmentStateRequest + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp +} +var file_astria_execution_v1alpha2_execution_proto_depIdxs = []int32{ + 9, // 0: astria.execution.v1alpha2.Block.timestamp:type_name -> google.protobuf.Timestamp + 1, // 1: astria.execution.v1alpha2.GetBlockRequest.identifier:type_name -> astria.execution.v1alpha2.BlockIdentifier + 1, // 2: astria.execution.v1alpha2.BatchGetBlocksRequest.identifiers:type_name -> astria.execution.v1alpha2.BlockIdentifier + 0, // 3: astria.execution.v1alpha2.BatchGetBlocksResponse.blocks:type_name -> astria.execution.v1alpha2.Block + 9, // 4: astria.execution.v1alpha2.ExecuteBlockRequest.timestamp:type_name -> google.protobuf.Timestamp + 0, // 5: astria.execution.v1alpha2.CommitmentState.soft:type_name -> astria.execution.v1alpha2.Block + 0, // 6: astria.execution.v1alpha2.CommitmentState.firm:type_name -> astria.execution.v1alpha2.Block + 6, // 7: astria.execution.v1alpha2.UpdateCommitmentStateRequest.commitment_state:type_name -> astria.execution.v1alpha2.CommitmentState + 2, // 8: astria.execution.v1alpha2.ExecutionService.GetBlock:input_type -> astria.execution.v1alpha2.GetBlockRequest + 3, // 9: astria.execution.v1alpha2.ExecutionService.BatchGetBlocks:input_type -> astria.execution.v1alpha2.BatchGetBlocksRequest + 5, // 10: astria.execution.v1alpha2.ExecutionService.ExecuteBlock:input_type -> astria.execution.v1alpha2.ExecuteBlockRequest + 7, // 11: astria.execution.v1alpha2.ExecutionService.GetCommitmentState:input_type -> astria.execution.v1alpha2.GetCommitmentStateRequest + 8, // 12: astria.execution.v1alpha2.ExecutionService.UpdateCommitmentState:input_type -> astria.execution.v1alpha2.UpdateCommitmentStateRequest + 0, // 13: astria.execution.v1alpha2.ExecutionService.GetBlock:output_type -> astria.execution.v1alpha2.Block + 4, // 14: astria.execution.v1alpha2.ExecutionService.BatchGetBlocks:output_type -> astria.execution.v1alpha2.BatchGetBlocksResponse + 0, // 15: astria.execution.v1alpha2.ExecutionService.ExecuteBlock:output_type -> astria.execution.v1alpha2.Block + 6, // 16: astria.execution.v1alpha2.ExecutionService.GetCommitmentState:output_type -> astria.execution.v1alpha2.CommitmentState + 6, // 17: astria.execution.v1alpha2.ExecutionService.UpdateCommitmentState:output_type -> astria.execution.v1alpha2.CommitmentState + 13, // [13:18] is the sub-list for method output_type + 8, // [8:13] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_astria_execution_v1alpha2_execution_proto_init() } +func file_astria_execution_v1alpha2_execution_proto_init() { + if File_astria_execution_v1alpha2_execution_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_astria_execution_v1alpha2_execution_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Block); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha2_execution_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockIdentifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha2_execution_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha2_execution_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchGetBlocksRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha2_execution_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchGetBlocksResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha2_execution_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExecuteBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha2_execution_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitmentState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha2_execution_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCommitmentStateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_astria_execution_v1alpha2_execution_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCommitmentStateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_astria_execution_v1alpha2_execution_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*BlockIdentifier_BlockNumber)(nil), + (*BlockIdentifier_BlockHash)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_astria_execution_v1alpha2_execution_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_astria_execution_v1alpha2_execution_proto_goTypes, + DependencyIndexes: file_astria_execution_v1alpha2_execution_proto_depIdxs, + MessageInfos: file_astria_execution_v1alpha2_execution_proto_msgTypes, + }.Build() + File_astria_execution_v1alpha2_execution_proto = out.File + file_astria_execution_v1alpha2_execution_proto_rawDesc = nil + file_astria_execution_v1alpha2_execution_proto_goTypes = nil + file_astria_execution_v1alpha2_execution_proto_depIdxs = nil +} diff --git a/grpc/gen/astria/execution/v1alpha2/execution_grpc.pb.go b/grpc/gen/astria/execution/v1alpha2/execution_grpc.pb.go new file mode 100644 index 0000000000..905f0779b0 --- /dev/null +++ b/grpc/gen/astria/execution/v1alpha2/execution_grpc.pb.go @@ -0,0 +1,273 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: astria/execution/v1alpha2/execution.proto + +package executionv1alpha2 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ExecutionService_GetBlock_FullMethodName = "/astria.execution.v1alpha2.ExecutionService/GetBlock" + ExecutionService_BatchGetBlocks_FullMethodName = "/astria.execution.v1alpha2.ExecutionService/BatchGetBlocks" + ExecutionService_ExecuteBlock_FullMethodName = "/astria.execution.v1alpha2.ExecutionService/ExecuteBlock" + ExecutionService_GetCommitmentState_FullMethodName = "/astria.execution.v1alpha2.ExecutionService/GetCommitmentState" + ExecutionService_UpdateCommitmentState_FullMethodName = "/astria.execution.v1alpha2.ExecutionService/UpdateCommitmentState" +) + +// ExecutionServiceClient is the client API for ExecutionService service. +// +// 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 ExecutionServiceClient interface { + // GetBlock will return a block given an identifier. + GetBlock(ctx context.Context, in *GetBlockRequest, opts ...grpc.CallOption) (*Block, error) + // BatchGetBlocks will return an array of Blocks given an array of block + // identifiers. + BatchGetBlocks(ctx context.Context, in *BatchGetBlocksRequest, opts ...grpc.CallOption) (*BatchGetBlocksResponse, error) + // ExecuteBlock is called to deterministically derive a rollup block from + // filtered sequencer block information. + ExecuteBlock(ctx context.Context, in *ExecuteBlockRequest, opts ...grpc.CallOption) (*Block, error) + // GetCommitmentState fetches the current CommitmentState of the chain. + GetCommitmentState(ctx context.Context, in *GetCommitmentStateRequest, opts ...grpc.CallOption) (*CommitmentState, error) + // UpdateCommitmentState replaces the whole CommitmentState with a new + // CommitmentState. + UpdateCommitmentState(ctx context.Context, in *UpdateCommitmentStateRequest, opts ...grpc.CallOption) (*CommitmentState, error) +} + +type executionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewExecutionServiceClient(cc grpc.ClientConnInterface) ExecutionServiceClient { + return &executionServiceClient{cc} +} + +func (c *executionServiceClient) GetBlock(ctx context.Context, in *GetBlockRequest, opts ...grpc.CallOption) (*Block, error) { + out := new(Block) + err := c.cc.Invoke(ctx, ExecutionService_GetBlock_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionServiceClient) BatchGetBlocks(ctx context.Context, in *BatchGetBlocksRequest, opts ...grpc.CallOption) (*BatchGetBlocksResponse, error) { + out := new(BatchGetBlocksResponse) + err := c.cc.Invoke(ctx, ExecutionService_BatchGetBlocks_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionServiceClient) ExecuteBlock(ctx context.Context, in *ExecuteBlockRequest, opts ...grpc.CallOption) (*Block, error) { + out := new(Block) + err := c.cc.Invoke(ctx, ExecutionService_ExecuteBlock_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionServiceClient) GetCommitmentState(ctx context.Context, in *GetCommitmentStateRequest, opts ...grpc.CallOption) (*CommitmentState, error) { + out := new(CommitmentState) + err := c.cc.Invoke(ctx, ExecutionService_GetCommitmentState_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *executionServiceClient) UpdateCommitmentState(ctx context.Context, in *UpdateCommitmentStateRequest, opts ...grpc.CallOption) (*CommitmentState, error) { + out := new(CommitmentState) + err := c.cc.Invoke(ctx, ExecutionService_UpdateCommitmentState_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ExecutionServiceServer is the server API for ExecutionService service. +// All implementations must embed UnimplementedExecutionServiceServer +// for forward compatibility +type ExecutionServiceServer interface { + // GetBlock will return a block given an identifier. + GetBlock(context.Context, *GetBlockRequest) (*Block, error) + // BatchGetBlocks will return an array of Blocks given an array of block + // identifiers. + BatchGetBlocks(context.Context, *BatchGetBlocksRequest) (*BatchGetBlocksResponse, error) + // ExecuteBlock is called to deterministically derive a rollup block from + // filtered sequencer block information. + ExecuteBlock(context.Context, *ExecuteBlockRequest) (*Block, error) + // GetCommitmentState fetches the current CommitmentState of the chain. + GetCommitmentState(context.Context, *GetCommitmentStateRequest) (*CommitmentState, error) + // UpdateCommitmentState replaces the whole CommitmentState with a new + // CommitmentState. + UpdateCommitmentState(context.Context, *UpdateCommitmentStateRequest) (*CommitmentState, error) + mustEmbedUnimplementedExecutionServiceServer() +} + +// UnimplementedExecutionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedExecutionServiceServer struct { +} + +func (UnimplementedExecutionServiceServer) GetBlock(context.Context, *GetBlockRequest) (*Block, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlock not implemented") +} +func (UnimplementedExecutionServiceServer) BatchGetBlocks(context.Context, *BatchGetBlocksRequest) (*BatchGetBlocksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BatchGetBlocks not implemented") +} +func (UnimplementedExecutionServiceServer) ExecuteBlock(context.Context, *ExecuteBlockRequest) (*Block, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteBlock not implemented") +} +func (UnimplementedExecutionServiceServer) GetCommitmentState(context.Context, *GetCommitmentStateRequest) (*CommitmentState, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCommitmentState not implemented") +} +func (UnimplementedExecutionServiceServer) UpdateCommitmentState(context.Context, *UpdateCommitmentStateRequest) (*CommitmentState, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCommitmentState not implemented") +} +func (UnimplementedExecutionServiceServer) mustEmbedUnimplementedExecutionServiceServer() {} + +// UnsafeExecutionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ExecutionServiceServer will +// result in compilation errors. +type UnsafeExecutionServiceServer interface { + mustEmbedUnimplementedExecutionServiceServer() +} + +func RegisterExecutionServiceServer(s grpc.ServiceRegistrar, srv ExecutionServiceServer) { + s.RegisterService(&ExecutionService_ServiceDesc, srv) +} + +func _ExecutionService_GetBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServiceServer).GetBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExecutionService_GetBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServiceServer).GetBlock(ctx, req.(*GetBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExecutionService_BatchGetBlocks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchGetBlocksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServiceServer).BatchGetBlocks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExecutionService_BatchGetBlocks_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServiceServer).BatchGetBlocks(ctx, req.(*BatchGetBlocksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExecutionService_ExecuteBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExecuteBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServiceServer).ExecuteBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExecutionService_ExecuteBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServiceServer).ExecuteBlock(ctx, req.(*ExecuteBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExecutionService_GetCommitmentState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCommitmentStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServiceServer).GetCommitmentState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExecutionService_GetCommitmentState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServiceServer).GetCommitmentState(ctx, req.(*GetCommitmentStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExecutionService_UpdateCommitmentState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateCommitmentStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExecutionServiceServer).UpdateCommitmentState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ExecutionService_UpdateCommitmentState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExecutionServiceServer).UpdateCommitmentState(ctx, req.(*UpdateCommitmentStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ExecutionService_ServiceDesc is the grpc.ServiceDesc for ExecutionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ExecutionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "astria.execution.v1alpha2.ExecutionService", + HandlerType: (*ExecutionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetBlock", + Handler: _ExecutionService_GetBlock_Handler, + }, + { + MethodName: "BatchGetBlocks", + Handler: _ExecutionService_BatchGetBlocks_Handler, + }, + { + MethodName: "ExecuteBlock", + Handler: _ExecutionService_ExecuteBlock_Handler, + }, + { + MethodName: "GetCommitmentState", + Handler: _ExecutionService_GetCommitmentState_Handler, + }, + { + MethodName: "UpdateCommitmentState", + Handler: _ExecutionService_UpdateCommitmentState_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "astria/execution/v1alpha2/execution.proto", +} diff --git a/miner/worker.go b/miner/worker.go index 629b5970a7..9540413692 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -28,12 +28,10 @@ import ( "github.com/ethereum/go-ethereum/consensus/misc/eip4844" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/txpool" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - "github.com/holiman/uint256" ) var ( @@ -75,50 +73,6 @@ type newPayloadResult struct { receipts []*types.Receipt // Receipts collected during construction } -// generateParams wraps various settings for generating sealing task. -type generateParams struct { - timestamp uint64 // The timestamp for sealing task - forceTime bool // Flag whether the given timestamp is immutable or not - parentHash common.Hash // Parent block hash, empty means the latest chain head - coinbase common.Address // The fee recipient address for including transaction - random common.Hash // The randomness generated by beacon chain, empty before the merge - withdrawals types.Withdrawals // List of withdrawals to include in block (shanghai field) - beaconRoot *common.Hash // The beacon root (cancun field). - noTxs bool // Flag whether an empty block without any transaction is expected -} - -// generateWork generates a sealing block based on the given parameters. -func (miner *Miner) generateWork(params *generateParams) *newPayloadResult { - work, err := miner.prepareWork(params) - if err != nil { - return &newPayloadResult{err: err} - } - if !params.noTxs { - interrupt := new(atomic.Int32) - timer := time.AfterFunc(miner.config.Recommit, func() { - interrupt.Store(commitInterruptTimeout) - }) - defer timer.Stop() - - err := miner.fillTransactions(interrupt, work) - if errors.Is(err, errBlockInterruptedByTimeout) { - log.Warn("Block building is interrupted", "allowance", common.PrettyDuration(miner.config.Recommit)) - } - } - body := types.Body{Transactions: work.txs, Withdrawals: params.withdrawals} - block, err := miner.engine.FinalizeAndAssemble(miner.chain, work.header, work.state, &body, work.receipts) - if err != nil { - return &newPayloadResult{err: err} - } - return &newPayloadResult{ - block: block, - fees: totalFees(block, work.receipts), - sidecars: work.sidecars, - stateDB: work.state, - receipts: work.receipts, - } -} - // prepareWork constructs the sealing task according to the given parameters, // either based on the last chain head or specified parent. In this function // the pending transactions are not filled yet, only the empty task returned. @@ -344,106 +298,6 @@ func (miner *Miner) commitAstriaTransactions(env *environment, txs *types.Transa return nil } -func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *transactionsByPriceAndNonce, interrupt *atomic.Int32) error { - gasLimit := env.header.GasLimit - if env.gasPool == nil { - env.gasPool = new(core.GasPool).AddGas(gasLimit) - } - for { - // Check interruption signal and abort building if it's fired. - if interrupt != nil { - if signal := interrupt.Load(); signal != commitInterruptNone { - return signalToErr(signal) - } - } - // If we don't have enough gas for any further transactions then we're done. - if env.gasPool.Gas() < params.TxGas { - log.Trace("Not enough gas for further transactions", "have", env.gasPool, "want", params.TxGas) - break - } - // If we don't have enough blob space for any further blob transactions, - // skip that list altogether - if !blobTxs.Empty() && env.blobs*params.BlobTxBlobGasPerBlob >= params.MaxBlobGasPerBlock { - log.Trace("Not enough blob space for further blob transactions") - blobTxs.Clear() - // Fall though to pick up any plain txs - } - // Retrieve the next transaction and abort if all done. - var ( - ltx *txpool.LazyTransaction - txs *transactionsByPriceAndNonce - ) - pltx, ptip := plainTxs.Peek() - bltx, btip := blobTxs.Peek() - - switch { - case pltx == nil: - txs, ltx = blobTxs, bltx - case bltx == nil: - txs, ltx = plainTxs, pltx - default: - if ptip.Lt(btip) { - txs, ltx = blobTxs, bltx - } else { - txs, ltx = plainTxs, pltx - } - } - if ltx == nil { - break - } - // If we don't have enough space for the next transaction, skip the account. - if env.gasPool.Gas() < ltx.Gas { - log.Trace("Not enough gas left for transaction", "hash", ltx.Hash, "left", env.gasPool.Gas(), "needed", ltx.Gas) - txs.Pop() - continue - } - if left := uint64(params.MaxBlobGasPerBlock - env.blobs*params.BlobTxBlobGasPerBlob); left < ltx.BlobGas { - log.Trace("Not enough blob gas left for transaction", "hash", ltx.Hash, "left", left, "needed", ltx.BlobGas) - txs.Pop() - continue - } - // Transaction seems to fit, pull it up from the pool - tx := ltx.Resolve() - if tx == nil { - log.Trace("Ignoring evicted transaction", "hash", ltx.Hash) - txs.Pop() - continue - } - // Error may be ignored here. The error has already been checked - // during transaction acceptance in the transaction pool. - from, _ := types.Sender(env.signer, tx) - - // Check whether the tx is replay protected. If we're not in the EIP155 hf - // phase, start ignoring the sender until we do. - if tx.Protected() && !miner.chainConfig.IsEIP155(env.header.Number) { - log.Trace("Ignoring replay protected transaction", "hash", ltx.Hash, "eip155", miner.chainConfig.EIP155Block) - txs.Pop() - continue - } - // Start executing the transaction - env.state.SetTxContext(tx.Hash(), env.tcount) - - err := miner.commitTransaction(env, tx) - switch { - case errors.Is(err, core.ErrNonceTooLow): - // New head notification data race between the transaction pool and miner, shift - log.Trace("Skipping transaction with low nonce", "hash", ltx.Hash, "sender", from, "nonce", tx.Nonce()) - txs.Shift() - - case errors.Is(err, nil): - // Everything ok, collect the logs and shift in the next transaction from the same account - txs.Shift() - - default: - // Transaction is regarded as invalid, drop all consecutive transactions from - // the same sender because of `nonce-too-high` clause. - log.Debug("Transaction failed, account skipped", "hash", ltx.Hash, "err", err) - txs.Pop() - } - } - return nil -} - func (miner *Miner) fillAstriaTransactions(interrupt *atomic.Int32, env *environment) error { // Use pre ordered array of txs astriaTxs := miner.txpool.AstriaOrdered() @@ -456,62 +310,48 @@ func (miner *Miner) fillAstriaTransactions(interrupt *atomic.Int32, env *environ return nil } -// fillTransactions retrieves the pending transactions from the txpool and fills them -// into the given sealing block. The transaction selection and ordering strategy can -// be customized with the plugin in the future. -func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment) error { - miner.confMu.RLock() - tip := miner.config.GasPrice - miner.confMu.RUnlock() +// generateParams wraps various of settings for generating sealing task. +type generateParams struct { + timestamp uint64 // The timstamp for sealing task + forceTime bool // Flag whether the given timestamp is immutable or not + parentHash common.Hash // Parent block hash, empty means the latest chain head + coinbase common.Address // The fee recipient address for including transaction + random common.Hash // The randomness generated by beacon chain, empty before the merge + withdrawals types.Withdrawals // List of withdrawals to include in block. + beaconRoot *common.Hash // The beacon root (cancun field). + noTxs bool // Flag whether an empty block without any transaction is expected +} - // Retrieve the pending transactions pre-filtered by the 1559/4844 dynamic fees - filter := txpool.PendingFilter{ - MinTip: uint256.MustFromBig(tip), - } - if env.header.BaseFee != nil { - filter.BaseFee = uint256.MustFromBig(env.header.BaseFee) - } - if env.header.ExcessBlobGas != nil { - filter.BlobFee = uint256.MustFromBig(eip4844.CalcBlobFee(*env.header.ExcessBlobGas)) +// generateWork generates a sealing block based on the given parameters. +func (miner *Miner) generateWork(params *generateParams) *newPayloadResult { + work, err := miner.prepareWork(params) + if err != nil { + return &newPayloadResult{err: err} } - filter.OnlyPlainTxs, filter.OnlyBlobTxs = true, false - pendingPlainTxs := miner.txpool.Pending(filter) - - filter.OnlyPlainTxs, filter.OnlyBlobTxs = false, true - pendingBlobTxs := miner.txpool.Pending(filter) - - // Split the pending transactions into locals and remotes. - localPlainTxs, remotePlainTxs := make(map[common.Address][]*txpool.LazyTransaction), pendingPlainTxs - localBlobTxs, remoteBlobTxs := make(map[common.Address][]*txpool.LazyTransaction), pendingBlobTxs + if !params.noTxs { + interrupt := new(atomic.Int32) + timer := time.AfterFunc(miner.config.Recommit, func() { + interrupt.Store(commitInterruptTimeout) + }) + defer timer.Stop() - for _, account := range miner.txpool.Locals() { - if txs := remotePlainTxs[account]; len(txs) > 0 { - delete(remotePlainTxs, account) - localPlainTxs[account] = txs - } - if txs := remoteBlobTxs[account]; len(txs) > 0 { - delete(remoteBlobTxs, account) - localBlobTxs[account] = txs + err := miner.fillAstriaTransactions(interrupt, work) + if errors.Is(err, errBlockInterruptedByTimeout) { + log.Warn("Block building is interrupted", "allowance", common.PrettyDuration(miner.config.Recommit)) } } - // Fill the block with all available pending transactions. - if len(localPlainTxs) > 0 || len(localBlobTxs) > 0 { - plainTxs := newTransactionsByPriceAndNonce(env.signer, localPlainTxs, env.header.BaseFee) - blobTxs := newTransactionsByPriceAndNonce(env.signer, localBlobTxs, env.header.BaseFee) - - if err := miner.commitTransactions(env, plainTxs, blobTxs, interrupt); err != nil { - return err - } + body := types.Body{Transactions: work.txs, Withdrawals: params.withdrawals} + block, err := miner.engine.FinalizeAndAssemble(miner.chain, work.header, work.state, &body, work.receipts) + if err != nil { + return &newPayloadResult{err: err} } - if len(remotePlainTxs) > 0 || len(remoteBlobTxs) > 0 { - plainTxs := newTransactionsByPriceAndNonce(env.signer, remotePlainTxs, env.header.BaseFee) - blobTxs := newTransactionsByPriceAndNonce(env.signer, remoteBlobTxs, env.header.BaseFee) - - if err := miner.commitTransactions(env, plainTxs, blobTxs, interrupt); err != nil { - return err - } + return &newPayloadResult{ + block: block, + fees: totalFees(block, work.receipts), + sidecars: work.sidecars, + stateDB: work.state, + receipts: work.receipts, } - return nil } // totalFees computes total consumed miner fees in Wei. Block transactions and receipts have to have the same order. diff --git a/node/node.go b/node/node.go index 896763033d..ab593b2bbb 100644 --- a/node/node.go +++ b/node/node.go @@ -309,6 +309,9 @@ func (n *Node) stopServices(running []Lifecycle) error { // Stop p2p networking. n.server.Stop() + // Stop GRPC server + n.stopGRPC() + if len(failure.Services) > 0 { return failure }