Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix waiting for other oracles #8

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -97,18 +97,19 @@ where `settings.txt` is an environment file with [Settings](#settings).
cat >./settings.txt <<EOL
WEB3_WS_ENDPOINT=ws://localhost:8546
BEACON_CHAIN_RPC_ENDPOINT=http://localhost:4000
INJECT_STALE_CHECK_MIDDLEWARE=True
INJECT_STALE_CHECK_MIDDLEWARE=False
STALE_CHECK_MIDDLEWARE_ALLOWABLE_DELAY=120
INJECT_RETRY_REQUEST_MIDDLEWARE=True
BALANCE_WARNING_THRESHOLD=0.5
BALANCE_ERROR_THRESHOLD=0.01
BALANCE_WARNING_THRESHOLD=0.05
BALANCE_ERROR_THRESHOLD=0.008
APPLY_GAS_PRICE_STRATEGY=True
MAX_TX_WAIT_SECONDS=120
TRANSACTION_TIMEOUT=600
ORACLES_CONTRACT_ADDRESS=0xb8DC146F6F463631Ad950b165F21A87E824eFA0b
POOL_CONTRACT_ADDRESS=0xD60F7AE203Ba7c54e2712975E93313a1824b67e1
REWARD_ETH_CONTRACT_ADDRESS=0xCFAAb3f925c9cd6F3B3a7c9Af9389EA2F3D7de78
STAKED_ETH_CONTRACT_ADDRESS=0x124dd949ce16de90A0440527f8b9321080DFC888
MAX_TX_WAIT_SECONDS=180
TRANSACTION_TIMEOUT=3600
PROCESS_INTERVAL=30
ORACLES_CONTRACT_ADDRESS=0x2f1C5E86B13a74f5A6E7B4b35DD77fe29Aa47514
POOL_CONTRACT_ADDRESS=0xC874b064f465bdD6411D45734b56fac750Cda29A
REWARD_ETH_CONTRACT_ADDRESS=0x20BC832ca081b91433ff6c17f85701B6e92486c5
STAKED_ETH_CONTRACT_ADDRESS=0xFe2e637202056d30016725477c5da089Ab0A043A
ORACLE_PRIVATE_KEY=0x<private_key>
NOTIFIERS_TELEGRAM_TOKEN=12345token
NOTIFIERS_TELEGRAM_CHAT_ID=123456
4 changes: 2 additions & 2 deletions src/reward_token.py
Original file line number Diff line number Diff line change
@@ -256,13 +256,13 @@ def process(self) -> None:
self.reward_eth_token.functions.lastUpdateTimestamp().call(),
tz=timezone.utc,
)
timeout = 360 # wait for 30 minutes for other voters
timeout = TRANSACTION_TIMEOUT # wait for other voters
while self.next_update_at > last_update_at:
if timeout <= 0:
raise RuntimeError("Timed out waiting for other oracles' votes")

logger.info("Waiting for other oracles to vote...")
time.sleep(5)
time.sleep(1)
last_update_at = datetime.fromtimestamp(
self.reward_eth_token.functions.lastUpdateTimestamp().call(),
tz=timezone.utc,