-
Notifications
You must be signed in to change notification settings - Fork 68
Fixed runTask returns undefined for eventTrigger problem #331
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
chrisli30
commented
Jun 17, 2025
- Fixed operator eventTrigger not capturing all ERC20 transfer problem (Fixed operator eventTrigger not capturing all ERC20 transfer problem #329)
- Fix operator failed to notify aggregator on task trigger problem - Fixed critical bug in MustStart() where tasks were loaded using storage key instead of task ID, added database fallback, enhanced variable resolution with dual-access mapping, improved preprocessing in node runners, added comprehensive logging
- Fix unnecessary stack trace in event trigger query optimization warning - Changed Warn to Info level since this is informational, not an error requiring debugging
- Fixed runTask returns undefined for eventTrigger problem
…xed critical bug in MustStart() where tasks were loaded using storage key instead of task ID, added database fallback, enhanced variable resolution with dual-access mapping, improved preprocessing in node runners, added comprehensive logging
…ng - Changed Warn to Info level since this is informational, not an error requiring debugging
b6e4083
to
4231ce0
Compare
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 fixes event-trigger handling and runTask output, enhances variable preprocessing and dual-access mapping (camelCase and snake_case), improves logging levels, and updates tests for new behaviors.
- Added dual-access mapping (
CreateDualAccessMap
) for node outputs and inputs to support both naming conventions. - Refactored text preprocessing in ETH transfer and contract read processors to apply variable mapping.
- Extended engine startup and aggregation to use task IDs correctly, added DB fallback, and enriched event data.
- Changed log level for duplicate-query warning and optimized stack trace visibility.
- Updated numerous tests to reflect camelCase key usage and added comprehensive dual-access tests.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
core/taskengine/vm_secrets_test.go | Inlined key collection in tests; potential unmatched braces issue. |
core/taskengine/vm_runner_eth_transfer.go | Preprocesses destination and amount with variable mapping. |
core/taskengine/vm_runner_contract_read.go | Preprocesses call data and method name before executing contract calls. |
core/taskengine/vm_runner_branch.go | Unified condition preprocessing using variable mapping. |
core/taskengine/vm.go | Added dual-access mapping for output vars and trigger inputs. |
core/taskengine/trigger/event.go | Changed duplicate-query warning from Warn to Info. |
core/taskengine/smart_variable_resolution_test.go | Added tests for dual-access variable support and debug helpers. |
core/taskengine/run_node_immediately.go | Applied dual-access mapping to VM inputs; removed original key-logging args. |
core/taskengine/executor_test.go | Updated filter expressions to use camelCase. |
core/taskengine/engine_trigger_output_test.go | Updated trigger data mapping tests to expect camelCase keys. |
core/taskengine/engine.go | Fixed startup task ID loading, added DB fallback, enriched event triggers. |
core/taskengine/enrich and mapping methods | Improved event enrichment logging and mapping, updated helper signatures. |
Comments suppressed due to low confidence (4)
core/taskengine/vm_runner_branch.go:183
- [nitpick] Both branches call
preprocessTextWithVariableMapping
, making theif strings.Contains
branch redundant. You can simplify this to a single call topreprocessTextWithVariableMapping
regardless of template delimiters.
processedExpression = r.vm.preprocessText(processedExpression)
core/taskengine/vm_runner_contract_read.go:94
- [nitpick] The variables
callData
andcalldata
are very similar and may be confusing. Consider renaming the preprocessed string topreprocessedCallData
to clearly distinguish it from the byte slicecalldata
.
callData := r.vm.preprocessTextWithVariableMapping(methodCall.CallData)
core/taskengine/engine_trigger_output_test.go:260
- [nitpick] The tests now cover camelCase keys but no longer verify snake_case fallback. To fully validate dual-access mapping, consider adding assertions that
result
also contains the snake_case equivalents (e.g.,log_index
).
require.Contains(t, result, "logIndex", "logIndex field should be present")
core/taskengine/vm_secrets_test.go:249
- It looks like the closing braces for the
if
block and test function are misaligned after inlining key collection. This will cause a compilation error. Please ensure you add the missing}
to properly close theif
and theTestCollectInputsIncludesSecrets
function.
t.Errorf("test_var.data not found in CollectInputs output, available keys: %v", keys)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix operator failed to notify aggregator on task trigger problem - Fixed critical bug in MustStart() where tasks were loaded using storage key instead of task ID, added database fallback, enhanced variable resolution with dual-access mapping, improved preprocessing in node runners, added comprehensive logging * Fix unnecessary stack trace in event trigger query optimization warning - Changed Warn to Info level since this is informational, not an error requiring debugging * Fixed runTask returns undefined for eventTrigger problem * Update core/taskengine/engine.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * clean up and addressed copilot’s comments * Fixed the format of test file --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix operator failed to notify aggregator on task trigger problem - Fixed critical bug in MustStart() where tasks were loaded using storage key instead of task ID, added database fallback, enhanced variable resolution with dual-access mapping, improved preprocessing in node runners, added comprehensive logging * Fix unnecessary stack trace in event trigger query optimization warning - Changed Warn to Info level since this is informational, not an error requiring debugging * Fixed runTask returns undefined for eventTrigger problem * Update core/taskengine/engine.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * clean up and addressed copilot’s comments * Fixed the format of test file --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>