From 1558aae5df9e241ba391f059f2247265ee77f9ab Mon Sep 17 00:00:00 2001 From: Bruno Moura Date: Wed, 18 Nov 2026 08:54:17 +0000 Subject: [PATCH] llo/dev/v31: default the blob pump observation budget to MaxDurationObservation --- llo/dev/v31/blobpump.go | 4 ---- llo/dev/v31/factory.go | 7 ++++--- llo/dev/v31/flow_test.go | 2 +- llo/pluginconfig/v31config.go | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/llo/dev/v31/blobpump.go b/llo/dev/v31/blobpump.go index 97949d9..a024633 100644 --- a/llo/dev/v31/blobpump.go +++ b/llo/dev/v31/blobpump.go @@ -40,10 +40,6 @@ const ( // MinBlobLifetimeRounds is the smallest lifetime that lets a snapshot be // offered for one round. MinBlobLifetimeRounds = BlobFetchMarginRounds + 1 - // DefaultBlobObservationDurationMultiplier scales MaxDurationObservation - // into the pump's per-cycle budget. The pump runs off the OCR critical - // path, so it can afford to wait longer than a synchronous observation. - DefaultBlobObservationDurationMultiplier = 2 // MaxBlobLifetimeRounds bounds BlobLifetimeRounds. The pump broadcasts // roughly one blob per round, so the unexpired-blob budget declared to // libocr grows with the lifetime; this keeps that budget sane. diff --git a/llo/dev/v31/factory.go b/llo/dev/v31/factory.go index 4e1a91c..e7c7c1f 100644 --- a/llo/dev/v31/factory.go +++ b/llo/dev/v31/factory.go @@ -52,8 +52,9 @@ type PluginFactoryParams struct { // [MinBlobLifetimeRounds, MaxBlobLifetimeRounds]. BlobLifetimeRounds uint64 // MaxDurationBlobObservation overrides the pump's per-cycle observation - // budget (default: DefaultBlobObservationDurationMultiplier * - // cfg.MaxDurationObservation). + // budget (default: cfg.MaxDurationObservation, the deadline v30 passes to + // DataSource.Observe). The data source scales its cache TTL and refresh + // cadence with this budget, so a larger value serves older values. MaxDurationBlobObservation time.Duration // BlobInFlightWaitFactor overrides defaultBlobInFlightWaitFactor if // non-zero. Divides cfg.MaxDurationObservation into how long Take waits for @@ -136,7 +137,7 @@ func (f *PluginFactory) NewReportingPlugin(ctx context.Context, cfg ocr3types.Re blobObservationTimeout := f.MaxDurationBlobObservation if blobObservationTimeout <= 0 { - blobObservationTimeout = DefaultBlobObservationDurationMultiplier * cfg.MaxDurationObservation + blobObservationTimeout = cfg.MaxDurationObservation } p := &Plugin{ diff --git a/llo/dev/v31/flow_test.go b/llo/dev/v31/flow_test.go index 1e42d7f..4295fb9 100644 --- a/llo/dev/v31/flow_test.go +++ b/llo/dev/v31/flow_test.go @@ -349,7 +349,7 @@ func Test_Factory_NewReportingPlugin_maxDurationObservation(t *testing.T) { p, _, err := f.NewReportingPlugin(ctx, cfg, nil) require.NoError(t, err) pump := p.(*Plugin).pump - require.Equal(t, DefaultBlobObservationDurationMultiplier*time.Second, pump.observationTimeout) + require.Equal(t, time.Second, pump.observationTimeout) require.Equal(t, time.Second/time.Duration(defaultBlobInFlightWaitFactor), pump.inFlightWait) require.NoError(t, p.Close()) }) diff --git a/llo/pluginconfig/v31config.go b/llo/pluginconfig/v31config.go index 3a50c58..03bd857 100644 --- a/llo/pluginconfig/v31config.go +++ b/llo/pluginconfig/v31config.go @@ -63,7 +63,7 @@ type V31Config struct { BlobLifetimeRounds uint64 `json:"blobLifetimeRounds" toml:"blobLifetimeRounds"` // MaxDurationBlobObservation is the blob pump's per-cycle observation - // budget. + // budget. Zero uses the OCR MaxDurationObservation, as v30 does. MaxDurationBlobObservation Duration `json:"maxDurationBlobObservation" toml:"maxDurationBlobObservation"` // BlobInFlightWaitFactor divides MaxDurationObservation into how long Take