Skip to content

Clarify Trigger Output Purpose and Remove Unnecessary Manual Trigger Output #359

@chrisli30

Description

@chrisli30

Problem

The current naming and usage of "trigger output" in TriggerTaskReq is confusing and misleading. The field is actually used for simulating trigger conditions during debugging/testing, not for defining actual trigger output data.

Current Confusion

  • Name: "trigger output" suggests it's the output/result of a trigger
  • Reality: It's simulation data to test "would this trigger fire under these conditions?"
  • Manual Trigger Issue: Manual triggers always fire when called - they don't need simulation data

Examples of Proper Usage

// Other triggers need simulation data:
blockTrigger.simulate({ blockNumber: 12345 }) // "What if block 12345 was mined?"
eventTrigger.simulate({ eventData: {...} })   // "What if this event occurred?"
cronTrigger.simulate({ timestamp: 1234567890 }) // "What if it's this time?"

// Manual trigger doesn't need simulation - it just triggers:
manualTrigger.trigger() // "Trigger now!" (no conditions to simulate)

Changes Made

  1. Removed manual trigger output - Manual triggers don't need simulation data
  2. Simplified SDK logic - No longer sends unnecessary trigger output for manual triggers
  3. Maintained functionality - Manual triggers still work correctly (confirmed in aggregator logs)

Recommended Improvements

  1. Rename field: trigger_outputtrigger_simulation_data or debug_conditions
  2. Update documentation: Clarify that this field is for debugging/testing trigger conditions
  3. Protocol cleanup: Consider making this field optional for triggers that don't need simulation

Impact

  • Manual triggers work without unnecessary data
  • Cleaner client code (removed ~20 lines of unnecessary logic)
  • Better conceptual clarity about trigger simulation vs execution
  • Maintained backward compatibility

This change improves the architectural clarity while maintaining full functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions