Skip to content

Commit

Permalink
Revert "Feat: add more logs to code and log validators request in eje…
Browse files Browse the repository at this point in the history
…ctor module" (#482)
  • Loading branch information
F4ever authored Jun 20, 2024
1 parent 960cfb2 commit 0deeede
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions src/modules/ejector/ejector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import logging
from functools import reduce

Expand Down Expand Up @@ -106,19 +105,6 @@ def build_report(self, blockstamp: ReferenceBlockStamp) -> tuple:

EJECTOR_VALIDATORS_COUNT_TO_EJECT.set(report_data.requests_count)

try:
with open('validators_response.json', 'w') as f:
f.write(
json.dumps([{
**v.__dict__,
'validator': v.validator.__dict__,
} for v in self.w3.cc.get_validators(blockstamp)])
)
except Exception as error: # pylint: disable=W0703
logger.error({'msg': 'Failed to save get_validators response.', 'error': str(error)})
else:
logger.info({'msg': 'Response get_validators from Consensus Client written to validators_response.json.'})

return report_data.as_tuple()

def get_validators_to_eject(self, blockstamp: ReferenceBlockStamp) -> list[tuple[NodeOperatorGlobalIndex, LidoValidator]]:
Expand Down Expand Up @@ -310,12 +296,6 @@ def _get_latest_exit_epoch(self, blockstamp: BlockStamp) -> tuple[EpochNumber, i
max_exit_epoch_number = val_exit_epoch
latest_to_exit_validators_count = 1

logger.info({
'msg': 'Calculate latest exit epoch',
'value': max_exit_epoch_number,
'latest_to_exit_validators_count': latest_to_exit_validators_count,
})

return max_exit_epoch_number, latest_to_exit_validators_count

def _get_sweep_delay_in_epochs(self, blockstamp: ReferenceBlockStamp) -> int:
Expand All @@ -338,11 +318,7 @@ def _get_churn_limit(self, blockstamp: ReferenceBlockStamp) -> int:
self.w3.cc.get_validators(blockstamp),
0,
)
logger.info({'msg': 'Calculate total active validators.', 'value': total_active_validators})

churn_limit = max(MIN_PER_EPOCH_CHURN_LIMIT, total_active_validators // CHURN_LIMIT_QUOTIENT)
logger.info({'msg': 'Calculate churn limit.', 'value': churn_limit})
return churn_limit
return max(MIN_PER_EPOCH_CHURN_LIMIT, total_active_validators // CHURN_LIMIT_QUOTIENT)

def _get_processing_state(self, blockstamp: BlockStamp) -> EjectorProcessingState:
ps = named_tuple_to_dataclass(
Expand Down

0 comments on commit 0deeede

Please sign in to comment.