Skip to content

Commit ba03b2a

Browse files
committed
allow parallel workers count
1 parent 6fd93f8 commit ba03b2a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

cmd/receiver-proxy/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ var flags = []cli.Flag{
7575
Usage: "address of the orderflow archive endpoint (block-processor)",
7676
EnvVars: []string{"ORDERFLOW_ARCHIVE_ENDPOINT"},
7777
},
78+
&cli.IntFlag{
79+
Name: "archive-worker-count",
80+
Value: 5,
81+
Usage: "number of parallel workers sending orderflow to archive",
82+
EnvVars: []string{"ARCHIVE_WORKER_COUNT"},
83+
},
7884

7985
// Various configs
8086
&cli.StringFlag{
@@ -237,7 +243,7 @@ func runMain(cCtx *cli.Context) error {
237243
flashbotsSignerAddress := eth.HexToAddress(flashbotsSignerStr)
238244
maxRequestBodySizeBytes := cCtx.Int64("max-request-body-size-bytes")
239245
connectionsPerPeer := cCtx.Int("connections-per-peer")
240-
246+
archiveWorkerCount := cCtx.Int("archive-worker-count")
241247
maxUserRPS := cCtx.Int(flagMaxUserRPS)
242248

243249
certDuration := cCtx.Duration("cert-duration")
@@ -262,6 +268,7 @@ func runMain(cCtx *cli.Context) error {
262268
MaxRequestBodySizeBytes: maxRequestBodySizeBytes,
263269
ConnectionsPerPeer: connectionsPerPeer,
264270
MaxUserRPS: maxUserRPS,
271+
ArchiveWorkerCount: archiveWorkerCount,
265272
}
266273

267274
instance, err := proxy.NewReceiverProxy(*proxyConfig)

proxy/archive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var (
2626
ArchiveRequestTimeout = time.Second * 15
2727
ArchiveRetryMaxTime = time.Second * 120
2828

29-
ArchiveWorkerQueueSize = 10000
29+
ArchiveWorkerQueueSize = 20000
3030
)
3131

3232
type ArchiveQueue struct {

proxy/receiver_proxy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ type ReceiverProxyConfig struct {
9494

9595
ConnectionsPerPeer int
9696
MaxUserRPS int
97+
ArchiveWorkerCount int
9798
}
9899

99100
func NewReceiverProxy(config ReceiverProxyConfig) (*ReceiverProxy, error) {
@@ -185,6 +186,7 @@ func NewReceiverProxy(config ReceiverProxyConfig) (*ReceiverProxy, error) {
185186
flushQueue: archiveFlushCh,
186187
archiveClient: archiveClient,
187188
blockNumberSource: NewBlockNumberSource(config.EthRPC),
189+
workerCount: config.ArchiveWorkerCount,
188190
}
189191
go archiveQueue.Run()
190192

0 commit comments

Comments
 (0)