-
Notifications
You must be signed in to change notification settings - Fork 203
Labels
A-engineArea: engineArea: engineM-good-ai-issueMeta: This is a good task for an LLM or AI to tackle.Meta: This is a good task for an LLM or AI to tackle.M-good-first-issueMeta: Good for newcomersMeta: Good for newcomers
Description
Some Engine tasks have checks to make sure that the EngineSyncState they are working with is valid. Example:
kona/crates/node/engine/src/task_queue/tasks/build/task.rs
Lines 90 to 99 in d7d4b5d
| // Sanity check if the head is behind the finalized head. If it is, this is a critical | |
| // error. | |
| if state.sync_state.unsafe_head().block_info.number < | |
| state.sync_state.finalized_head().block_info.number | |
| { | |
| return Err(BuildTaskError::EngineBuildError(EngineBuildError::FinalizedAheadOfUnsafe( | |
| state.sync_state.unsafe_head().block_info.number, | |
| state.sync_state.finalized_head().block_info.number, | |
| ))); | |
| } |
This feels like a code smell because why would we allow invalid EngineSyncStates to get created only to cause problems downstream?
This task is to add error handling to the apply_update function as well as any other instantiations of EngineSyncState to
- Guarantee all cases of invalid
EngineSyncStateare caught - Cause an error right when the problem occurs, instead of somewhere downstream
- Create and perform validation logic in a single place rather than its various uses
theochap
Metadata
Metadata
Assignees
Labels
A-engineArea: engineArea: engineM-good-ai-issueMeta: This is a good task for an LLM or AI to tackle.Meta: This is a good task for an LLM or AI to tackle.M-good-first-issueMeta: Good for newcomersMeta: Good for newcomers
Type
Projects
Status
Backlog