Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9cc0558
pkg/workflows/dontime: introduce feature flagged fix for sequence num…
jmank88 Sep 8, 2026
acb7626
use donTime for feature flag
jmank88 Sep 10, 2026
880dc0e
adapt transmitter
jmank88 Sep 10, 2026
4a8f4c7
adjust donTime before usage; rm limitByBatchSizeFlag
jmank88 Sep 14, 2026
3a8a077
cleanup; drop error cases
jmank88 Sep 16, 2026
9d52026
document map keys
jmank88 Sep 16, 2026
f87a647
restore unsequencedOutcome
jmank88 Sep 16, 2026
304581e
cleanup and error handling
jmank88 Sep 16, 2026
c596071
remove irrelevant test
jmank88 Sep 16, 2026
6f54b4b
Merge remote-tracking branch 'origin/main' into CRE-5838-dontime-seqnums
jmank88 Sep 16, 2026
e6db8f1
cleanup
jmank88 Sep 17, 2026
1cc7d35
don't assume current sequence number
jmank88 Sep 17, 2026
fc1cd3b
dedupe
jmank88 Sep 17, 2026
3039cbd
simplify Observation
jmank88 Sep 17, 2026
823f8fe
fix test
jmank88 Sep 17, 2026
92a8f3f
remove todo
jmank88 Sep 17, 2026
8d54f75
sorted map iteration
jmank88 Sep 29, 2026
ff3176b
Merge remote-tracking branch 'origin/main' into CRE-5838-dontime-seqnums
jmank88 Sep 29, 2026
2c8926a
tests and fixes
jmank88 Oct 6, 2026
02cb2e4
handle flag reversion; fix store & transmitter
jmank88 Oct 6, 2026
b9dc9eb
Merge remote-tracking branch 'origin/main' into CRE-5838-dontime-seqnums
jmank88 Oct 6, 2026
6ed2220
Merge remote-tracking branch 'origin/main' into CRE-5838-dontime-seqnums
jmank88 Oct 7, 2026
c5ba829
feedback
jmank88 Oct 7, 2026
b236a19
fix error handling; log metadata
jmank88 Oct 8, 2026
6e8ff75
fix feature flag name
jmank88 Oct 8, 2026
0e15c32
fix EarliestTS
jmank88 Oct 8, 2026
2a3e61b
simplifications and naming
jmank88 Oct 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/settings/cresettings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ flowchart
%% the trigger coordinator's reader is likewise its own entry point
CentralTriggerQueue.Put

%% TODO placating test for now since this flowchart no longer renders
DonTimeSequencedTimestampsActivePeriod

classDef bound stroke:#f00
classDef gate stroke:#0f0
classDef queue stroke:#00f
Expand Down
1 change: 1 addition & 0 deletions pkg/settings/cresettings/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit": "31.45728mb",
"VaultMaxPerOracleUnexpiredBlobCount": "1000",
"MissingRequestRecoveryEnabled": "false",
"DonTimeSequencedTimestampsActivePeriod": "[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]",
"ConfidentialCompute": {
"GlobalRate": "1000rps:1000",
"MaxRetries": "3",
Expand Down
1 change: 1 addition & 0 deletions pkg/settings/cresettings/defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ VaultMaxBlobPayloadSizeLimit = '25.6kb'
VaultMaxPerOracleUnexpiredBlobCumulativePayloadSizeLimit = '31.45728mb'
VaultMaxPerOracleUnexpiredBlobCount = '1000'
MissingRequestRecoveryEnabled = 'false'
DonTimeSequencedTimestampsActivePeriod = '[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]'

[ConfidentialCompute]
GlobalRate = '1000rps:1000'
Expand Down
41 changes: 18 additions & 23 deletions pkg/settings/cresettings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ var DefaultGetter Getter
// Deprecated: use Default
var Config Schema

var (
year2100 = time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC)
year2101 = time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC)
disabledFeatureTimeRange = TimeRange(year2100, year2101)
)

var Default = Schema{
WorkflowLimit: Int(1000),
WorkflowExecutionConcurrencyLimit: Int(1000),
Expand Down Expand Up @@ -160,6 +166,8 @@ var Default = Schema{
// MissingRequestRecoveryEnabled
MissingRequestRecoveryEnabled: Bool(false),

DonTimeSequencedTimestampsActivePeriod: disabledFeatureTimeRange,

// Confidential Compute (San Marino framework) node-level settings. Defaults
// mirror the previous hardcoded executor defaults so behavior is unchanged
// until explicitly overridden.
Expand Down Expand Up @@ -335,38 +343,23 @@ var Default = Schema{
RequestTimeout: Duration(30 * time.Second),
},

FeatureHTTPTriggerNewExecutionIDsActivePeriod: TimeRange(
time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC),
time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC)),
FeatureChainCapabilityHashBasedOCRActivePeriod: TimeRange(
time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC),
time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC)),
FeatureEVMWriteReportL1FeeActivePeriod: TimeRange(
time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC),
time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC)),
FeatureAptosWriteReportBlockTimestampActivePeriod: TimeRange(
time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC),
time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC)),
FeatureHTTPTriggerNewExecutionIDsActivePeriod: disabledFeatureTimeRange,
FeatureChainCapabilityHashBasedOCRActivePeriod: disabledFeatureTimeRange,
FeatureEVMWriteReportL1FeeActivePeriod: disabledFeatureTimeRange,
FeatureAptosWriteReportBlockTimestampActivePeriod: disabledFeatureTimeRange,
// ON by default: covers all possible timestamps including zero time.Time{},
// so WorkflowTag is included in the hash matching current prod behavior.
// After rollout, set to far-future window to exclude WorkflowTag.
FeatureRequestHashIncludeWorkflowTagActivePeriod: TimeRange(
time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC),
time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC)),
time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC), year2100),
// OFF by default: the workflow_specs_v2.workflow_tag reconcile backfill
// is intentionally disabled on a fresh deploy. Ops narrows the range to
// cover "now" only after FeatureRequestHashIncludeWorkflowTag is muted
// on every DON member, so DBs can heal without producing tag-driven
// hash divergence during the fill window.
FeatureWorkflowTagBackfillActivePeriod: TimeRange(
time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC),
time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC)),
FeatureConsensusStricterMedianQuorumActivePeriod: TimeRange(
time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC),
time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC)),
FeatureConsensusIncludeAllTimestampsActivePeriod: TimeRange(
time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC),
time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC)),
FeatureWorkflowTagBackfillActivePeriod: disabledFeatureTimeRange,
FeatureConsensusStricterMedianQuorumActivePeriod: disabledFeatureTimeRange,
FeatureConsensusIncludeAllTimestampsActivePeriod: disabledFeatureTimeRange,
},
}

