Skip to content

Commit 0ea8396

Browse files
committed
Merge branch 'julien/speedup-submitter' into julien/fiber
2 parents a339289 + 9669b26 commit 0ea8396

36 files changed

Lines changed: 2357 additions & 684 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Changes
1313

1414
- Optimization of mutex usage in cache for reaper [#3286](https://github.com/evstack/ev-node/pull/3286)
15+
- 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)
1517
- Optimize metadata writes by making it async in cache store [#3298](https://github.com/evstack/ev-node/pull/3298)
1618
- Reduce tx cache retention to avoid OOM under (really) heavy tx load [#3299](https://github.com/evstack/ev-node/pull/3299)
1719

apps/grpc/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# gRPC Single Sequencer App
22

3-
This application runs a Evolve node with a single sequencer that connects to a remote execution client via gRPC. It allows you to use any execution layer that implements the Evolve execution gRPC interface.
3+
This application runs an Evolve node with a single sequencer that connects to an execution client via gRPC. It allows you to use any execution layer that implements the Evolve execution gRPC interface.
44

55
## Overview
66

77
The gRPC single sequencer app provides:
88

9-
- A Evolve consensus node with single sequencer
10-
- Connection to remote execution clients via gRPC
9+
- An Evolve consensus node with single sequencer
10+
- Connection to execution clients via TCP or Unix domain socket gRPC
1111
- Full data availability layer integration
1212
- P2P networking capabilities
1313

@@ -58,11 +58,20 @@ Start the Evolve node with:
5858
--da.auth-token your-da-token
5959
```
6060

61+
For a same-machine executor, use a Unix domain socket endpoint:
62+
63+
```bash
64+
./evgrpc start \
65+
--root-dir ~/.evgrpc \
66+
--grpc-executor-url unix:///tmp/evolve-executor.sock \
67+
--da.address http://localhost:7980
68+
```
69+
6170
## Command-Line Flags
6271

6372
### gRPC-specific Flags
6473

65-
- `--grpc-executor-url`: URL of the gRPC execution service (default: `http://localhost:50051`)
74+
- `--grpc-executor-url`: URL of the gRPC execution service, either `http://host:port` or `unix:///path/to/socket` (default: `http://localhost:50051`)
6675

6776
### Common Evolve Flags
6877

apps/grpc/cmd/run.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828

2929
const (
3030
grpcDbName = "grpc-single"
31-
// FlagGrpcExecutorURL is the flag for the gRPC executor endpoint
31+
// FlagGrpcExecutorURL is the flag for the gRPC executor endpoint.
3232
FlagGrpcExecutorURL = "grpc-executor-url"
3333
)
3434

@@ -165,11 +165,10 @@ func createGRPCExecutionClient(cmd *cobra.Command) (execution.Executor, error) {
165165
return nil, fmt.Errorf("%s flag is required", FlagGrpcExecutorURL)
166166
}
167167

168-
// Create and return the gRPC client
169-
return executiongrpc.NewClient(executorURL), nil
168+
return executiongrpc.NewClient(executorURL)
170169
}
171170

172171
// addGRPCFlags adds flags specific to the gRPC execution client
173172
func addGRPCFlags(cmd *cobra.Command) {
174-
cmd.Flags().String(FlagGrpcExecutorURL, "http://localhost:50051", "URL of the gRPC execution service")
173+
cmd.Flags().String(FlagGrpcExecutorURL, "http://localhost:50051", "URL of the gRPC execution service, or unix:///path/to/executor.sock")
175174
}

block/internal/cache/manager.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ type PendingManager interface {
7777
GetPendingData(ctx context.Context) ([]*types.SignedData, [][]byte, error)
7878
SetLastSubmittedHeaderHeight(ctx context.Context, height uint64)
7979
GetLastSubmittedHeaderHeight() uint64
80+
ResetInFlightHeaderRange(start, end uint64)
8081
SetLastSubmittedDataHeight(ctx context.Context, height uint64)
8182
GetLastSubmittedDataHeight() uint64
83+
ResetInFlightDataRange(start, end uint64)
8284
NumPendingHeaders() uint64
8385
NumPendingData() uint64
86+
NumPendingHeadersTotal() uint64
87+
NumPendingDataTotal() uint64
8488
}
8589

8690
// Manager combines CacheManager and PendingManager.
@@ -311,6 +315,14 @@ func (m *implementation) SetLastSubmittedHeaderHeight(ctx context.Context, heigh
311315
m.pendingHeaders.SetLastSubmittedHeaderHeight(ctx, height)
312316
}
313317

318+
func (m *implementation) ResetInFlightHeaderHeight() {
319+
m.pendingHeaders.ResetInFlightHeaderRange(0, 0)
320+
}
321+
322+
func (m *implementation) ResetInFlightHeaderRange(start, end uint64) {
323+
m.pendingHeaders.ResetInFlightHeaderRange(start, end)
324+
}
325+
314326
func (m *implementation) GetLastSubmittedDataHeight() uint64 {
315327
return m.pendingData.GetLastSubmittedDataHeight()
316328
}
@@ -319,6 +331,10 @@ func (m *implementation) SetLastSubmittedDataHeight(ctx context.Context, height
319331
m.pendingData.SetLastSubmittedDataHeight(ctx, height)
320332
}
321333

334+
func (m *implementation) ResetInFlightDataRange(start, end uint64) {
335+
m.pendingData.ResetInFlightDataRange(start, end)
336+
}
337+
322338
func (m *implementation) NumPendingHeaders() uint64 {
323339
return m.pendingHeaders.NumPendingHeaders()
324340
}
@@ -327,6 +343,14 @@ func (m *implementation) NumPendingData() uint64 {
327343
return m.pendingData.NumPendingData()
328344
}
329345

346+
func (m *implementation) NumPendingHeadersTotal() uint64 {
347+
return m.pendingHeaders.NumPendingHeadersTotal()
348+
}
349+
350+
func (m *implementation) NumPendingDataTotal() uint64 {
351+
return m.pendingData.NumPendingDataTotal()
352+
}
353+
330354
// SetPendingEvent sets the event at the specified height.
331355
func (m *implementation) SetPendingEvent(height uint64, event *common.DAHeightEvent) {
332356
m.pendingMu.Lock()

block/internal/cache/manager_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ func TestPendingHeadersAndData_Flow(t *testing.T) {
221221
// update last submitted heights and re-check
222222
cm.SetLastSubmittedHeaderHeight(ctx, 1)
223223
cm.SetLastSubmittedDataHeight(ctx, 2)
224+
cm.ResetInFlightHeaderRange(1, 3)
225+
cm.ResetInFlightDataRange(2, 3)
226+
227+
// numPending views (before getPending claims items)
228+
assert.Equal(t, uint64(2), cm.NumPendingHeaders())
229+
assert.Equal(t, uint64(1), cm.NumPendingData())
224230

225231
headers, _, err = cm.GetPendingHeaders(ctx)
226232
require.NoError(t, err)
@@ -231,10 +237,6 @@ func TestPendingHeadersAndData_Flow(t *testing.T) {
231237
require.NoError(t, err)
232238
require.Len(t, signedData, 1)
233239
assert.Equal(t, uint64(3), signedData[0].Height())
234-
235-
// numPending views
236-
assert.Equal(t, uint64(2), cm.NumPendingHeaders())
237-
assert.Equal(t, uint64(1), cm.NumPendingData())
238240
}
239241

240242
func TestManager_TxOperations(t *testing.T) {

0 commit comments

Comments
 (0)