flow-go
flow-go copied to clipboard
[FVM] Integrate scheduled callbacks into block execution workflow
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 logicengine/execution/computation/computer/result_collector.go- Result handling updates
Key Features
executeProcessCallback()- Executes callback processing transaction and extracts ready callbacksqueueSystemTransaction()- Enhanced to handle callback transactions in system collection- Automatic callback processing when
ScheduleCallbacksEnabledis 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
- Process Phase: Execute callback processor transaction to identify ready callbacks
- Execute Phase: Generate and execute individual callback transactions based on events
- 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