Skip to content

Commit b342389

Browse files
committed
refactor(execution/grpc): move execution service where it belongs
1 parent 4063698 commit b342389

15 files changed

Lines changed: 140 additions & 132 deletions

File tree

.just/proto.just

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ proto-gen:
44
@echo "--> Generating Protobuf files"
55
buf generate --path="./proto/evnode" --template="buf.gen.yaml" --config="buf.yaml"
66
buf generate --path="./proto/execution/evm" --template="buf.gen.evm.yaml" --config="buf.yaml"
7+
buf generate --template="buf.gen.grpc.yaml" --config="buf.yaml"
78

89
# Lint protobuf files (requires Docker)
910
[group('proto')]

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
- Optimization of mutex usage in cache for reaper [#3286](https://github.com/evstack/ev-node/pull/3286)
1515
- Add Unix domain socket support for gRPC execution endpoints via `unix:///path/to/socket` [#3297](https://github.com/evstack/ev-node/pull/3297)
16-
- **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)
16+
- **BREAKING:** (execution/grpc)
17+
- Move execution service where it belongs in execution/grpc. []()
18+
- 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)
1719
- Optimize metadata writes by making it async in cache store [#3298](https://github.com/evstack/ev-node/pull/3298)
1820
- Reduce tx cache retention to avoid OOM under (really) heavy tx load [#3299](https://github.com/evstack/ev-node/pull/3299)
1921

buf.gen.grpc.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: v2
2+
3+
plugins:
4+
- remote: buf.build/protocolbuffers/go
5+
out: execution/grpc/types/pb
6+
opt: paths=source_relative
7+
- remote: buf.build/connectrpc/go
8+
out: execution/grpc/types/pb
9+
opt: paths=source_relative
10+
inputs:
11+
- directory: execution/grpc/proto

buf.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: v2
22

33
modules:
44
- path: proto
5+
- path: execution/grpc/proto
56
lint:
67
use:
78
- COMMENTS
@@ -14,6 +15,4 @@ lint:
1415
breaking:
1516
use:
1617
- FILE
17-
ignore_only:
18-
FIELD_NO_DELETE:
19-
- proto/evnode/v1/execution.proto
18+

execution/grpc/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"google.golang.org/protobuf/types/known/timestamppb"
1616

1717
"github.com/evstack/ev-node/core/execution"
18-
pb "github.com/evstack/ev-node/types/pb/evnode/v1"
19-
"github.com/evstack/ev-node/types/pb/evnode/v1/v1connect"
18+
pb "github.com/evstack/ev-node/execution/grpc/types/pb"
19+
"github.com/evstack/ev-node/execution/grpc/types/pb/pbconnect"
2020
)
2121

2222
// Ensure Client implements the execution.Executor interface
@@ -25,7 +25,7 @@ var _ execution.Executor = (*Client)(nil)
2525
// Client is a gRPC client that implements the execution.Executor interface.
2626
// It communicates with a remote execution service via gRPC using Connect-RPC.
2727
type Client struct {
28-
client v1connect.ExecutorServiceClient
28+
client pbconnect.ExecutorServiceClient
2929
}
3030

3131
const (
@@ -99,7 +99,7 @@ func NewClient(url string, opts ...connect.ClientOption) (*Client, error) {
9999
return nil, err
100100
}
101101
return &Client{
102-
client: v1connect.NewExecutorServiceClient(
102+
client: pbconnect.NewExecutorServiceClient(
103103
httpClient,
104104
targetURL,
105105
opts...,

execution/grpc/go.mod

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ module github.com/evstack/ev-node/execution/grpc
22

33
go 1.25.7
44

5-
replace github.com/evstack/ev-node => ../..
6-
75
require (
86
connectrpc.com/connect v1.19.2
97
connectrpc.com/grpcreflect v1.3.0
10-
github.com/evstack/ev-node v1.1.1
118
github.com/evstack/ev-node/core v1.0.0
129
golang.org/x/net v0.53.0
1310
google.golang.org/protobuf v1.36.11

execution/grpc/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ connectrpc.com/connect v1.19.2 h1:McQ83FGdzL+t60peksi0gXC7MQ/iLKgLduAnThbM0mo=
22
connectrpc.com/connect v1.19.2/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w=
33
connectrpc.com/grpcreflect v1.3.0 h1:Y4V+ACf8/vOb1XOc251Qun7jMB75gCUNw6llvB9csXc=
44
connectrpc.com/grpcreflect v1.3.0/go.mod h1:nfloOtCS8VUQOQ1+GTdFzVg2CJo4ZGaat8JIovCtDYs=
5-
github.com/evstack/ev-node v1.1.1 h1:J9h5PKx177XdvNWLZCDOkWJEGRIrPzYxkCFhbGkVUm8=
6-
github.com/evstack/ev-node v1.1.1/go.mod h1:/d/i+SSTDFnxffoijcrwmlt0LgfUU8D4S3HQqucwtu8=
75
github.com/evstack/ev-node/core v1.0.0 h1:s0Tx0uWHme7SJn/ZNEtee4qNM8UO6PIxXnHhPbbKTz8=
86
github.com/evstack/ev-node/core v1.0.0/go.mod h1:n2w/LhYQTPsi48m6lMj16YiIqsaQw6gxwjyJvR+B3sY=
97
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=

execution/grpc/handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"golang.org/x/net/http2/h2c"
1111

1212
"github.com/evstack/ev-node/core/execution"
13-
"github.com/evstack/ev-node/types/pb/evnode/v1/v1connect"
13+
"github.com/evstack/ev-node/execution/grpc/types/pb/pbconnect"
1414
)
1515

1616
// NewExecutorServiceHandler creates a new HTTP handler for the ExecutorService.
@@ -33,13 +33,13 @@ func NewExecutorServiceHandler(executor execution.Executor, opts ...connect.Hand
3333

3434
// Set up gRPC reflection for debugging and discovery
3535
reflector := grpcreflect.NewStaticReflector(
36-
v1connect.ExecutorServiceName,
36+
pbconnect.ExecutorServiceName,
3737
)
3838
mux.Handle(grpcreflect.NewHandlerV1(reflector, compress1KB))
3939
mux.Handle(grpcreflect.NewHandlerV1Alpha(reflector, compress1KB))
4040

4141
// Register the ExecutorService
42-
path, handler := v1connect.NewExecutorServiceHandler(server, append(opts, compress1KB)...)
42+
path, handler := pbconnect.NewExecutorServiceHandler(server, append(opts, compress1KB)...)
4343
mux.Handle(path, handler)
4444

4545
// Use h2c to support HTTP/2 without TLS
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package evnode.v1;
33

44
import "google/protobuf/timestamp.proto";
55

6-
option go_package = "github.com/evstack/ev-node/types/pb/evnode/v1";
6+
option go_package = "github.com/evstack/ev-node/execution/grpc/types/pb";
77

8-
// ExecutorService defines the execution layer interface for EVNode
8+
// ExecutorService defines the execution layer interface for execution/grpc
99
service ExecutorService {
1010
// InitChain initializes a new blockchain instance with genesis parameters
1111
rpc InitChain(InitChainRequest) returns (InitChainResponse) {}

execution/grpc/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"connectrpc.com/connect"
99

1010
"github.com/evstack/ev-node/core/execution"
11-
pb "github.com/evstack/ev-node/types/pb/evnode/v1"
11+
pb "github.com/evstack/ev-node/execution/grpc/types/pb"
1212
)
1313

1414
// Server is a gRPC server that wraps an execution.Executor implementation.

0 commit comments

Comments
 (0)