Expand Down Expand Up @@ -481,6 +474,8 @@ type Schema struct {

MissingRequestRecoveryEnabled Setting[bool]

DonTimeSequencedTimestampsActivePeriod Setting[Range[config.Timestamp]]

// Confidential Compute (San Marino framework) node-level settings.
ConfidentialCompute confidentialCompute

Expand Down
6 changes: 3 additions & 3 deletions pkg/settings/limits/range.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/settings"
)

// BoundLimiter is a limiter for simple bounds checks.
// RangeLimiter is a limiter for bounded range checks.
type RangeLimiter[N Number] interface {
Limiter[settings.Range[N]]
// Check returns ErrorBoundLimited if the value is above the limit.
// Check returns ErrorRangeLimited if the value is above the limit.
Check(context.Context, N) error
}

// NewRangeLimiter returns a RangeLimiter with the given lower bounds.
// NewRangeLimiter returns a RangeLimiter with the given bounds.
func NewRangeLimiter[N Number](bounds settings.Range[N]) RangeLimiter[N] {
return &simpleRangeLimiter[N]{bounds: bounds}
}
Expand Down
23 changes: 19 additions & 4 deletions pkg/workflows/dontime/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ import (

"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types"

"github.com/smartcontractkit/chainlink-common/pkg/config"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/settings/cresettings"
"github.com/smartcontractkit/chainlink-common/pkg/settings/limits"
"github.com/smartcontractkit/chainlink-common/pkg/types/core"
"github.com/smartcontractkit/chainlink-common/pkg/workflows/dontime/pb"
)
Expand All @@ -26,19 +29,30 @@ const (
var _ core.OCR3ReportingPluginFactory = &Factory{}

type Factory struct {
store *Store
lggr logger.Logger
store *Store
lggr logger.Logger
sequencedTSEnabled limits.RangeLimiter[config.Timestamp]

services.StateMachine
}

func NewFactory(s *Store, lggr logger.Logger) (*Factory, error) {
return &Factory{
store: s,
lggr: logger.Named(lggr, "OCR3DonTimeFactory"),
store: s,
lggr: logger.Named(lggr, "OCR3DonTimeFactory"),
sequencedTSEnabled: limits.NewRangeLimiter(cresettings.Default.DonTimeSequencedTimestampsActivePeriod.DefaultValue),
}, nil
}

func (o *Factory) InitLimits(lf limits.Factory) error {
sequencedTSEnabled, err := limits.MakeRangeLimiter[config.Timestamp](lf, cresettings.Default.DonTimeSequencedTimestampsActivePeriod)
if err != nil {
return err
}
o.sequencedTSEnabled = sequencedTSEnabled
return nil
}

func (o *Factory) NewReportingPlugin(_ context.Context, config ocr3types.ReportingPluginConfig) (ocr3types.ReportingPlugin[[]byte], ocr3types.ReportingPluginInfo, error) {
var configProto pb.Config
err := proto.Unmarshal(config.OffchainConfig, &configProto)
Expand Down Expand Up @@ -75,6 +89,7 @@ func (o *Factory) NewReportingPlugin(_ context.Context, config ocr3types.Reporti
if err != nil {
return nil, ocr3types.ReportingPluginInfo{}, err
}
plugin.setSequencedTSEnabled(o.sequencedTSEnabled)
pluginInfo := ocr3types.ReportingPluginInfo{
Name: "DON Time Plugin",
Limits: ocr3types.ReportingPluginLimits{
Expand Down
22 changes: 22 additions & 0 deletions pkg/workflows/dontime/pb/dontime.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package pb
Comment thread
bolekk marked this conversation as resolved.

// MaxSeqNum returns the max sequence number from TimestampsBySequence, or -1 if none exist.
func (t *ObservedDonTimes) MaxSeqNum() int64 {
var maxSeqNum int64 = -1
for seqNum := range t.TimestampsBySequence {
if seqNum > maxSeqNum {
maxSeqNum = seqNum
}
}
return maxSeqNum
}

// EarliestTS returns the earliest timestamp value from TimestampsBySequence or nil if none exist.
func (t *ObservedDonTimes) EarliestTS() (earliestTS *int64) {
for _, ts := range t.TimestampsBySequence {
if earliestTS == nil || ts < *earliestTS {
earliestTS = &ts
}
}
return
}
52 changes: 34 additions & 18 deletions pkg/workflows/dontime/pb/dontime.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/workflows/dontime/pb/dontime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ message Observation {
}

message ObservedDonTimes {
repeated int64 timestamps = 1;
repeated int64 timestamps = 1 [deprecated = true];
map<int64, int64> timestampsBySequence = 2;
}

message Outcome {
Expand Down
Loading
Loading