From fb15024a2d5d56fb17c15282b6d82a6a49e6ea2f Mon Sep 17 00:00:00 2001 From: cyc60 Date: Tue, 1 Nov 2022 23:00:00 +0300 Subject: [PATCH 1/2] Split some validators between operators Signed-off-by: cyc60 --- oracle/networks.py | 9 +++++++++ oracle/oracle/distributor/common/eth1.py | 5 ++++- oracle/oracle/distributor/controller.py | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/oracle/networks.py b/oracle/networks.py index 2a21cac..13f7933 100644 --- a/oracle/networks.py +++ b/oracle/networks.py @@ -90,6 +90,11 @@ SYNC_PERIOD=timedelta(days=1), IS_POA=False, DEPOSIT_TOKEN_SYMBOL="ETH", + VALIDATORS_SPLIT={ + Web3.toChecksumAddress("0xfe26832d3580e0ade4813f9e60e7c17b45e92cba"): 50, + Web3.toChecksumAddress("0x59ecf48345a221e0731e785ed79ed40d0a94e2a5"): 50, + Web3.toChecksumAddress("0x01f26d7f195a37d368cb772ed75ef70dd29700f5"): 50, + }, ), HARBOUR_MAINNET: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -164,6 +169,7 @@ SYNC_PERIOD=timedelta(days=1), IS_POA=False, DEPOSIT_TOKEN_SYMBOL="ETH", + VALIDATORS_SPLIT={}, ), GOERLI: dict( STAKEWISE_SUBGRAPH_URLS=config( @@ -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( @@ -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( @@ -380,5 +388,6 @@ SYNC_PERIOD=timedelta(days=1), IS_POA=True, DEPOSIT_TOKEN_SYMBOL="GNO", + VALIDATORS_SPLIT={}, ), } diff --git a/oracle/oracle/distributor/common/eth1.py b/oracle/oracle/distributor/common/eth1.py index 68f882e..417ffaa 100644 --- a/oracle/oracle/distributor/common/eth1.py +++ b/oracle/oracle/distributor/common/eth1.py @@ -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( @@ -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"]) diff --git a/oracle/oracle/distributor/controller.py b/oracle/oracle/distributor/controller.py index c5914a9..3629c3b 100644 --- a/oracle/oracle/distributor/controller.py +++ b/oracle/oracle/distributor/controller.py @@ -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, From ef84fd66b5e0453a88a1083db927c303baa49e36 Mon Sep 17 00:00:00 2001 From: Dmitri Tsumak Date: Thu, 17 Nov 2022 18:38:10 +0200 Subject: [PATCH 2/2] Update validators split --- oracle/networks.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/oracle/networks.py b/oracle/networks.py index 13f7933..17520be 100644 --- a/oracle/networks.py +++ b/oracle/networks.py @@ -91,9 +91,9 @@ IS_POA=False, DEPOSIT_TOKEN_SYMBOL="ETH", VALIDATORS_SPLIT={ - Web3.toChecksumAddress("0xfe26832d3580e0ade4813f9e60e7c17b45e92cba"): 50, - Web3.toChecksumAddress("0x59ecf48345a221e0731e785ed79ed40d0a94e2a5"): 50, - Web3.toChecksumAddress("0x01f26d7f195a37d368cb772ed75ef70dd29700f5"): 50, + Web3.toChecksumAddress("0xfe26832d3580e0ade4813f9e60e7c17b45e92cba"): 64, + Web3.toChecksumAddress("0x59ecf48345a221e0731e785ed79ed40d0a94e2a5"): 63, + Web3.toChecksumAddress("0x01f26d7f195a37d368cb772ed75ef70dd29700f5"): 64, }, ), HARBOUR_MAINNET: dict( @@ -388,6 +388,9 @@ SYNC_PERIOD=timedelta(days=1), IS_POA=True, DEPOSIT_TOKEN_SYMBOL="GNO", - VALIDATORS_SPLIT={}, + VALIDATORS_SPLIT={ + Web3.toChecksumAddress("0x59ecf48345a221e0731e785ed79ed40d0a94e2a5"): 4971, + Web3.toChecksumAddress("0xf37c8f35fc820354b402054699610c098559ae44"): 4971, + }, ), }