Conversation
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com> # Conflicts: # poetry.lock
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """Get harvest params for multiple vaults. | ||
|
|
||
| Checks can_harvest for all vaults first, then fetches IPFS data only | ||
| if at least one vault is harvestable. | ||
| """ | ||
| if not vaults: | ||
| return {} | ||
|
|
||
| last_rewards = await keeper_contract.get_last_rewards_update(block_number) | ||
| if last_rewards is None: | ||
| return None | ||
| return {vault: None for vault in vaults} |
There was a problem hiding this comment.
The docstring says can_harvest is checked for all vaults before fetching remote data, but the implementation calls keeper_contract.get_last_rewards_update() first. This adds an extra (potentially expensive) chain log lookup even when no vault is harvestable. Consider checking can_harvest for the provided vaults first and only then fetching last rewards/IPFS (or update the docstring if the order is intentional).
Signed-off-by: cyc60 <avsysoev60@gmail.com>
evgeny-stakewise
left a comment
There was a problem hiding this comment.
Added comments part 2
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if queued_assets < min_queued_assets: | ||
| logger.info( | ||
| 'Queued assets %s below threshold %s. Skipping to next interval.', | ||
| Web3.from_wei(queued_assets, 'ether'), | ||
| Web3.from_wei(min_queued_assets, 'ether'), | ||
| ) |
There was a problem hiding this comment.
min_queued_assets is parsed as a Gwei value (see main(... min_queued_assets=Gwei(min_queued_assets_gwei))), but here it's treated as Wei: queued_assets is in Wei and Web3.from_wei(min_queued_assets, 'ether') also expects Wei. This makes the threshold comparison/logging incorrect by 1e9. Convert min_queued_assets_gwei to Wei once (e.g., min_queued_assets_wei = Web3.to_wei(..., 'gwei')) and consistently compare/log in Wei units.
| last_rewards = await keeper_contract.get_last_rewards_update(block_number) | ||
| if last_rewards is None: | ||
| return None | ||
| return {vault: None for vault in vaults} | ||
|
|
||
| harvestable_vaults: list[ChecksumAddress] = [ | ||
| vault for vault in vaults if await keeper_contract.can_harvest(vault, block_number) | ||
| ] | ||
|
|
||
| if not harvestable_vaults: | ||
| return {vault: None for vault in vaults} | ||
|
|
There was a problem hiding this comment.
get_multiple_harvest_params calls keeper_contract.can_harvest(...) sequentially for each vault (await inside the list comprehension). For many vaults (as in the new redeemer flow) this adds avoidable latency. Consider issuing these calls concurrently with asyncio.gather and then filtering based on the results.
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com> # Conflicts: # src/redemptions/typings.py
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
* Handle nested metavaults Signed-off-by: cyc60 <avsysoev60@gmail.com> * Copilot fixes Signed-off-by: cyc60 <avsysoev60@gmail.com> * Update except Signed-off-by: cyc60 <avsysoev60@gmail.com> --------- Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com> # Conflicts: # src/common/startup_check.py
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
No description provided.