Skip to content

Commit

Permalink
Fix keeper tx sending (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsudmi authored Feb 17, 2022
1 parent 31ae985 commit 7b4e611
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 68 deletions.
4 changes: 2 additions & 2 deletions deploy/gnosis/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ networks:
services:
oracle:
container_name: oracle_gnosis
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.1
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -35,7 +35,7 @@ services:

keeper:
container_name: keeper_gnosis
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.1
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
4 changes: 2 additions & 2 deletions deploy/goerli/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
services:
oracle:
container_name: oracle_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.1
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -37,7 +37,7 @@ services:

keeper:
container_name: keeper_goerli
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.1
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
4 changes: 2 additions & 2 deletions deploy/mainnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ networks:
services:
oracle:
container_name: oracle_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.1
restart: always
entrypoint: ["python"]
command: ["oracle/oracle/main.py"]
Expand All @@ -37,7 +37,7 @@ services:

keeper:
container_name: keeper_mainnet
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.0
image: europe-west4-docker.pkg.dev/stakewiselabs/public/oracle:v2.2.1
restart: always
entrypoint: ["python"]
command: ["oracle/keeper/main.py"]
Expand Down
1 change: 1 addition & 0 deletions oracle/keeper/health_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async def health(request):
# Can resolve and fetch recent votes of the oracles
get_oracles_votes(
network=network,
web3_client=web3_client,
rewards_nonce=params.rewards_nonce,
validators_nonce=params.validators_nonce,
oracles=params.oracles,
Expand Down
3 changes: 2 additions & 1 deletion oracle/keeper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from oracle.settings import (
ENABLE_HEALTH_SERVER,
ENABLED_NETWORKS,
HEALTH_SERVER_HOST,
HEALTH_SERVER_PORT,
KEEPER_PROCESS_INTERVAL,
LOG_LEVEL,
Expand Down Expand Up @@ -59,7 +60,7 @@ def main() -> None:
daemon=True,
)
logger.info(
f"Starting monitoring server at http://{ENABLE_HEALTH_SERVER}:{HEALTH_SERVER_PORT}"
f"Starting monitoring server at http://{HEALTH_SERVER_HOST}:{HEALTH_SERVER_PORT}"
)
t.start()
main()
4 changes: 3 additions & 1 deletion oracle/keeper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def check_validator_vote(

def get_oracles_votes(
network: str,
web3_client: Web3,
rewards_nonce: int,
validators_nonce: int,
oracles: List[ChecksumAddress],
Expand Down Expand Up @@ -198,7 +199,7 @@ def get_oracles_votes(
vote = response.json()
if "nonce" not in vote or vote["nonce"] != correct_nonce:
continue
if not vote_checker(vote, oracle):
if not vote_checker(web3_client, vote, oracle):
logger.warning(
f"[{network}] Oracle {oracle} has submitted incorrect vote at {bucket_key}"
)
Expand Down Expand Up @@ -275,6 +276,7 @@ def submit_votes(
# resolve and fetch the latest votes of the oracles for validators and rewards
votes = get_oracles_votes(
network=network,
web3_client=web3_client,
rewards_nonce=params.rewards_nonce,
validators_nonce=params.validators_nonce,
oracles=params.oracles,
Expand Down
3 changes: 2 additions & 1 deletion oracle/oracle/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from oracle.settings import (
ENABLE_HEALTH_SERVER,
ENABLED_NETWORKS,
HEALTH_SERVER_HOST,
HEALTH_SERVER_PORT,
LOG_LEVEL,
ORACLE_PROCESS_INTERVAL,
Expand Down Expand Up @@ -130,7 +131,7 @@ async def main() -> None:
daemon=True,
)
logger.info(
f"Starting monitoring server at http://{ENABLE_HEALTH_SERVER}:{HEALTH_SERVER_PORT}"
f"Starting monitoring server at http://{HEALTH_SERVER_HOST}:{HEALTH_SERVER_PORT}"
)
t.start()
asyncio.run(main())
116 changes: 58 additions & 58 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "oracle"
version = "2.1.2"
version = "2.2.1"
description = "StakeWise Oracles are responsible for submitting off-chain data."
authors = ["Dmitri Tsumak <[email protected]>"]
license = "AGPL-3.0-only"
Expand Down

0 comments on commit 7b4e611

Please sign in to comment.