-
Notifications
You must be signed in to change notification settings - Fork 68
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
Conversation
There was a problem hiding this 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
andconditions
fields toEventTrigger
and defines a newEventCondition
message inavs.proto
. - Implements
evaluateEventConditions
and per-field evaluation functions inevent.go
, with unit tests covering conditional logic. - Adds nil checks in
worker_loop.go
, updates task ID fallback inprocess_message.go
, and refines batched notification logic inengine.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 {
No description provided.