Skip to content

Pad ethereum address with zero to fix transfer monitoring; fix operator monitoring re-assignment #335

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 7 commits into from
Jun 18, 2025

Conversation

chrisli30
Copy link
Member

This pull request introduces significant changes to improve task management, logging, and operator connection handling in the core/taskengine package, as well as updates to the cmd/status.go file for enhanced system status reporting. Key themes include enhanced logging for debugging, improved operator lifecycle management, and better handling of orphaned tasks.

Enhanced Logging for Debugging

  • core/taskengine/engine.go: Added detailed logs for task creation, including node and edge breakdowns, as well as final counts for successful creation. Logs now include connection stability checks and task assignment details during operator reconnections. [1] [2] [3] [4]

Operator Lifecycle Management

  • core/taskengine/engine.go: Introduced ticker context and cancellation mechanisms to manage operator lifecycle more effectively, ensuring proper cleanup during disconnections and reconnections. Added safeguards to prevent race conditions during operator reconnections. [1] [2] [3]

Handling Orphaned Tasks

  • core/taskengine/engine.go: Improved orphaned task reassignment logic, ensuring tasks are reclaimed when operators reconnect. Added aggregated logging for reassigned tasks and introduced checks for active operators before reassignment. [1] [2]

System Status Reporting

  • cmd/status.go: Overhauled the status command to display detailed system status, including active tasks in the database, troubleshooting tips, and database initialization checks.

Testing Utilities

  • core/taskengine/engine.go: Added AddTaskForTesting method to facilitate direct task injection into the engine for testing purposes, bypassing database storage and validation.

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 enhances operator reconnection and task assignment robustness, adds comprehensive integration tests, and improves system status reporting and REST processing.

  • Implements context-based ticker management and ensures task tracking resets on any reconnection
  • Adds integration tests for ticker context races, operator reconnection flows, orphaned task reclamation, and monotonic clock behaviors
  • Introduces a new status CLI command and updates REST and event-trigger components for JSON-aware processing and Ethereum address padding

Reviewed Changes

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

Show a summary per file
File Description
integration_test/ticker_context_test.go Tests for ticker context cancellation and connection stabilization
integration_test/orphaned_task_reclamation_test.go Tests orphaned task reclamation and monotonic clock reset
integration_test/operator_reconnection_test.go End-to-end and race-condition tests for operator reconnection
integration_test/README.md Documentation for integration tests
docs/Operator_Reconnection_and_Task_Assignment.md Detailed docs on reconnection and task assignment fixes
core/taskengine/vm_runner_rest.go Added JSON-aware template processing for REST bodies
core/taskengine/trigger/event.go Added padAddressIfNeeded for Ethereum topic filtering
core/taskengine/engine.go Major engine updates: ticker contexts, orphaned task reclamation, logging
cmd/status.go New status command for system health reporting
aggregator/rpc_server.go Removed outdated commented logging
Comments suppressed due to low confidence (1)

cmd/status.go:25

  • The new status command lacks automated tests. Add unit or integration tests to validate output formatting and error conditions (e.g., no DB, empty tasks).
			fmt.Printf("📊 System Status Report\n")

…status command, fix misleading log message in engine.go, replace fixed 12s sleeps with configurable timeouts in integration tests, support testing.Short() flag for faster test execution, improve test robustness and reduce brittleness
…pdated preprocessJSONWithVariableMapping to use VM's smart variable resolution with fallback support for snake_case to camelCase, fixing CI/CD test failures in TestSmartVariableResolution
@chrisli30 chrisli30 merged commit 6793fb5 into main Jun 18, 2025
16 checks passed
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