Skip to content

Commit

Permalink
fix: do not fail on missing digests for stucks
Browse files Browse the repository at this point in the history
In the case the initial epoch is set in the way the starting epoch of a
reporting frame is set before enactment of a vote connecting CSM to the
staking router, the existing sanity check prevents oracles from building
report.
  • Loading branch information
madlabman committed Nov 22, 2024
1 parent 6f1969c commit 77dd623
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/modules/csm/csm.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,13 @@ def stuck_operators(self, blockstamp: ReferenceBlockStamp) -> set[NodeOperatorId
blockstamp.slot_number,
)
)
digests = self.w3.lido_validators.get_lido_node_operators_by_modules(l_blockstamp).get(self.module_id)
if digests is None:
raise InconsistentData(f"No Node Operators digests found for {self.module_id=}")
stuck.update(no.id for no in digests if no.stuck_validators_count > 0)

nos_by_module = self.w3.lido_validators.get_lido_node_operators_by_modules(l_blockstamp)
if self.module_id in nos_by_module:
stuck.update(no.id for no in nos_by_module[self.module_id] if no.stuck_validators_count > 0)
else:
logger.warning("No CSM digest at blockstamp=%s, module was not added yet?", l_blockstamp)

stuck.update(
self.w3.csm.get_operators_with_stucks_in_range(
l_blockstamp.block_hash,
Expand Down

0 comments on commit 77dd623

Please sign in to comment.