Skip to content

Commit

Permalink
Add ProtocolConfig.vault_exiting_validators_threshold attr (#117)
Browse files Browse the repository at this point in the history
* Del ssz dir from pyproject.toml

* Add ProtocolConfig.vault_exiting_validators_threshold attr
  • Loading branch information
evgeny-stakewise authored Sep 18, 2024
1 parent 1d8c403 commit a3cb428
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 1 addition & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sw-utils"
version = "v0.6.22"
version = "v0.6.23"
description = "StakeWise Python utils"
authors = ["StakeWise Labs <[email protected]>"]
license = "GPL-3.0-or-later"
Expand Down Expand Up @@ -36,7 +36,6 @@ exclude_dirs = ["sw_utils/tests/"]

[tool.pylint."pre-commit-hook"]
disable=["C0103", "C0114", "C0115", "C0116", "R0801", "R0903", "W0703", "W1514", "W0511"]
ignore-paths = ["^sw_utils/ssz/.*$"]

[tool.pylint."BASIC"]
good-names = ["i", "el", "e", "w", "f", "w3"]
Expand Down Expand Up @@ -64,10 +63,6 @@ warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true

[[tool.mypy.overrides]]
module = "sw_utils.ssz.*"
ignore_errors = true

[tool.black]
line-length = 100
skip-string-normalization = true
Expand Down
3 changes: 3 additions & 0 deletions sw_utils/protocol_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def build_protocol_config(
if validators_threshold and exit_signature_recover_threshold > validators_threshold:
raise ValueError('Invalid exit signature threshold')

vault_exiting_validators_threshold = config_data.get('vault_exiting_validators_threshold') or 0

return ProtocolConfig(
oracles=oracles,
rewards_threshold=rewards_threshold or 0,
Expand All @@ -45,4 +47,5 @@ def build_protocol_config(
exit_signature_epoch=config_data['exit_signature_epoch'],
signature_validity_period=config_data['signature_validity_period'],
until_force_exit_epochs=config_data['until_force_exit_epochs'],
vault_exiting_validators_threshold=vault_exiting_validators_threshold,
)
5 changes: 5 additions & 0 deletions sw_utils/typings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,10 @@ class ProtocolConfig:

exit_signature_recover_threshold: int

# max exiting validators for genesis vault
# zero value means threshold is not set
vault_exiting_validators_threshold: int = 0

# Keeper settings
validators_threshold: int = 0
rewards_threshold: int = 0

0 comments on commit a3cb428

Please sign in to comment.