Skip to content

Added EventCondition to EventTrigger #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 20, 2025
Merged

Conversation

chrisli30
Copy link
Member

No description provided.

Copilot

This comment was marked as outdated.

Copy link
Contributor

@Copilot 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

This PR adds support for conditional event filtering by extending the EventTrigger protobuf, implementing new evaluation logic in the event processor, and hardening message handling in the operator.

  • Introduces contract_abi and conditions fields to EventTrigger and defines a new EventCondition message in avs.proto.
  • Implements evaluateEventConditions and per-field evaluation functions in event.go, with unit tests covering conditional logic.
  • Adds nil checks in worker_loop.go, updates task ID fallback in process_message.go, and refines batched notification logic in engine.go.

Reviewed Changes

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

Show a summary per file
File Description
protobuf/avs.proto Added contract_abi and conditions to EventTrigger, defined EventCondition.
operator/worker_loop.go Added nil checks for TaskMetadata and Trigger in StreamMessages.
operator/process_message.go Fallback to resp.Id when TaskMetadata is nil for remove operations.
core/taskengine/trigger/event_conditional_test.go New tests for single, multiple, missing, and invalid ABI conditions.
core/taskengine/trigger/event.go Inserted conditional filtering logic, ABI parsing, and evaluation routines.
core/taskengine/engine.go Skips TaskMetadata for cancel/delete operations, warns on batched monitors.
Comments suppressed due to low confidence (1)

core/taskengine/trigger/event.go:892

  • There’s no test covering negative values for signed integer conditions. Add unit tests for int256 conditions where the event field is negative to ensure correct two's complement handling.
func (t *EventTrigger) evaluateIntCondition(fieldValue interface{}, operator, expectedValue string) bool {

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.

1 participant