Skip to content

Commit abd8981

Browse files
barajeelmattsse
andauthored
fix: latest_state returning last_valid instead of latest received (paradigmxyz#15565)
Co-authored-by: Matthias Seitz <[email protected]>
1 parent 8653a47 commit abd8981

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crates/engine/primitives/src/forkchoice.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ impl ForkchoiceStateTracker {
7575
/// Returns the latest received [`ForkchoiceState`].
7676
///
7777
/// Caution: this can be invalid.
78-
pub const fn latest_state(&self) -> Option<ForkchoiceState> {
79-
self.last_valid
78+
pub fn latest_state(&self) -> Option<ForkchoiceState> {
79+
self.latest.as_ref().map(|s| s.state)
8080
}
8181

8282
/// Returns the last valid [`ForkchoiceState`].
@@ -122,7 +122,6 @@ impl ForkchoiceStateTracker {
122122
/// Represents a forkchoice update and tracks the status we assigned to it.
123123
#[derive(Debug, Clone)]
124124
pub(crate) struct ReceivedForkchoiceState {
125-
#[cfg_attr(not(test), expect(dead_code))]
126125
state: ForkchoiceState,
127126
status: ForkchoiceStatus,
128127
}

0 commit comments

Comments
 (0)