From a04e49eb1d6070e9d6c147df3fd9556d050908e1 Mon Sep 17 00:00:00 2001 From: Bolek Kulbabinski <1416262+bolekk@users.noreply.github.com> Date: Fri, 11 Sep 2026 15:23:59 -0700 Subject: [PATCH] [CRE] Remove legacy DAG guards and wasm host options from workflows Prepares chainlink for the removal of the legacy DAG WASM host from chainlink-common (CRE-5836): drops the WithDeterminism() module option, the ModuleConfig Labeler field and the IsLegacyDAG() rejection guards in the syncer handler and standalone engine. The IsLegacyDAG() methods on EvictableModule, ConfidentialModule and test fakes are deliberately kept: the pinned chainlink-common still requires them on host.ModuleBase, and they remain harmless (unused extra methods) once the post-cleanup common lands. They are deleted together with the next common pin bump. --- .../workflows/cmd/cre/utils/standalone_engine.go | 9 +-------- core/services/workflows/syncer/v2/handler.go | 12 ++---------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/core/services/workflows/cmd/cre/utils/standalone_engine.go b/core/services/workflows/cmd/cre/utils/standalone_engine.go index 6f74fa9b83f..874d8b9f4b8 100644 --- a/core/services/workflows/cmd/cre/utils/standalone_engine.go +++ b/core/services/workflows/cmd/cre/utils/standalone_engine.go @@ -2,7 +2,6 @@ package utils import ( "context" - "errors" "fmt" "strings" "time" @@ -63,16 +62,14 @@ func NewStandaloneEngine( workflowSettingsCfgFn func(*cresettings.Workflows), ) (services.Service, []*sdkpb.TriggerSubscription, error) { ctx = contexts.WithCRE(ctx, contexts.CRE{Owner: defaultOwner, Workflow: defaultWorkflowID}) - labeler := custmsg.NewLabeler() moduleConfig := &host.ModuleConfig{ Logger: lggr, - Labeler: labeler, MaxCompressedBinarySize: defaultMaxUncompressedBinarySize, IsUncompressed: true, Timeout: &defaultTimeout, } - mainModule, err := host.NewModule(ctx, moduleConfig, binary, host.WithDeterminism()) + mainModule, err := host.NewModule(ctx, moduleConfig, binary) if err != nil { return nil, nil, fmt.Errorf("unable to create module from config: %w", err) } @@ -130,10 +127,6 @@ func NewStandaloneEngine( billingClient, _ = billing.NewWorkflowClient(lggr, billingClientAddr, clientOpts...) } - if module.IsLegacyDAG() { - return nil, nil, errors.New("legacy DAG workflows are not supported") - } - secretsFetcher, err := NewFileBasedSecrets(secrets) if err != nil { return nil, nil, err diff --git a/core/services/workflows/syncer/v2/handler.go b/core/services/workflows/syncer/v2/handler.go index 3d34f749c45..835fa207f1c 100644 --- a/core/services/workflows/syncer/v2/handler.go +++ b/core/services/workflows/syncer/v2/handler.go @@ -852,12 +852,8 @@ func (h *eventHandler) engineFactoryFn(ctx context.Context, workflowID, owner st lggr := logger.Named(h.lggr, "WorkflowEngine.Module") lggr = logger.With(lggr, "workflowID", workflowID, "workflowName", name, "workflowOwner", owner) var sdkName string - h.emitterMu.RLock() - labeler := h.emitter - h.emitterMu.RUnlock() moduleConfig := &host.ModuleConfig{ Logger: lggr, - Labeler: labeler, MemoryLimiter: h.engineLimiters.WASMMemorySize, MaxCompressedBinaryLimiter: h.engineLimiters.WASMCompressedBinarySize, MaxDecompressedBinaryLimiter: h.engineLimiters.WASMBinarySize, @@ -878,17 +874,13 @@ func (h *eventHandler) engineFactoryFn(ctx context.Context, workflowID, owner st h.lggr.Debugw("Creating module for workflowID", "workflowID", workflowID) - module, err := host.NewModule(ctx, moduleConfig, binary, host.WithDeterminism()) + module, err := host.NewModule(ctx, moduleConfig, binary) if err != nil { return nil, err } h.lggr.Debugw("Finished creating module for workflowID", "workflowID", workflowID) - if module.IsLegacyDAG() { // V1 aka "DAG" - return nil, errors.New("legacy DAG workflows are not supported") - } - // V2 aka "NoDAG" // Wrap the local WASM module in a RequirementSelectingModule that routes // triggers with a TEE requirement to the ConfidentialModule (which delegates @@ -965,7 +957,7 @@ func (h *eventHandler) createEngineModule( if storeErr != nil { h.lggr.Warnw("Failed to cache module binary to disk, LRU eviction disabled for this workflow", "workflowID", workflowID, "err", storeErr) } else { - evictable := NewEvictableModule(module, moduleConfig, h.moduleStore, workflowID, h.moduleEngineVersion, nil, h.cacheMetrics, int64(len(binary)), host.WithDeterminism()) + evictable := NewEvictableModule(module, moduleConfig, h.moduleStore, workflowID, h.moduleEngineVersion, nil, h.cacheMetrics, int64(len(binary))) h.moduleLRU.Register(workflowID, evictable) engineModule = evictable }