Review-automation#311
Conversation
brunoguerios
left a comment
There was a problem hiding this comment.
It's awesome to see this being built 👏
Seems like we're almost there 😃
Other than the comments I added, if you could add an example comparing it with an existing review, it would be nice to compare results.
| */ | ||
| public async getIsRateProviderUpgradeable(): Promise<boolean> { | ||
| const upgradeableContracts = await this.getUpgradeableContracts() | ||
| return upgradeableContracts.some((c) => c.wasUpgraded) |
There was a problem hiding this comment.
Is this indeed a good way to detect if it's upgradeable? I mean, is it possible that it's upgradeable, but it wasn't upgraded?
There was a problem hiding this comment.
This needs to be reworked.
| } | ||
|
|
||
| // rate must be scale 18 | ||
| const isScale18 = data < 9n * 10n ** 18n && data >= 1n * 10n ** 18n ? true : false |
There was a problem hiding this comment.
I don't follow this check 🤔
Are you checking if rate is between 1e18 and 9e18?
I've seen rates of 1000e18, so that check would fail.
There was a problem hiding this comment.
Curious if you recall the types of pools where this is the case. I am aware of the following two scenarios:
- "oracle pool" Where the pools tokens are not alike. Like our USDC-WETH pool on Base with the stableSurge
- Gyros ConstantRateProviders
All other rate providers I recall would fall within this testing scope I think.
There was a problem hiding this comment.
Apparently I mixed convertToAssets and getRate results 😅
I was thinking about scenarios where wrapped and underlying token decimals were different (e.g. csUSDC).
The ones I checked do fall within the scope you created, so we should be fine 👍
Even though I don't feel like it's a super safe way to check for scale18, I couldn't come up with a better way 😬
I'd suggest wee keep an eye on rate providers that fail at this criteria so we can make a sanity check before confirming it doesn't properly implement this function.
|
@mkflow27 you might consider adding some noob friendly getting started instructions to the README about how to install, run the script, ect. |
|
I'm struggling to get the script to run results in I pulled the tenderly account / project slugs and generated API key from https://dashboard.tenderly.co/balancer/sdk-team/settings It looks like the |
mkflow27
left a comment
There was a problem hiding this comment.
I'm struggling to get the script to run
npm run write-review --rateProviderAddress 0xdDDF909076B641C51f22ACD4b134C54adad51e68 --network mainnet --rateProviderAsset 0x657e8C867D8B37dCC18fA4Caead9C45EB088C642results in
SyntaxError: Unexpected non-whitespace character after JSON at position 4 (line 1 column 5)I pulled the tenderly account / project slugs and generated API key from
https://dashboard.tenderly.co/balancer/sdk-team/settings
It looks like the
responseingetTenderlySimulation()is failing with not foundResponse { status: 404, statusText: 'Not Found', headers: Headers { 'content-type': 'text/plain', 'user-agent': 'node', vary: 'Origin,Origin', date: 'Fri, 21 Mar 2025 19:04:29 GMT', 'content-length': '18', 'x-envoy-upstream-service-time': '0', 'x-ratelimit-limit': '600, 600;w=60', 'x-ratelimit-remaining': '599', 'x-ratelimit-reset': '31', server: 'envoy', via: '1.1 google', 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000' }, body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true }, bodyUsed: false, ok: false, redirected: false, type: 'basic', url: 'https://api.tenderly.co/api/v1/account/balancer/sdk-team/project/simulate' }
script runs fine for me with the properties you shared. I ran npm run write-review -- --rateProviderAddress 0xdDDF909076B641C51f22ACD4b134C54adad51e68 --network mainnet --rateProviderAsset 0x657e8C867D8B37dCC18fA4Caead9C45EB088C642 (added two dashes)
However I am also using my own account which is not related to the balancer org. Let me ask to get access there as well. The resulting tenderly sim url is: https://dashboard.tenderly.co/shared/simulation/7aa2096c-cbe8-4304-b987-d78f096cbdc2
This adds review automation for rate providers with a new template and review scope. The scope:
Will close #322