Skip to content

Commit b73e1d3

Browse files
committed
Update withdrawals cache
Signed-off-by: cyc60 <[email protected]>
1 parent cb180c4 commit b73e1d3

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

deploy/gnosis/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ networks:
2424
services:
2525
oracle:
2626
container_name: oracle_gnosis
27-
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v4.0.1
27+
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v4.0.2
2828
restart: always
2929
entrypoint: ["python"]
3030
command: ["oracle/oracle/main.py"]
@@ -34,7 +34,7 @@ services:
3434

3535
keeper:
3636
container_name: keeper_gnosis
37-
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v4.0.1
37+
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v4.0.2
3838
restart: always
3939
entrypoint: ["python"]
4040
command: ["oracle/keeper/main.py"]

oracle/networks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
Web3.toChecksumAddress("0x59ecf48345a221e0731e785ed79ed40d0a94e2a5"): 4971,
411411
Web3.toChecksumAddress("0xf37c8f35fc820354b402054699610c098559ae44"): 4971,
412412
},
413-
WITHDRAWALS_CACHE_BLOCK=33192932,
414-
WITHDRAWALS_CACHE_AMOUNT=286633425704392,
413+
WITHDRAWALS_CACHE_BLOCK=33342932,
414+
WITHDRAWALS_CACHE_AMOUNT=290112726977685,
415415
),
416416
}

oracle/oracle/rewards/controller.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@
4444

4545

4646
class WithdrawalsCache:
47-
def __init__(self, block: BlockNumber = None, withdrawals: Wei = None):
47+
def __init__(self, block: BlockNumber = None, withdrawals: int = None):
4848
self.block = block
4949
self.withdrawals = withdrawals
5050

51-
def set(self, block: BlockNumber, withdrawals: Wei):
51+
def set(self, block: BlockNumber, withdrawals: int):
5252
self.block = block
5353
self.withdrawals = withdrawals
5454

55-
def get(self) -> tuple[BlockNumber, Wei]:
55+
def get(self) -> tuple[BlockNumber, int]:
5656
return self.block, self.withdrawals
5757

5858

@@ -258,12 +258,12 @@ async def calculate_withdrawal_rewards(
258258
execution_client=execution_client,
259259
)
260260

261+
self.withdrawals_cache.set(to_block, withdrawals_amount)
261262
withdrawals_amount = Web3.toWei(withdrawals_amount, "gwei")
262263
if NETWORK == GNOSIS_CHAIN:
263264
# apply mGNO <-> GNO exchange rate
264265
withdrawals_amount = Wei(int(withdrawals_amount * WAD // MGNO_RATE))
265266

266-
self.withdrawals_cache.set(to_block, withdrawals_amount)
267267
return withdrawals_amount
268268

269269
async def fetch_withdrawal_chunk(

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "oracle"
3-
version = "4.0.1"
3+
version = "4.0.2"
44
description = "StakeWise Oracles are responsible for submitting off-chain data."
55
authors = ["Dmitri Tsumak <[email protected]>"]
66
license = "AGPL-3.0-only"

0 commit comments

Comments
 (0)