Description:
We need to ensure that the current collator task can be safely dropped. The following collator methods, which are invoked in the async dispatcher, must be made cancel-safe:
init_collator_wrapper
wait_state_and_try_collate_wrapper
wait_state_and_do_collate_wrapper
Context:
During collation, the following state is modified:
- Anchor cache
- Reader state (buffers, etc.)
- Queue state and statistics
If the collator task is simply stopped and restarted, it will execute incorrectly because of inconsistent state.
Current state:
We already have a cancellation mechanism using a cancellation token, but it is fully handled manually.
Task:
Investigate and design a cancel-safety mechanism so that collator tasks can be spawned in Tokio and used directly in select without requiring manual cancellation handling.
Description:
We need to ensure that the current collator task can be safely dropped. The following collator methods, which are invoked in the async dispatcher, must be made cancel-safe:
init_collator_wrapperwait_state_and_try_collate_wrapperwait_state_and_do_collate_wrapperContext:
During collation, the following state is modified:
If the collator task is simply stopped and restarted, it will execute incorrectly because of inconsistent state.
Current state:
We already have a cancellation mechanism using a cancellation token, but it is fully handled manually.
Task:
Investigate and design a cancel-safety mechanism so that collator tasks can be spawned in Tokio and used directly in
selectwithout requiring manual cancellation handling.