Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Feat: add more logs to code and log validators request in ejector module" #482

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading