Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Smarter exchange rate updates (#1308)
* feat: Smarter exchange rate updates This is from a comment added in `Dataworker.ts` that also explains this PR well: ``` // There are three times that we should look to update the HubPool's liquid reserves: // 1. First, before we attempt to execute the HubChain PoolRebalance leaves and RelayerRefund leaves. // We should see if there are new liquid reserves we need to account for before sending out these // netSendAmounts. // 2. Second, before we attempt to execute the PoolRebalance leaves for the other chains. We should // see if there are new liquid reserves we need to account for before sending out these netSendAmounts. This // updated liquid reserves balance could be from previous finalizations or any amountToReturn value sent // back from the Ethereum RelayerRefundLeaves. // 3. Third, we haven't updated the exchange rate for an L1 token on a PoolRebalanceLeaf in a while that // we're going to execute, so we should batch in an update. ``` The motivation for this PR is to reduce the # of `exchangeRateCurrent()` calls to reduce dataworker costs. This PR should make it such that these calls are only batched with PoolRebalanceLeaf executions and never sent otherwise. * refactor(test): Upgrade simple Dataworker buildRoots test to v3 This addresses a breaking change implemented in the SDK. * lint * increase lookback --------- Co-authored-by: Paul <[email protected]>
- Loading branch information