flow-go icon indicating copy to clipboard operation
flow-go copied to clipboard

[FVM] Integrate scheduled callbacks into block execution workflow

Open devbugging opened this issue 4 months ago • 0 comments

Summary

Integrate scheduled callback processing into the block execution workflow, enabling automatic callback processing during system transaction execution when callbacks are enabled.

Changes

Modified Files

  • engine/execution/computation/computer/computer.go - Main integration logic
  • engine/execution/computation/computer/result_collector.go - Result handling updates

Key Features

  • executeProcessCallback() - Executes callback processing transaction and extracts ready callbacks
  • queueSystemTransaction() - Enhanced to handle callback transactions in system collection
  • Automatic callback processing when ScheduleCallbacksEnabled is true
  • Proper transaction ordering: process → execute callbacks → system transaction

Technical Implementation

  • Callbacks execute as part of system chunk processing
  • Process transaction identifies ready callbacks via events
  • Individual callback execution transactions generated dynamically
  • All transactions properly recorded in system collection for verification

Execution Flow

  1. Process Phase: Execute callback processor transaction to identify ready callbacks
  2. Execute Phase: Generate and execute individual callback transactions based on events
  3. System Phase: Execute standard system chunk transaction

Testing

Testing is a follow-up task that needs to be done after I complete adding core-contract for scheduler contract.

Dependencies

  • Requires FVM context infrastructure and callback blueprints from previous PRs
  • Adding core-contract for callback scheduler
  • Ready for production use when feature flag is enabled
  • PR https://github.com/onflow/flow-go/pull/7492
  • PR https://github.com/onflow/flow-go/pull/7493

devbugging avatar Jun 10 '25 10:06 devbugging