diff --git a/.just/proto.just b/.just/proto.just index 722e53397c..35f7436bcb 100644 --- a/.just/proto.just +++ b/.just/proto.just @@ -4,6 +4,7 @@ proto-gen: @echo "--> Generating Protobuf files" buf generate --path="./proto/evnode" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/execution/evm" --template="buf.gen.evm.yaml" --config="buf.yaml" + buf generate --template="buf.gen.grpc.yaml" --config="buf.yaml" # Lint protobuf files (requires Docker) [group('proto')] diff --git a/CHANGELOG.md b/CHANGELOG.md index aca78dcc0e..c8d7e9f6ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Optimization of mutex usage in cache for reaper [#3286](https://github.com/evstack/ev-node/pull/3286) - Add Unix domain socket support for gRPC execution endpoints via `unix:///path/to/socket` [#3297](https://github.com/evstack/ev-node/pull/3297) -- **BREAKING:** Replace legacy gRPC execution `txs` payload fields with `tx_batch` so clients and servers use contiguous transaction buffers [#3297](https://github.com/evstack/ev-node/pull/3297) +- **BREAKING:** (execution/grpc) + - Move execution service where it belongs in execution/grpc. []() + - Replace legacy gRPC execution `txs` payload fields with `tx_batch` so clients and servers use contiguous transaction buffers [#3297](https://github.com/evstack/ev-node/pull/3297) - Optimize metadata writes by making it async in cache store [#3298](https://github.com/evstack/ev-node/pull/3298) - Reduce tx cache retention to avoid OOM under (really) heavy tx load [#3299](https://github.com/evstack/ev-node/pull/3299) diff --git a/buf.gen.grpc.yaml b/buf.gen.grpc.yaml new file mode 100644 index 0000000000..019de76139 --- /dev/null +++ b/buf.gen.grpc.yaml @@ -0,0 +1,11 @@ +version: v2 + +plugins: + - remote: buf.build/protocolbuffers/go + out: execution/grpc/types/pb + opt: paths=source_relative + - remote: buf.build/connectrpc/go + out: execution/grpc/types/pb + opt: paths=source_relative +inputs: + - directory: execution/grpc/proto diff --git a/buf.yaml b/buf.yaml index c558c32114..f3aef299bd 100644 --- a/buf.yaml +++ b/buf.yaml @@ -2,6 +2,7 @@ version: v2 modules: - path: proto + - path: execution/grpc/proto lint: use: - COMMENTS @@ -14,6 +15,3 @@ lint: breaking: use: - FILE - ignore_only: - FIELD_NO_DELETE: - - proto/evnode/v1/execution.proto diff --git a/execution/grpc/client.go b/execution/grpc/client.go index cfcb6612f0..253dbcb464 100644 --- a/execution/grpc/client.go +++ b/execution/grpc/client.go @@ -15,8 +15,8 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" "github.com/evstack/ev-node/core/execution" - pb "github.com/evstack/ev-node/types/pb/evnode/v1" - "github.com/evstack/ev-node/types/pb/evnode/v1/v1connect" + pb "github.com/evstack/ev-node/execution/grpc/types/pb/evnode/v1" + "github.com/evstack/ev-node/execution/grpc/types/pb/evnode/v1/v1connect" ) // Ensure Client implements the execution.Executor interface diff --git a/execution/grpc/go.mod b/execution/grpc/go.mod index bbedeaf599..b702023db3 100644 --- a/execution/grpc/go.mod +++ b/execution/grpc/go.mod @@ -2,12 +2,9 @@ module github.com/evstack/ev-node/execution/grpc go 1.25.7 -replace github.com/evstack/ev-node => ../.. - require ( connectrpc.com/connect v1.19.2 connectrpc.com/grpcreflect v1.3.0 - github.com/evstack/ev-node v1.1.1 github.com/evstack/ev-node/core v1.0.0 golang.org/x/net v0.53.0 google.golang.org/protobuf v1.36.11 diff --git a/execution/grpc/go.sum b/execution/grpc/go.sum index 20c9e1b3d0..e0bdd7d74e 100644 --- a/execution/grpc/go.sum +++ b/execution/grpc/go.sum @@ -2,8 +2,6 @@ connectrpc.com/connect v1.19.2 h1:McQ83FGdzL+t60peksi0gXC7MQ/iLKgLduAnThbM0mo= connectrpc.com/connect v1.19.2/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w= connectrpc.com/grpcreflect v1.3.0 h1:Y4V+ACf8/vOb1XOc251Qun7jMB75gCUNw6llvB9csXc= connectrpc.com/grpcreflect v1.3.0/go.mod h1:nfloOtCS8VUQOQ1+GTdFzVg2CJo4ZGaat8JIovCtDYs= -github.com/evstack/ev-node v1.1.1 h1:J9h5PKx177XdvNWLZCDOkWJEGRIrPzYxkCFhbGkVUm8= -github.com/evstack/ev-node v1.1.1/go.mod h1:/d/i+SSTDFnxffoijcrwmlt0LgfUU8D4S3HQqucwtu8= github.com/evstack/ev-node/core v1.0.0 h1:s0Tx0uWHme7SJn/ZNEtee4qNM8UO6PIxXnHhPbbKTz8= github.com/evstack/ev-node/core v1.0.0/go.mod h1:n2w/LhYQTPsi48m6lMj16YiIqsaQw6gxwjyJvR+B3sY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= diff --git a/execution/grpc/handler.go b/execution/grpc/handler.go index 8c785987fc..c3b3bc2ab6 100644 --- a/execution/grpc/handler.go +++ b/execution/grpc/handler.go @@ -10,7 +10,7 @@ import ( "golang.org/x/net/http2/h2c" "github.com/evstack/ev-node/core/execution" - "github.com/evstack/ev-node/types/pb/evnode/v1/v1connect" + "github.com/evstack/ev-node/execution/grpc/types/pb/evnode/v1/v1connect" ) // NewExecutorServiceHandler creates a new HTTP handler for the ExecutorService. diff --git a/proto/evnode/v1/execution.proto b/execution/grpc/proto/evnode/v1/execution.proto similarity index 96% rename from proto/evnode/v1/execution.proto rename to execution/grpc/proto/evnode/v1/execution.proto index d1773c4289..7300c00929 100644 --- a/proto/evnode/v1/execution.proto +++ b/execution/grpc/proto/evnode/v1/execution.proto @@ -3,9 +3,9 @@ package evnode.v1; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/evstack/ev-node/types/pb/evnode/v1"; +option go_package = "github.com/evstack/ev-node/execution/grpc/types/pb/evnode/v1"; -// ExecutorService defines the execution layer interface for EVNode +// ExecutorService defines the execution layer interface for execution/grpc service ExecutorService { // InitChain initializes a new blockchain instance with genesis parameters rpc InitChain(InitChainRequest) returns (InitChainResponse) {} diff --git a/execution/grpc/server.go b/execution/grpc/server.go index 8f1cbb48ce..48a6b673ea 100644 --- a/execution/grpc/server.go +++ b/execution/grpc/server.go @@ -8,7 +8,7 @@ import ( "connectrpc.com/connect" "github.com/evstack/ev-node/core/execution" - pb "github.com/evstack/ev-node/types/pb/evnode/v1" + pb "github.com/evstack/ev-node/execution/grpc/types/pb/evnode/v1" ) // Server is a gRPC server that wraps an execution.Executor implementation. diff --git a/execution/grpc/server_test.go b/execution/grpc/server_test.go index 26a6d37ef4..7d879e69b5 100644 --- a/execution/grpc/server_test.go +++ b/execution/grpc/server_test.go @@ -10,7 +10,7 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" "github.com/evstack/ev-node/core/execution" - pb "github.com/evstack/ev-node/types/pb/evnode/v1" + pb "github.com/evstack/ev-node/execution/grpc/types/pb/evnode/v1" ) func TestServer_InitChain(t *testing.T) { diff --git a/execution/grpc/tx_batch.go b/execution/grpc/tx_batch.go index 2e3e600596..e80d7abbc6 100644 --- a/execution/grpc/tx_batch.go +++ b/execution/grpc/tx_batch.go @@ -3,7 +3,7 @@ package grpc import ( "fmt" - pb "github.com/evstack/ev-node/types/pb/evnode/v1" + pb "github.com/evstack/ev-node/execution/grpc/types/pb/evnode/v1" ) // maxTxBatchTxSize is the largest transaction length representable in TxBatch.TxSizes: diff --git a/execution/grpc/tx_batch_test.go b/execution/grpc/tx_batch_test.go index 71c48a7306..7e21055651 100644 --- a/execution/grpc/tx_batch_test.go +++ b/execution/grpc/tx_batch_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - pb "github.com/evstack/ev-node/types/pb/evnode/v1" + pb "github.com/evstack/ev-node/execution/grpc/types/pb/evnode/v1" ) func mustEncodeTxBatch(t *testing.T, txs [][]byte) *pb.TxBatch { diff --git a/types/pb/evnode/v1/execution.pb.go b/execution/grpc/types/pb/evnode/v1/execution.pb.go similarity index 99% rename from types/pb/evnode/v1/execution.pb.go rename to execution/grpc/types/pb/evnode/v1/execution.pb.go index 9f4e3d5809..6dfc0d5d3e 100644 --- a/types/pb/evnode/v1/execution.pb.go +++ b/execution/grpc/types/pb/evnode/v1/execution.pb.go @@ -787,7 +787,7 @@ const file_evnode_v1_execution_proto_rawDesc = "" + "ExecuteTxs\x12\x1c.evnode.v1.ExecuteTxsRequest\x1a\x1d.evnode.v1.ExecuteTxsResponse\"\x00\x12E\n" + "\bSetFinal\x12\x1a.evnode.v1.SetFinalRequest\x1a\x1b.evnode.v1.SetFinalResponse\"\x00\x12]\n" + "\x10GetExecutionInfo\x12\".evnode.v1.GetExecutionInfoRequest\x1a#.evnode.v1.GetExecutionInfoResponse\"\x00\x12H\n" + - "\tFilterTxs\x12\x1b.evnode.v1.FilterTxsRequest\x1a\x1c.evnode.v1.FilterTxsResponse\"\x00B/Z-github.com/evstack/ev-node/types/pb/evnode/v1b\x06proto3" + "\tFilterTxs\x12\x1b.evnode.v1.FilterTxsRequest\x1a\x1c.evnode.v1.FilterTxsResponse\"\x00B>Z