feat(node/engine): refactor engine tasks. fix sequencer startup logic#2388
feat(node/engine): refactor engine tasks. fix sequencer startup logic#2388
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
clabby
left a comment
There was a problem hiding this comment.
I think we're packing a bit too much into the ForkchoiceTask here; It now has two responsibilities:
- Begin a block building job
- Synchronize the rollup node's view of the forkchoice with the EL
each of which have slight semantic differences in the error handling, response validation checks, etc.
Though I am a fan of the attempt to modularize here. What do you think about separating the concerns here, and renaming ForkchoiceTask (as-is) to SynchronizeTask, and then creating a new task for kicking off block building?
295c3d6 to
4640cf6
Compare
|
I have reworked this PR a little bit to simplify the data flow/updates for the engine state. Now:
|
bec8f5c to
7a87905
Compare
c4e426c to
e7d00b8
Compare
e7d00b8 to
fb9a5c8
Compare
…nchronize task. move block building logic to build task (#2524) ## Description Attempt at cleaning-up the engine and restoring the behavior from pre-refactor https://github.com/op-rs/kona/pull/2388/files. In particular: - Split up the forkchoice task into separated build and synchronize logic. The synchronize logic is now closer to the pre #2388 state - Restore the build FCU method in the build task. Ensure that the side-effects match the pre-#2388 state - Audit the other tasks and ensure the composition (if any), follow the side-effects from #2388 - Remove the `Forkchoice` task from the `EngineTask`s.
…op-rs/kona#2388) ## Description This PR refactors the core logic of the engine task handler. In particular, it moves duplicate code from the build and the insert unsafe tasks to the forkchoice task. Changes: - Add an associated `Output` type for the `EngineTaskExt` trait which allows the implementors of this trait to be composed. In particular, the `ForkchoiceTask` may returns the payload id that was inserted in the EL, which can be used by the `BuildTask` to consolidate the payload into the engine state. - Allows the `ForkchoiceTask` to directly insert newly built payload attributes into the EL (by adding an `Option<OpAttributeWithParent>` argument to the `ForkchoiceTask`). This allows to refactors both calls to the `FCU` inside the `BuildTask` using the `ForkchoiceTask` and avoids manually handling the forkchoice updates - Moves the `PayloadStatus` verification logic to the `ForkchoiceTask` to avoid having to perform the same logic in both the `BuildTask` and the `InsertUnsafeTask`, which allows to fix the sequencer kickstart issue described in op-rs/kona#2372 Close op-rs/kona#2372 ## Potential follow-ups - Remove the clones inside the engine tasks - Refactor the `new_payload` logic into an engine task to remove duplicate code in the `InsertUnsafe` and `Build`Tasks
…nchronize task. move block building logic to build task (op-rs/kona#2524) ## Description Attempt at cleaning-up the engine and restoring the behavior from pre-refactor https://github.com/op-rs/kona/pull/2388/files. In particular: - Split up the forkchoice task into separated build and synchronize logic. The synchronize logic is now closer to the pre op-rs/kona#2388 state - Restore the build FCU method in the build task. Ensure that the side-effects match the pre-#2388 state - Audit the other tasks and ensure the composition (if any), follow the side-effects from op-rs/kona#2388 - Remove the `Forkchoice` task from the `EngineTask`s.
…op-rs/kona#2388) ## Description This PR refactors the core logic of the engine task handler. In particular, it moves duplicate code from the build and the insert unsafe tasks to the forkchoice task. Changes: - Add an associated `Output` type for the `EngineTaskExt` trait which allows the implementors of this trait to be composed. In particular, the `ForkchoiceTask` may returns the payload id that was inserted in the EL, which can be used by the `BuildTask` to consolidate the payload into the engine state. - Allows the `ForkchoiceTask` to directly insert newly built payload attributes into the EL (by adding an `Option<OpAttributeWithParent>` argument to the `ForkchoiceTask`). This allows to refactors both calls to the `FCU` inside the `BuildTask` using the `ForkchoiceTask` and avoids manually handling the forkchoice updates - Moves the `PayloadStatus` verification logic to the `ForkchoiceTask` to avoid having to perform the same logic in both the `BuildTask` and the `InsertUnsafeTask`, which allows to fix the sequencer kickstart issue described in #2372 Close #2372 ## Potential follow-ups - Remove the clones inside the engine tasks - Refactor the `new_payload` logic into an engine task to remove duplicate code in the `InsertUnsafe` and `Build`Tasks
Description
This PR refactors the core logic of the engine task handler. In particular, it moves duplicate code from the build and the insert unsafe tasks to the forkchoice task.
Changes:
Outputtype for theEngineTaskExttrait which allows the implementors of this trait to be composed. In particular, theForkchoiceTaskmay returns the payload id that was inserted in the EL, which can be used by theBuildTaskto consolidate the payload into the engine state.ForkchoiceTaskto directly insert newly built payload attributes into the EL (by adding anOption<OpAttributeWithParent>argument to theForkchoiceTask). This allows to refactors both calls to theFCUinside theBuildTaskusing theForkchoiceTaskand avoids manually handling the forkchoice updatesPayloadStatusverification logic to theForkchoiceTaskto avoid having to perform the same logic in both theBuildTaskand theInsertUnsafeTask, which allows to fix the sequencer kickstart issue described in feat(node/service): Sequencer startup routine #2372Close #2372
Potential follow-ups
new_payloadlogic into an engine task to remove duplicate code in theInsertUnsafeandBuildTasks