mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-28 00:28:20 -05:00
feat: scaffold make canonical (#9697)
This commit is contained in:
@@ -456,12 +456,21 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Attempts to make the given target canonical.
|
||||
///
|
||||
/// This will update the tracked canonical in memory state and do the necessary housekeeping.
|
||||
const fn make_canonical(&self, target: B256) {
|
||||
// TODO: implement state updates and shift canonical state
|
||||
}
|
||||
|
||||
/// Handles a tree event.
|
||||
fn on_tree_event(&self, event: TreeEvent) {
|
||||
match event {
|
||||
TreeEvent::TreeAction(action) => {
|
||||
// TODO: handle
|
||||
}
|
||||
TreeEvent::TreeAction(action) => match action {
|
||||
TreeAction::MakeCanonical(target) => {
|
||||
self.make_canonical(target);
|
||||
}
|
||||
},
|
||||
TreeEvent::BackfillAction(action) => {
|
||||
self.emit_event(EngineApiEvent::BackfillAction(action));
|
||||
}
|
||||
@@ -977,6 +986,9 @@ where
|
||||
) -> ProviderResult<TreeOutcome<OnForkChoiceUpdated>> {
|
||||
if let Some(on_updated) = self.pre_validate_forkchoice_update(state)? {
|
||||
self.state.forkchoice_state_tracker.set_latest(state, on_updated.forkchoice_status());
|
||||
|
||||
// TODO: make canonical and process payload attributes if valid
|
||||
|
||||
return Ok(TreeOutcome::new(on_updated))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user