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

Fetch constants latest block #616

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"to": "0x8D49f1b4AF30598679D4D37Be4B094da1b459b82",
"data": "0xa3a3fd5d"
},
"0x8ee61584b9d3e010c55f1fa77a803051f5f783385ec75b4e3fc71e199a86184d"
"latest"
],
"response": {
"jsonrpc": "2.0",
Expand Down Expand Up @@ -195,7 +195,7 @@
"to": "0x4c1F6cA213abdbc19b27f2562d7b1A645A019bD9",
"data": "0x29fd065d"
},
"0x8ee61584b9d3e010c55f1fa77a803051f5f783385ec75b4e3fc71e199a86184d"
"latest"
],
"response": {
"jsonrpc": "2.0",
Expand All @@ -218,4 +218,4 @@
"result": "0x0000000000000000000000000000000000000000000000037d3047cdfd698705000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000030af00000000000000000000000000000000000000000000000000000000000030c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002"
}
}
]
]
2 changes: 1 addition & 1 deletion src/modules/accounting/accounting.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def _get_generic_extra_data(self, blockstamp: ReferenceBlockStamp) -> GenericExt
logger.info({'msg': 'Calculate stuck validators.', 'value': stuck_validators})
exited_validators = self.lido_validator_state_service.get_lido_newly_exited_validators(blockstamp)
logger.info({'msg': 'Calculate exited validators.', 'value': exited_validators})
orl = self.w3.lido_contracts.oracle_report_sanity_checker.get_oracle_report_limits(blockstamp.block_hash)
orl = self.w3.lido_contracts.oracle_report_sanity_checker.get_oracle_report_limits()
return stuck_validators, exited_validators, orl

# fetches validators_count, cl_balance, withdrawal_balance, el_vault_balance, shares_to_burn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
class OracleReportSanityCheckerContract(ContractInterface):
abi_path = './assets/OracleReportSanityChecker.json'

@lru_cache(maxsize=1)
def get_oracle_report_limits(self, block_identifier: BlockIdentifier = 'latest') -> OracleReportLimits:
"""
Returns the limits list for the Lido's oracle report sanity checks
Expand Down
1 change: 0 additions & 1 deletion src/providers/execution/contracts/withdrawal_queue_nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def is_paused(self, block_identifier: BlockIdentifier = 'latest') -> bool:
})
return response

@lru_cache(maxsize=1)
def max_batches_length(self, block_identifier: BlockIdentifier = 'latest') -> int:
"""
maximal length of the batch array provided for prefinalization.
Expand Down
7 changes: 2 additions & 5 deletions src/services/exit_order_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from src.web3py.extensions.lido_validators import LidoValidator, StakingModule, NodeOperator, NodeOperatorLimitMode
from src.web3py.types import Web3


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -149,9 +148,8 @@ def _calculate_lido_stats(self):
self.node_operators_stats[gid].soft_exit_to = self.node_operators_stats[gid].node_operator.target_validators_count

def _load_blockchain_state(self):
self.max_validators_to_exit = self.w3.lido_contracts.oracle_report_sanity_checker.get_oracle_report_limits(
self.blockstamp.block_hash,
).max_validator_exit_requests_per_report
self.max_validators_to_exit = (self.w3.lido_contracts.oracle_report_sanity_checker.get_oracle_report_limits()
.max_validator_exit_requests_per_report)

self.no_penetration_threshold = self.w3.lido_contracts.oracle_daemon_config.node_operator_network_penetration_threshold_bp(
block_identifier=self.blockstamp.block_hash,
Expand Down Expand Up @@ -180,7 +178,6 @@ def _get_delayed_validators(self) -> dict[NodeOperatorGlobalIndex, int]:

result = {}
for gid, validators_list in lido_validators.items():

def is_delayed(validator: LidoValidator) -> bool:
requested_to_exit = validator.index <= last_requested_to_exit[gid]
recently_requested_to_exit = validator.index in recent_requests[gid]
Expand Down
2 changes: 1 addition & 1 deletion src/services/safe_border.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(
self._retrieve_constants()

def _retrieve_constants(self):
limits_list = self.w3.lido_contracts.oracle_report_sanity_checker.get_oracle_report_limits(self.blockstamp.block_hash)
limits_list = self.w3.lido_contracts.oracle_report_sanity_checker.get_oracle_report_limits()

self.finalization_default_shift = math.ceil(
limits_list.request_timestamp_margin / (self.chain_config.slots_per_epoch * self.chain_config.seconds_per_slot)
Expand Down
2 changes: 1 addition & 1 deletion src/services/withdrawal.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _calculate_finalization_batches(
available_eth: int,
until_timestamp: int
) -> list[int]:
max_length = self.w3.lido_contracts.withdrawal_queue_nft.max_batches_length(self.blockstamp.block_hash)
max_length = self.w3.lido_contracts.withdrawal_queue_nft.max_batches_length()

state = BatchState(
remaining_eth_budget=available_eth,
Expand Down
Loading