-
Notifications
You must be signed in to change notification settings - Fork 68
fix: runTrigger with transfer and use oneOf for transfer_log and evm_log #310
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 enforces mutually exclusive evm_log
and transfer_log
fields via a oneof
in EventTrigger.Output
, updates all code paths and tests to use the new structure, and enhances the event‐trigger search strategy with chain‐specific ranges and improved logging.
- Introduce
oneof output_type
inprotobuf/avs.proto
and regenerate Go bindings. - Refactor operator, VM, engine, and RPC handler to set and read
OutputType
instead of rawEvmLog
/TransferLog
fields. - Improve
runEventTriggerImmediately
with 3-month/6-month search ranges, chunked queries, richer logs, and a 60 s timeout; update docs and tests.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
protobuf/avs.proto | Add oneof output_type to EventTrigger.Output for exclusive fields |
protobuf/avs.pb.go | Regenerate bindings to support the new OutputType interface |
operator/worker_loop.go | Set OutputType when notifying the aggregator |
docs/EventTrigger-Chain-Specific-Search.md | Add a new doc outlining 3- and 6-month chain-specific ranges |
core/testutil/utils.go | Update test util to populate OutputType in dummy trigger data |
core/taskengine/vm_test.go | Update tests to construct oneof data and initialize VM without separate transfer param |
core/taskengine/vm.go | Remove old EvmLog /TransferLog fields; use Event oneof |
core/taskengine/token_metadata_test.go | Adjust test for whitelist-only metadata behavior |
core/taskengine/token_metadata.go | Change comment to clarify nil return when no RPC client |
core/taskengine/run_node_immediately.go | Switch to chain-specific search ranges, richer logging, and 60 s timeout |
core/taskengine/engine.go | Refactor enrichment to set OutputType for transfer vs. raw events |
core/taskengine/blockchain_constants.go | Add GetBlockSearchRanges and GetChainSearchRanges helpers |
core/taskengine/blockchain_constants_test.go | New tests for block range calculations and slice helper |
Comments suppressed due to low confidence (3)
core/taskengine/vm_test.go:538
- The tests no longer cover the raw EvmLog branch of the new oneof OutputType. Add a test case where only an EvmLog is provided to verify the VM correctly populates and retrieves the EvmLog branch.
func TestEvaluateEvent(t *testing.T) {
core/taskengine/token_metadata_test.go:276
- [nitpick] The test name
TestGetTokenMetadataNotFound
no longer matches its behavior of returning nil metadata without error. Consider renaming it to something likeTestGetTokenMetadataWhitelistOnlyReturnsNil
for clarity.
func TestGetTokenMetadataNotFound(t *testing.T) {
protobuf/avs.proto:164
- [nitpick] Grammar nit:
These shape of data is
is incorrect. Consider changing toThe shape of the data is
orThis shape of data is
.
// These shape of data is https://docs.ethers.org/v6/api/providers/#Log
beda08b
to
f3b6db0
Compare
f3b6db0
to
7b78a5d
Compare
…log (#310) * fix: runTrigger with transfer and use oneOf for transfer_log and evm_log * Fix failing CI/CD and updated test case naming to reflect function * Added more caught error messages * Reduce timeout in runEventTriggerImmediately
No description provided.