Skip to content

Commit

Permalink
Split some validators between operators (#123)
Browse files Browse the repository at this point in the history
* Split some validators between operators

Signed-off-by: cyc60 <[email protected]>

* Update validators split

Signed-off-by: cyc60 <[email protected]>
Co-authored-by: Dmitri Tsumak <[email protected]>
  • Loading branch information
cyc60 and tsudmi authored Nov 17, 2022
1 parent 6e3eb71 commit 84a312a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions oracle/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
SYNC_PERIOD=timedelta(days=1),
IS_POA=False,
DEPOSIT_TOKEN_SYMBOL="ETH",
VALIDATORS_SPLIT={
Web3.toChecksumAddress("0xfe26832d3580e0ade4813f9e60e7c17b45e92cba"): 64,
Web3.toChecksumAddress("0x59ecf48345a221e0731e785ed79ed40d0a94e2a5"): 63,
Web3.toChecksumAddress("0x01f26d7f195a37d368cb772ed75ef70dd29700f5"): 64,
},
),
HARBOUR_MAINNET: dict(
STAKEWISE_SUBGRAPH_URLS=config(
Expand Down Expand Up @@ -164,6 +169,7 @@
SYNC_PERIOD=timedelta(days=1),
IS_POA=False,
DEPOSIT_TOKEN_SYMBOL="ETH",
VALIDATORS_SPLIT={},
),
GOERLI: dict(
STAKEWISE_SUBGRAPH_URLS=config(
Expand Down Expand Up @@ -235,6 +241,7 @@
SYNC_PERIOD=timedelta(hours=1),
IS_POA=True,
DEPOSIT_TOKEN_SYMBOL="ETH",
VALIDATORS_SPLIT={},
),
HARBOUR_GOERLI: dict(
STAKEWISE_SUBGRAPH_URLS=config(
Expand Down Expand Up @@ -309,6 +316,7 @@
SYNC_PERIOD=timedelta(days=1),
IS_POA=True,
DEPOSIT_TOKEN_SYMBOL="ETH",
VALIDATORS_SPLIT={},
),
GNOSIS_CHAIN: dict(
STAKEWISE_SUBGRAPH_URLS=config(
Expand Down Expand Up @@ -380,5 +388,9 @@
SYNC_PERIOD=timedelta(days=1),
IS_POA=True,
DEPOSIT_TOKEN_SYMBOL="GNO",
VALIDATORS_SPLIT={
Web3.toChecksumAddress("0x59ecf48345a221e0731e785ed79ed40d0a94e2a5"): 4971,
Web3.toChecksumAddress("0xf37c8f35fc820354b402054699610c098559ae44"): 4971,
},
),
}
5 changes: 4 additions & 1 deletion oracle/oracle/distributor/common/eth1.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ async def get_operators_rewards(
to_block: BlockNumber,
total_reward: Wei,
reward_token_address: ChecksumAddress,
validators_split: dict,
) -> Tuple[Rewards, Wei]:
"""Fetches operators rewards."""
result: Dict = await execute_sw_gql_query(
Expand All @@ -187,7 +188,9 @@ async def get_operators_rewards(
if account == EMPTY_ADDR_HEX:
continue

validators_count = int(operator["validatorsCount"])
validators_count = int(operator["validatorsCount"]) + validators_split.get(
account, 0
)
total_validators += validators_count

revenue_share = int(operator["revenueShare"])
Expand Down
1 change: 1 addition & 0 deletions oracle/oracle/distributor/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ async def process(self, voting_params: DistributorVotingParameters) -> None:
to_block=to_block,
total_reward=protocol_reward,
reward_token_address=NETWORK_CONFIG["REWARD_TOKEN_CONTRACT_ADDRESS"],
validators_split=NETWORK_CONFIG["VALIDATORS_SPLIT"],
)
partners_rewards, left_reward = await get_partners_rewards(
network=NETWORK,
Expand Down

0 comments on commit 84a312a

Please sign in to comment.