Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions pkg/settings/cresettings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ flowchart

subgraph CentralTriggerQueue.Put
%% trigger coordinator reader → central trigger queue (pre-admission buffer)
PerWorkflow.FeatureTriggerConsensusEnabledActivePeriod[/PerWorkflow.FeatureTriggerConsensusEnabledActivePeriod\]:::gate
PerWorkflow.FeatureShadowTriggerModeActivePeriod[/PerWorkflow.FeatureShadowTriggerModeActivePeriod\]:::gate
CentralTriggerEventQueueLimit{{CentralTriggerEventQueueLimit}}:::bound

PerWorkflow.FeatureTriggerConsensusEnabledActivePeriod-->CentralTriggerEventQueueLimit
PerWorkflow.FeatureShadowTriggerModeActivePeriod-->CentralTriggerEventQueueLimit
end

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 @@ -314,6 +314,7 @@
"FeatureConsensusIncludeAllTimestampsActivePeriod": "[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]",
"FeatureVaultGetSecretsDirectlyActivePeriod": "[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]",
"FeatureShadowTriggerModeActivePeriod": "[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]",
"FeatureTriggerConsensusEnabledActivePeriod": "[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]",
"FeatureExecutionMetadataActivePeriod": "[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]"
}
}
1 change: 1 addition & 0 deletions pkg/settings/cresettings/defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ FeatureConsensusStricterMedianQuorumActivePeriod = '[2100-01-01 00:00:00 +0000 U
FeatureConsensusIncludeAllTimestampsActivePeriod = '[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]'
FeatureVaultGetSecretsDirectlyActivePeriod = '[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]'
FeatureShadowTriggerModeActivePeriod = '[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]'
FeatureTriggerConsensusEnabledActivePeriod = '[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]'
FeatureExecutionMetadataActivePeriod = '[2100-01-01 00:00:00 +0000 UTC,2101-01-01 00:00:00 +0000 UTC]'

[PerWorkflow.ChainAllowed]
Expand Down
1 change: 1 addition & 0 deletions pkg/settings/cresettings/featureflags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@ func TestFeatureFlagKeys(t *testing.T) {
require.Equal(t, settings.ScopeGlobal, byKey["DonTimeSequencedTimestampsActivePeriod"])
require.Equal(t, settings.ScopeGlobal, byKey["CRONV2ActivePeriod"])
require.Equal(t, settings.ScopeWorkflow, byKey["PerWorkflow.FeatureShadowTriggerModeActivePeriod"])
require.Equal(t, settings.ScopeWorkflow, byKey["PerWorkflow.FeatureTriggerConsensusEnabledActivePeriod"])
require.Contains(t, byKey, "ConfidentialCompute.ConfidentialHTTPVaultGetSecretsDirectlyActivePeriod")
}
10 changes: 10 additions & 0 deletions pkg/settings/cresettings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ var Default = Schema{
FeatureConsensusIncludeAllTimestampsActivePeriod: disabledFeatureTimeRange,
FeatureVaultGetSecretsDirectlyActivePeriod: disabledFeatureTimeRange,
FeatureShadowTriggerModeActivePeriod: disabledFeatureTimeRange,
FeatureTriggerConsensusEnabledActivePeriod: disabledFeatureTimeRange,
FeatureExecutionMetadataActivePeriod: disabledFeatureTimeRange,
},
}
Expand Down Expand Up @@ -642,6 +643,15 @@ type Workflows struct {
// copied to the central trigger queue. Each event is checked against the time it was observed, so
// every node switches at the same moment.
FeatureShadowTriggerModeActivePeriod Setting[Range[config.Timestamp]] `featureflag:"true"`
// FeatureTriggerConsensusEnabledActivePeriod is the window in which coordinated trigger events go
// only to the central trigger queue, and only the consensus-queue plugin starts them. Like the
// shadow window, each event is checked against the time it was observed. It takes precedence over
// FeatureShadowTriggerModeActivePeriod when both windows contain an event, so the two may overlap.
// Only move a boundary to a future time later than settings propagation plus the trigger event
// queue timeout; a boundary moved into the past can route and start in-flight events differently.
// Requires the consensus-queue plugin and the coordinated engine on every node in the workflow DON;
// without them, events in this window are never started.
FeatureTriggerConsensusEnabledActivePeriod Setting[Range[config.Timestamp]] `featureflag:"true"`
// FeatureExecutionMetadataActivePeriod is the window in which the engine populates
// WorkflowExecutionMetadata in the ExecuteRequest sent to the workflow module. It changes the
// request bytes, which confidential workflows hash across nodes, so it is checked against the
Expand Down
17 changes: 17 additions & 0 deletions pkg/settings/cresettings/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,23 @@ func TestFeatureShadowTriggerModeActivePeriodKeyInit(t *testing.T) {
}, s.DefaultValue)
}

// TestFeatureTriggerConsensusEnabledActivePeriodKeyInit asserts the consensus window is per workflow and off by default.
func TestFeatureTriggerConsensusEnabledActivePeriodKeyInit(t *testing.T) {
s := Default.PerWorkflow.FeatureTriggerConsensusEnabledActivePeriod

assert.Equal(t, "PerWorkflow.FeatureTriggerConsensusEnabledActivePeriod", s.GetKey())
assert.Equal(t, settings.ScopeWorkflow, s.Scope)
assert.NotNil(t, s.Parse)
assert.Equal(t, settings.Range[config.Timestamp]{
Lower: config.Timestamp(time.Date(2100, 1, 1, 0, 0, 0, 0, time.UTC).Unix()),
Upper: config.Timestamp(time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC).Unix()),
}, s.DefaultValue)

got, err := s.GetOrDefault(t.Context(), DefaultGetter)
require.NoError(t, err)
assert.False(t, got.Contains(config.Timestamp(time.Now().Unix())), "consensus window must not contain now by default")
}

func TestFeatureVaultGetSecretsDirectlyActivePeriodKeyInit(t *testing.T) {
s := Default.PerWorkflow.FeatureVaultGetSecretsDirectlyActivePeriod

Expand Down
Loading