Running a Rebase
The rebase is executed by the rebase_auto script. scripts/keeper/auto/rebase_auto.py.
This script runs on a loop, running the rebase on a given iteration if inRebaseWindow() returns true with the local brownie account corresponding to the public key specified rebaser in `deploy-final.json
Note: The rebaser account has no special permissions, so this could be replaced by any local account. You can check your local accounts by running brownie accounts list
Connecting the rebaser account from keystore and pinging to rebase every 2 minutes
rebaser account as specified in deploy-final.json
The bot uses the brownie exponentialScalingStrategy to continuously resubmit the TX with increased gas price if it takes too long to confirm. This prevents the bot from getting stuck by a gas spike.
⚠️However, there could potentially be a timeout if the connection to the node fails waiting to hear back regarding a TX. Brownie does not seem to handle timeouts or retries here. This would potentially be a good PR to increase brownie's reliability. This happened once in Prod and led to a rebase being 1.5 hours late.

Oracle Data for Rebase

Before a rebase, there needs to be fresh oracle data submitted to the price MedianOracle.
The simplest way to submit data is using the ChainlinkForwarder, which parses latest DIGG/WBTC chainlink data and submits to MedianOracle. It is currently permissioned and can be opened up to more accounts.
Last modified 3mo ago
Copy link