mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-02 04:14:33 +00:00
Use head state for exit verification
This commit is contained in:
@@ -2173,12 +2173,13 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
&self,
|
&self,
|
||||||
exit: SignedVoluntaryExit,
|
exit: SignedVoluntaryExit,
|
||||||
) -> Result<ObservationOutcome<SignedVoluntaryExit, T::EthSpec>, Error> {
|
) -> Result<ObservationOutcome<SignedVoluntaryExit, T::EthSpec>, Error> {
|
||||||
// NOTE: this could be more efficient if it avoided cloning the head state
|
let head_snapshot = self.head().snapshot;
|
||||||
let wall_clock_state = self.wall_clock_state()?;
|
let head_state = &head_snapshot.beacon_state;
|
||||||
|
|
||||||
Ok(self
|
Ok(self
|
||||||
.observed_voluntary_exits
|
.observed_voluntary_exits
|
||||||
.lock()
|
.lock()
|
||||||
.verify_and_observe(exit, &wall_clock_state, &self.spec)
|
.verify_and_observe(exit, head_state, &self.spec)
|
||||||
.map(|exit| {
|
.map(|exit| {
|
||||||
// this method is called for both API and gossip exits, so this covers all exit events
|
// this method is called for both API and gossip exits, so this covers all exit events
|
||||||
if let Some(event_handler) = self.event_handler.as_ref() {
|
if let Some(event_handler) = self.event_handler.as_ref() {
|
||||||
|
|||||||
Reference in New Issue
Block a user