Skip to content

Process redeemer#664

Merged
cyc60 merged 86 commits intov5-releasefrom
process-redeemer
Apr 15, 2026
Merged

Process redeemer#664
cyc60 merged 86 commits intov5-releasefrom
process-redeemer

Conversation

@cyc60
Copy link
Copy Markdown
Contributor

@cyc60 cyc60 commented Feb 18, 2026

No description provided.

cyc60 and others added 30 commits January 9, 2026 00:40
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>

# 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>
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/redemptions/tasks.py Outdated
Comment thread src/common/contracts.py
Comment thread src/common/harvest.py
Comment on lines +25 to +35
"""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}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment thread src/common/harvest.py
Comment thread src/commands/internal/process_redeemer.py
Comment thread src/commands/internal/process_redeemer.py Outdated
cyc60 added 2 commits March 9, 2026 13:03
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Copy link
Copy Markdown
Contributor

@evgeny-stakewise evgeny-stakewise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments part 2

Comment thread src/commands/internal/process_redeemer.py
Comment thread src/commands/internal/process_redeemer.py Outdated
Comment thread src/commands/internal/process_redeemer.py Outdated
Comment thread src/commands/internal/process_redeemer.py Outdated
Comment thread src/commands/internal/process_redeemer.py Outdated
Comment thread src/commands/internal/process_redeemer.py Outdated
Comment thread src/commands/internal/process_redeemer.py Outdated
cyc60 added 3 commits March 10, 2026 16:46
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/redemptions/tasks.py
Comment thread src/commands/internal/process_redeemer.py
Comment on lines +211 to +216
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'),
)
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread src/commands/internal/process_redeemer.py
Comment thread src/common/harvest.py
Comment on lines 33 to +43
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}

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread src/common/contracts.py
Comment thread src/common/tests/test_harvest.py
cyc60 added 3 commits March 10, 2026 18:53
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>
Comment thread src/commands/internal/process_redeemer.py
Comment thread src/commands/internal/process_redeemer.py Outdated
cyc60 added 5 commits March 12, 2026 10:51
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
Comment thread src/commands/internal/process_redeemer.py Outdated
Comment thread src/commands/internal/process_redeemer.py Outdated
Comment thread src/commands/internal/process_redeemer.py
Comment thread src/commands/internal/process_redeemer.py Outdated
Comment thread src/commands/internal/process_redeemer.py Outdated
cyc60 added 2 commits March 25, 2026 15:28
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
@cyc60 cyc60 merged commit 5ea029c into v5-release Apr 15, 2026
3 checks passed
@cyc60 cyc60 deleted the process-redeemer branch April 15, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants