Skip to content

Add BatchSetUserDONOverride operation for Workflow Registry#22373

Open
ibrajer wants to merge 3 commits into
developfrom
wfreg-batch-set-user-don-override
Open

Add BatchSetUserDONOverride operation for Workflow Registry#22373
ibrajer wants to merge 3 commits into
developfrom
wfreg-batch-set-user-don-override

Conversation

@ibrajer
Copy link
Copy Markdown
Contributor

@ibrajer ibrajer commented May 11, 2026

Requires

Supports

@ibrajer ibrajer self-assigned this May 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 11, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
Test_CCIPMessaging_EVM2TON/message_to_contract_receiver Logs ↗︎
Test_CCIPMessaging_EVM2TON Logs ↗︎

View Full Report ↗︎Docs

@ibrajer ibrajer marked this pull request as ready for review May 12, 2026 07:49
@ibrajer ibrajer requested a review from a team as a code owner May 12, 2026 07:49
Copilot AI review requested due to automatic review settings May 12, 2026 07:49
@ibrajer ibrajer requested a review from a team as a code owner May 12, 2026 07:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Risk Rating: MEDIUM

Adds a batched “set user DON override” operation/changeset for Workflow Registry v2 so multiple overrides can be applied as a single MCMS BatchOperation (or executed directly without MCMS), plus a small refactor to reduce repeated setup/teardown boilerplate in the configure changeset.

Changes:

  • Introduces BatchSetUserDONOverrideOp that aggregates N setUserDONOverride calls into one MCMS batch (or confirms them sequentially on-chain when not using MCMS).
  • Adds BatchSetUserDONOverride changeset + input validation for override lists (non-empty, non-zero user, non-empty family, no duplicates).
  • Refactors common changeset setup/output logic via prepareWorkflowRegistryDeps and finalizeWorkflowRegistryOutput, and adds tests for the new batched changeset.

Scrupulous human review recommended (high impact areas):

  • BatchSetUserDONOverrideOp MCMS transaction construction (chain selector correctness; calldata/tx targeting; behavior when deps are partially populated).
  • Any behavior changes from bypassing the strategy abstraction for the batched path (esp. how tx opts are constructed and how failures/partial application are handled in non-MCMS mode).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
deployment/cre/workflow_registry/v2/changeset/operations/contracts/configure_workflow_registry_ops.go Adds the new batch operation and extends op deps to optionally include an EVM chain for direct calldata/confirm flows.
deployment/cre/workflow_registry/v2/changeset/configure_workflow_registry.go Adds batch changeset and refactors common deps/proposal-building boilerplate into helper functions.
deployment/cre/workflow_registry/v2/changeset/configure_workflow_registry_test.go Adds unit/integration-style tests for batch preconditions and MCMS/non-MCMS behavior invariants.

Comment on lines +347 to +359
mtx, err := cldfproposalutils.TransactionForChain(input.ChainSelector, deps.Registry.Address().Hex(), tx.Data(), big.NewInt(0), "", nil)
if err != nil {
return BatchSetUserDONOverrideOpOutput{}, fmt.Errorf("failed to build MCMS transaction for %s: %w", entry.User.Hex(), err)
}
mcmsTxs = append(mcmsTxs, mtx)
}

var mergedOp *mcmstypes.BatchOperation
if input.MCMSConfig != nil {
mergedOp = &mcmstypes.BatchOperation{
ChainSelector: mcmstypes.ChainSelector(input.ChainSelector),
Transactions: mcmsTxs,
}
Comment on lines +319 to +330
if len(input.Overrides) == 0 {
return BatchSetUserDONOverrideOpOutput{}, errors.New("must provide at least one override")
}
if deps.Chain == nil {
return BatchSetUserDONOverrideOpOutput{}, errors.New("deps.Chain is required for BatchSetUserDONOverrideOp")
}

// MCMS path uses simulated tx opts to produce calldata without sending; non-MCMS uses the deployer key.
txOpts := deps.Chain.DeployerKey
if input.MCMSConfig != nil {
txOpts = cldf.SimTransactOpts()
}
anirudhwarrier
anirudhwarrier previously approved these changes May 12, 2026
Copy link
Copy Markdown
Contributor

@anirudhwarrier anirudhwarrier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cl-sonarqube-production
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants