Skip to content

Drop workflow DON ID fallback for trigger events - #812

Open
tarcisiozf wants to merge 2 commits into
mainfrom
cre-6882-drop-workflow-don-id-fallback
Open

tarcisiozf wants to merge 2 commits into
mainfrom
cre-6882-drop-workflow-don-id-fallback

Conversation

@tarcisiozf

@tarcisiozf tarcisiozf commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

This pull request refines how trigger events are labeled with the DON (Decentralized Oracle Network) ID for both EVM and HTTP trigger plugins. The main improvement is to consistently label events with the sending capability DON ID when it is known, and to leave the label unset when it is unknown, rather than falling back to the consumer workflow's DON ID. This avoids potential mislabeling in multi-DON or legacy node scenarios and ensures more accurate event metadata. The logic for labeling has been centralized into a reusable helper function, and new unit tests have been added to verify this behavior.

Labeling and event metadata improvements:

  • Introduced the withCapabilityDonID helper function in both chain_capabilities/evm/trigger/trigger.go and http_trigger/trigger/connector_handler.go to consistently label trigger events with the sending capability DON ID only when it is known, leaving the label unset otherwise.
  • Updated the logic in both EVM and HTTP trigger plugins to use the new helper, removing the previous fallback to the consumer workflow's DON ID, and updated related comments and field descriptions for clarity.

Testing improvements:

  • Added unit tests for the withCapabilityDonID function in both EVM and HTTP trigger plugins to verify correct labeling behavior when the DON ID is known or unknown.

@tarcisiozf
tarcisiozf force-pushed the cre-6882-drop-workflow-don-id-fallback branch from 827b09a to 09fe7aa Compare October 7, 2026 14:04
@tarcisiozf
tarcisiozf requested a balanced review from Copilot October 7, 2026 14:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

HTTP trigger initialization documentation still incorrectly claims that unknown capability DON IDs fall back to workflow DON IDs.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Removes workflow DON ID fallback so trigger events only identify a known sending capability DON.

Changes:

  • Adds conditional DON ID labeling helpers for EVM and HTTP triggers.
  • Adds unit coverage for known and unknown DON IDs.
  • Updates EVM metadata documentation.
File Description
http_trigger/​trigger/​connector_handler.go Removes fallback and conditionally labels HTTP events.
http_trigger/​trigger/​don_id_label_test.go Tests HTTP DON ID labeling.
chain_capabilities/​evm/​trigger/​trigger.go Removes fallback and conditionally labels EVM events.
chain_capabilities/​evm/​trigger/​don_id_label_test.go Tests EVM DON ID labeling.
chain_capabilities/​evm/​main.go Documents unknown capability DON behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread http_trigger/trigger/connector_handler.go
@cl-sonarqube-production

Copy link
Copy Markdown

@tarcisiozf
tarcisiozf marked this pull request as ready for review October 7, 2026 18:41
@tarcisiozf
tarcisiozf requested review from a team as code owners October 7, 2026 18:41

@bolekk bolekk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

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