Skip to content

Commit b5b8cb2

Browse files
authoredFeb 2, 2021
Merge pull request stakewise#8 from stakewise/fix-waiting-oracles
Fix waiting for other oracles
2 parents f6a38a5 + ffda159 commit b5b8cb2

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed
 

‎README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,19 @@ where `settings.txt` is an environment file with [Settings](#settings).
9797
cat >./settings.txt <<EOL
9898
WEB3_WS_ENDPOINT=ws://localhost:8546
9999
BEACON_CHAIN_RPC_ENDPOINT=http://localhost:4000
100-
INJECT_STALE_CHECK_MIDDLEWARE=True
100+
INJECT_STALE_CHECK_MIDDLEWARE=False
101101
STALE_CHECK_MIDDLEWARE_ALLOWABLE_DELAY=120
102102
INJECT_RETRY_REQUEST_MIDDLEWARE=True
103-
BALANCE_WARNING_THRESHOLD=0.5
104-
BALANCE_ERROR_THRESHOLD=0.01
103+
BALANCE_WARNING_THRESHOLD=0.05
104+
BALANCE_ERROR_THRESHOLD=0.008
105105
APPLY_GAS_PRICE_STRATEGY=True
106-
MAX_TX_WAIT_SECONDS=120
107-
TRANSACTION_TIMEOUT=600
108-
ORACLES_CONTRACT_ADDRESS=0xb8DC146F6F463631Ad950b165F21A87E824eFA0b
109-
POOL_CONTRACT_ADDRESS=0xD60F7AE203Ba7c54e2712975E93313a1824b67e1
110-
REWARD_ETH_CONTRACT_ADDRESS=0xCFAAb3f925c9cd6F3B3a7c9Af9389EA2F3D7de78
111-
STAKED_ETH_CONTRACT_ADDRESS=0x124dd949ce16de90A0440527f8b9321080DFC888
106+
MAX_TX_WAIT_SECONDS=180
107+
TRANSACTION_TIMEOUT=3600
108+
PROCESS_INTERVAL=30
109+
ORACLES_CONTRACT_ADDRESS=0x2f1C5E86B13a74f5A6E7B4b35DD77fe29Aa47514
110+
POOL_CONTRACT_ADDRESS=0xC874b064f465bdD6411D45734b56fac750Cda29A
111+
REWARD_ETH_CONTRACT_ADDRESS=0x20BC832ca081b91433ff6c17f85701B6e92486c5
112+
STAKED_ETH_CONTRACT_ADDRESS=0xFe2e637202056d30016725477c5da089Ab0A043A
112113
ORACLE_PRIVATE_KEY=0x<private_key>
113114
NOTIFIERS_TELEGRAM_TOKEN=12345token
114115
NOTIFIERS_TELEGRAM_CHAT_ID=123456

‎src/reward_token.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,13 @@ def process(self) -> None:
256256
self.reward_eth_token.functions.lastUpdateTimestamp().call(),
257257
tz=timezone.utc,
258258
)
259-
timeout = 360 # wait for 30 minutes for other voters
259+
timeout = TRANSACTION_TIMEOUT # wait for other voters
260260
while self.next_update_at > last_update_at:
261261
if timeout <= 0:
262262
raise RuntimeError("Timed out waiting for other oracles' votes")
263263

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

0 commit comments

Comments
 (0)
Please sign in to comment.