lidofinance / lido-oracle

Pythonic Lido Oracle daemon
GNU General Public License v3.0
47 stars 27 forks source link

Oracle V4 EPIC #495

Closed F4ever closed 3 weeks ago

F4ever commented 3 months ago

Feature: More detailed logs to VEBO More specified metrics Upgrade dependencies Oracle modules have dynamic version support VEBO V4: Force exits and new eject order AO V4: Multi Third Phase support

Fixes: Zero division error Unhealthy container Transaction submission unhandled exception list_of_dataclasses decorator can't proceed empty lists Negative block number in event logs Docker building fix Fix typos Dockerfile fix: no wget package Oracle backward compitability

Workflows: Add Holesky wf Upgrade docker file Move linters to separate file

Refactoring: Feat: Abstract contract interaction

Tests: Integration tests for contracts interaction

mkurayan commented 2 months ago

I noticed that in merge_validators_with_keys method we do not handle case when kapi returned some dummy validators.

    @staticmethod
    def merge_validators_with_keys(keys: list[LidoKey], validators: list[Validator]) -> list[LidoValidator]:
        """Merging and filter non-lido validators."""
        validators_keys_dict = {validator.validator.pubkey: validator for validator in validators}

        lido_validators = []

        for key in keys:
            if key.key in validators_keys_dict:
                lido_validators.append(LidoValidator(
                    lido_id=key,
                    **asdict(validators_keys_dict[key.key]),
                ))

        return lido_validators

In my opinion, we should consider adding an exception when a key is not found in validators_keys_dict. This could indicate a critical error in the KAPI. Handling this error wouldn’t consume significant resources but could provide valuable feedback.

mkurayan commented 2 months ago

I noticed that in merge_validators_with_keys method we do not handle case when kapi returned some dummy validators.

    @staticmethod
    def merge_validators_with_keys(keys: list[LidoKey], validators: list[Validator]) -> list[LidoValidator]:
        """Merging and filter non-lido validators."""
        validators_keys_dict = {validator.validator.pubkey: validator for validator in validators}

        lido_validators = []

        for key in keys:
            if key.key in validators_keys_dict:
                lido_validators.append(LidoValidator(
                    lido_id=key,
                    **asdict(validators_keys_dict[key.key]),
                ))

        return lido_validators

In my opinion, we should consider adding an exception when a key is not found in validators_keys_dict. This could indicate a critical error in the KAPI. Handling this error wouldn’t consume significant resources but could provide valuable feedback.

@F4ever thanks for explanation that in KAPI keys appear much faster then in CL, that is why KAPI might return keys which not visible in CL yet.