Skip to content

Commit 62cb315

Browse files
authored
Merge branch 'main' into dependabot/go_modules/all-go-91a29a433b
2 parents 399f5e9 + 4481fea commit 62cb315

File tree

19 files changed

+87
-29
lines changed

19 files changed

+87
-29
lines changed

apps/evm/cmd/rollback.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func NewRollbackCmd() *cobra.Command {
3838
}
3939

4040
// evolve db
41-
rawEvolveDB, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, "evm")
41+
rawEvolveDB, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, evmDbName)
4242
if err != nil {
4343
return err
4444
}

apps/evm/cmd/run.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import (
2828
"github.com/evstack/ev-node/sequencers/single"
2929
)
3030

31+
const evmDbName = "evm-single"
32+
3133
var RunCmd = &cobra.Command{
3234
Use: "start",
3335
Aliases: []string{"node", "run"},
@@ -60,7 +62,7 @@ var RunCmd = &cobra.Command{
6062
return err
6163
}
6264

63-
datastore, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, "evm")
65+
datastore, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, evmDbName)
6466
if err != nil {
6567
return err
6668
}

apps/grpc/cmd/run.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
)
2727

2828
const (
29+
grpcDbName = "grpc-single"
2930
// FlagGrpcExecutorURL is the flag for the gRPC executor endpoint
3031
FlagGrpcExecutorURL = "grpc-executor-url"
3132
)
@@ -63,7 +64,7 @@ The execution client must implement the Evolve execution gRPC interface.`,
6364
}
6465

6566
// Create datastore
66-
datastore, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, "evgrpc")
67+
datastore, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, grpcDbName)
6768
if err != nil {
6869
return err
6970
}

apps/testapp/cmd/rollback.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func NewRollbackCmd() *cobra.Command {
3939
}
4040

4141
// evolve db
42-
rawEvolveDB, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, "testapp")
42+
rawEvolveDB, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, testDbName)
4343
if err != nil {
4444
return err
4545
}

apps/testapp/cmd/run.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
"github.com/evstack/ev-node/sequencers/single"
2020
)
2121

22+
const testDbName = "testapp"
23+
2224
var RunCmd = &cobra.Command{
2325
Use: "start",
2426
Aliases: []string{"node", "run"},
@@ -61,7 +63,7 @@ var RunCmd = &cobra.Command{
6163
return err
6264
}
6365

64-
datastore, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, "testapp")
66+
datastore, err := store.NewDefaultKVStore(nodeConfig.RootDir, nodeConfig.DBPath, testDbName)
6567
if err != nil {
6668
return err
6769
}

block/internal/da/client.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,39 @@ type client struct {
3232
da coreda.DA
3333
logger zerolog.Logger
3434
defaultTimeout time.Duration
35+
batchSize int
3536
namespaceBz []byte
3637
namespaceDataBz []byte
3738
}
3839

40+
const (
41+
defaultRetrieveBatchSize = 150
42+
)
43+
3944
// Config contains configuration for the DA client.
4045
type Config struct {
41-
DA coreda.DA
42-
Logger zerolog.Logger
43-
DefaultTimeout time.Duration
44-
Namespace string
45-
DataNamespace string
46+
DA coreda.DA
47+
Logger zerolog.Logger
48+
DefaultTimeout time.Duration
49+
Namespace string
50+
DataNamespace string
51+
RetrieveBatchSize int
4652
}
4753

4854
// NewClient creates a new DA client with pre-calculated namespace bytes.
4955
func NewClient(cfg Config) *client {
5056
if cfg.DefaultTimeout == 0 {
5157
cfg.DefaultTimeout = 30 * time.Second
5258
}
59+
if cfg.RetrieveBatchSize <= 0 {
60+
cfg.RetrieveBatchSize = defaultRetrieveBatchSize
61+
}
5362

5463
return &client{
5564
da: cfg.DA,
5665
logger: cfg.Logger.With().Str("component", "da_client").Logger(),
5766
defaultTimeout: cfg.DefaultTimeout,
67+
batchSize: cfg.RetrieveBatchSize,
5868
namespaceBz: coreda.NamespaceFromString(cfg.Namespace).Bytes(),
5969
namespaceDataBz: coreda.NamespaceFromString(cfg.DataNamespace).Bytes(),
6070
}
@@ -203,7 +213,8 @@ func (c *client) Retrieve(ctx context.Context, height uint64, namespace []byte)
203213
}
204214
}
205215
// 2. Get Blobs using the retrieved IDs in batches
206-
batchSize := 100
216+
// Each batch has its own timeout while keeping the link to the parent context
217+
batchSize := c.batchSize
207218
blobs := make([][]byte, 0, len(idsResult.IDs))
208219
for i := 0; i < len(idsResult.IDs); i += batchSize {
209220
end := min(i+batchSize, len(idsResult.IDs))

block/internal/submitting/da_submitter.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,9 @@ func submitToDA[T any](
401401
s.logger.Debug().Str("signingAddress", signingAddress).Msg("using signing address for DA submission")
402402
}
403403

404-
submitCtx, cancel := context.WithTimeout(ctx, submissionTimeout)
405-
defer cancel()
406-
407404
// Perform submission
408405
start := time.Now()
409-
res := s.client.Submit(submitCtx, marshaled, -1, namespace, mergedOptions)
406+
res := s.client.Submit(ctx, marshaled, -1, namespace, mergedOptions)
410407
s.logger.Debug().Int("attempts", rs.Attempt).Dur("elapsed", time.Since(start)).Uint64("code", uint64(res.Code)).Msg("got SubmitWithHelpers response from celestia")
411408

412409
// Record submission result for observability

block/public.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package block
22

33
import (
4-
"time"
5-
64
"github.com/evstack/ev-node/block/internal/common"
75
"github.com/evstack/ev-node/block/internal/da"
86
coreda "github.com/evstack/ev-node/core/da"
@@ -41,10 +39,11 @@ func NewDAClient(
4139
logger zerolog.Logger,
4240
) DAClient {
4341
return da.NewClient(da.Config{
44-
DA: daLayer,
45-
Logger: logger,
46-
DefaultTimeout: 10 * time.Second,
47-
Namespace: config.DA.GetNamespace(),
48-
DataNamespace: config.DA.GetDataNamespace(),
42+
DA: daLayer,
43+
Logger: logger,
44+
Namespace: config.DA.GetNamespace(),
45+
DefaultTimeout: config.DA.RequestTimeout.Duration,
46+
DataNamespace: config.DA.GetDataNamespace(),
47+
RetrieveBatchSize: config.DA.RetrieveBatchSize,
4948
})
5049
}

docs/learn/config.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,42 @@ _Example:_ `--rollkit.da.mempool_ttl 30`
490490
_Default:_ `20`
491491
_Constant:_ `FlagDAMempoolTTL`
492492

493+
### DA Retrieve Batch Size
494+
495+
**Description:**
496+
Number of blob IDs requested per DA `Get` call when the node retrieves blocks from the DA layer. Smaller batches help unreliable DA RPC endpoints return data before the per-request timeout, while larger batches reduce the total number of round trips for fast DA nodes.
497+
498+
**YAML:**
499+
500+
```yaml
501+
da:
502+
retrieve_batch_size: 100
503+
```
504+
505+
**Command-line Flag:**
506+
`--rollkit.da.retrieve_batch_size <int>`
507+
_Example:_ `--rollkit.da.retrieve_batch_size 50`
508+
_Default:_ `100`
509+
_Constant:_ `FlagDARetrieveBatchSize`
510+
511+
### DA Request Timeout
512+
513+
**Description:**
514+
Per-request timeout applied to DA `GetIDs` and `Get` RPC calls while retrieving blobs. Increase this value if your DA endpoint has high latency to avoid premature failures; decrease it to make the syncer fail fast and free resources sooner when the DA node becomes unresponsive.
515+
516+
**YAML:**
517+
518+
```yaml
519+
da:
520+
request_timeout: "30s"
521+
```
522+
523+
**Command-line Flag:**
524+
`--rollkit.da.request_timeout <duration>`
525+
_Example:_ `--rollkit.da.request_timeout 45s`
526+
_Default:_ `"30s"`
527+
_Constant:_ `FlagDARequestTimeout`
528+
493529
## P2P Configuration (`p2p`)
494530

495531
Settings for peer-to-peer networking, enabling nodes to discover each other, exchange blocks, and share transactions.

docs/learn/specs/block-manager.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ The block components share a common configuration:
167167
| Namespace | da.Namespace | DA namespace ID for block submissions (deprecated, use HeaderNamespace and DataNamespace instead) |
168168
| HeaderNamespace | string | namespace ID for submitting headers to DA layer (automatically encoded by the node) |
169169
| DataNamespace | string | namespace ID for submitting data to DA layer (automatically encoded by the node) |
170+
| RetrieveBatchSize | int | number of blob IDs fetched per DA `Get` call, trading off payload size vs. number of RPC round trips (default: 100) |
171+
| RequestTimeout | duration | per-request timeout for DA `GetIDs`/`Get` calls; higher values tolerate slow DA nodes, lower values fail faster (default: 30s) |
170172

171173
### Block Production (Executor Component)
172174

0 commit comments

Comments
 (0)