Detailed explanation of how the Cron module works and why it’s designed this way
BeginBlock
or EndBlock
phase (depending on the schedule’s execution_stage), the module queries for all schedules where:
limit
of schedules per block to prevent resource exhaustion.
wasmtypes.MsgExecuteContract
messages from the stored schedule datalast_execute_height
to the current block heightlimit
parameter (default: configurable) that restricts the number of schedules processed in a single blocklast_execution_height
(schedules that haven’t run in longer get priority)last_execution_height
is still updated to prevent retry loopswasmtypes.MsgExecuteContract
messages:
Parameter | Description | Purpose |
---|---|---|
security_address | Address authorized to remove schedules | Emergency schedule removal |
limit | Maximum schedules executed per block | Resource management and DoS prevention |
execute_ready_schedules
(histogram): Time taken to execute all ready schedules in EndBlockerschedule_count
(gauge): Current number of active schedulesschedule_executions_count
(counter): Total schedule executions, labeled by success/failure and schedule name