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

Rename variable to mitigate potentially incorrect accounting for the validators effective balance #628

Merged
merged 1 commit into from
Feb 17, 2025
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
6 changes: 2 additions & 4 deletions src/services/bunker_cases/abnormal_cl_rebase.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import logging
import math

from typing import Sequence, cast

from web3.contract.contract import ContractEvent
from web3.types import EventData

from src.constants import EFFECTIVE_BALANCE_INCREMENT, MIN_ACTIVATION_BALANCE
from src.constants import EFFECTIVE_BALANCE_INCREMENT, LIDO_DEPOSIT_AMOUNT
from src.modules.submodules.types import ChainConfig
from src.providers.consensus.types import Validator
from src.providers.keys.types import LidoKey
Expand All @@ -19,7 +18,6 @@
from src.web3py.extensions.lido_validators import LidoValidator, LidoValidatorsProvider
from src.web3py.types import Web3


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -303,7 +301,7 @@ def calculate_validators_count_diff_in_gwei(
validators_diff = len(ref_validators) - len(prev_validators)
if validators_diff < 0:
raise ValueError("Validators count diff should be positive or 0. Something went wrong with CL API")
return Gwei(validators_diff * MIN_ACTIVATION_BALANCE)
return Gwei(validators_diff * LIDO_DEPOSIT_AMOUNT)

@staticmethod
def get_mean_sum_of_effective_balance(
Expand Down
Loading