-
Notifications
You must be signed in to change notification settings - Fork 68
Renovate EventTrigger—add metadata, applyToFields, and change output to Value type #340
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 refactors event trigger outputs to use structured google.protobuf.Value
, adds metadata and decimal formatting for contract reads, consolidates error enums under ErrorCode
, and improves test and Makefile targets.
- Switch EventTrigger and Run* responses to use
Value
instead of oneof fields. - Introduce
MethodCall
support andbuildStructuredDataWithDecimalFormatting
in contract reads. - Replace old
Error
enum with the unifiedErrorCode
and update references.
Reviewed Changes
Copilot reviewed 29 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
protobuf/avs.proto | Replaced oneof outputs with google.protobuf.Value data , added MethodCall , and unified error codes into ErrorCode . |
operator/worker_loop.go | Updated NotifyTriggers payload to send structured Value instead of EVM log oneof. |
core/taskengine/vm_runner_contract_read.go | Added buildStructuredDataWithDecimalFormatting and support for decimal formatting metadata. |
core/taskengine/engine.go | Removed enrichEventTriggerFromOperatorData , logging only structured data, and updated error code mappings. |
Makefile | Clarified audit , test , and test/cover descriptions; added test/integration and test/all targets. |
Comments suppressed due to low confidence (2)
core/taskengine/vm_runner_contract_read.go:93
- Consider adding unit tests for
buildStructuredDataWithDecimalFormatting
to verify decimal formatting logic across various edge cases (e.g., zero decimals, no fields to format).
func (r *ContractReadProcessor) buildStructuredDataWithDecimalFormatting(method *abi.Method, result []interface{}, decimalsValue *big.Int, fieldsToFormat []string) ([]*avsproto.ContractReadNode_MethodResult_StructuredField, map[string]interface{}) {
core/taskengine/tenderly_client_integration_test.go:20
- The test notes skipping when
TENDERLY_API_KEY
is missing, but does not actually skip; add at.Skip()
orrequire.NotEmpty(t, os.Getenv("TENDERLY_API_KEY"))
guard to avoid failures in environments without the key.
// Skip if no Tenderly API key - this requires real network calls
operator/worker_loop.go
Outdated
o.logger.Error("Failed to create structured event data", "error", err) | ||
continue | ||
} | ||
|
||
if resp, err := o.nodeRpcClient.NotifyTriggers(context.Background(), &avspb.NotifyTriggersReq{ |
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.
Use the passed ctx
instead of context.Background()
when calling NotifyTriggers
so that cancellation and deadlines propagate correctly.
if resp, err := o.nodeRpcClient.NotifyTriggers(context.Background(), &avspb.NotifyTriggersReq{ | |
if resp, err := o.nodeRpcClient.NotifyTriggers(ctx, &avspb.NotifyTriggersReq{ |
Copilot uses AI. Check for mistakes.
This pull request introduces changes across multiple areas, including workflow configuration, Makefile updates, error code adjustments, and refactoring of event handling and enrichment logic. The most significant updates focus on improving error handling consistency, simplifying event enrichment processes, and enhancing test organization.
Workflow Configuration Updates:
.github/workflows/run-test-on-pr.yml
: AddedTENDERLY_API_KEY
to the environment variables to support integrations requiring this API key.Makefile Enhancements:
Makefile
: Updated descriptions foraudit
,test
, andtest/cover
targets to clarify the exclusion of long-running integration tests. Introduced new targetstest/integration
andtest/all
for debugging and exhaustive testing purposes. [1] [2] [3]Error Code Adjustments:
aggregator/rpc_server.go
andcore/taskengine/engine.go
: Replaced deprecated error enums (e.g.,avsproto.Error_*
) with updated enums (avsproto.ErrorCode_*
) for consistency and clarity in error handling. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Event Handling Refactor:
core/taskengine/engine.go
: Refactored event enrichment logic to remove theenrichEventTriggerFromOperatorData
function and its associated complexity. Event enrichment is now handled during parsing, leveraging structured data directly. Simplified logging for event triggers. [1] [2]Test Organization Improvements:
Makefile
: Introduced a dedicatedtest/integration
target for debugging long-running integration tests and atest/all
target for running all tests, including integration tests, outside of CI workflows.