Skip to content

Commit 1da556e

Browse files
committed
Use head state for exit verification
1 parent a53830f commit 1da556e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,12 +2173,13 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
21732173
&self,
21742174
exit: SignedVoluntaryExit,
21752175
) -> Result<ObservationOutcome<SignedVoluntaryExit, T::EthSpec>, Error> {
2176-
// NOTE: this could be more efficient if it avoided cloning the head state
2177-
let wall_clock_state = self.wall_clock_state()?;
2176+
let head_snapshot = self.head().snapshot;
2177+
let head_state = &head_snapshot.beacon_state;
2178+
21782179
Ok(self
21792180
.observed_voluntary_exits
21802181
.lock()
2181-
.verify_and_observe(exit, &wall_clock_state, &self.spec)
2182+
.verify_and_observe(exit, head_state, &self.spec)
21822183
.map(|exit| {
21832184
// this method is called for both API and gossip exits, so this covers all exit events
21842185
if let Some(event_handler) = self.event_handler.as_ref() {

0 commit comments

Comments
 (0)