Skip to content

Process redeemer harvest#720

Open
cyc60 wants to merge 13 commits intov5-releasefrom
process-redeemer-harvest
Open

Process redeemer harvest#720
cyc60 wants to merge 13 commits intov5-releasefrom
process-redeemer-harvest

Conversation

@cyc60
Copy link
Copy Markdown
Contributor

@cyc60 cyc60 commented Apr 30, 2026

No description provided.

cyc60 added 3 commits April 30, 2026 11:39
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

This PR extends the OsToken redeemer processing flow to handle MetaVaults that require harvesting/state updates before attempting sub-vault redemptions, and aligns network/config plumbing with updated sw-utils.

Changes:

  • Add MetaVault “harvested/state-up-to-date” detection (V4 vs V5 release paths) and trigger MetaVault tree processing when needed.
  • Add a V4 MetaVault contract wrapper + ABI and extend SubVaultsRegistry with isStateUpdateRequired.
  • Update network config initialization to avoid dataclasses.asdict recursion issues; bump sw-utils to v0.13.0 and adjust startup version checks accordingly.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/meta_vault/service.py Adds is_meta_vault_harvested() to decide whether a MetaVault needs a state update (V4 vs V5 release handling).
src/config/networks.py Replaces asdict() with a shallow per-field copy to preserve nested dataclass types from sw_utils base configs.
src/common/startup_check.py Switches vault upgrade check to sw_utils.is_vault_upgraded_to_pectra.
src/common/contracts.py Adds V4MetaVaultContract + is_state_update_required() on SubVaultsRegistry.
src/common/abi/IV4EthMetaVault.json Introduces ABI for isStateUpdateRequired() used by V4 MetaVault wrapper.
src/commands/internal/process_redeemer.py Adds --graph-endpoint and --skip-harvest, harvests MetaVault trees when needed, and refreshes harvest params after harvest.
src/commands/tests/test_internal/test_process_redeemer.py Updates tests for new function signatures/flags and adds coverage for harvest-param refresh behavior.
pyproject.toml Bumps sw-utils git ref to v0.13.0.
poetry.lock Lockfile refresh for dependency updates (incl. sw-utils bump).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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 2 commits April 30, 2026 13:25
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Comment thread src/meta_vault/service.py Outdated
Comment thread src/meta_vault/service.py
cyc60 added 4 commits May 4, 2026 20:21
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>
@cyc60 cyc60 requested a review from Copilot May 4, 2026 20:49
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 8 out of 9 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tx_hash = await multicall_contract.tx_aggregate(calls)
logger.info('Waiting for Update State multicall tx %s confirmation', tx_hash)
tx_receipt = await execution_client.eth.wait_for_transaction_receipt(
HexBytes(Web3.to_bytes(hexstr=tx_hash)), timeout=settings.execution_transaction_timeout
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/meta_vault/service.py
Comment on lines +98 to +112
async def is_meta_vault_state_update_required(meta_vault_address: ChecksumAddress) -> bool:
vault_version = await VaultContract(meta_vault_address).version()

if is_meta_vault_upgraded_to_release(
settings.network, meta_vault_address, vault_version, ContractReleaseVersion.V5
):
# V5 release: canUpdateState moved to SubVaultsRegistry
meta_vault_contract = MetaVaultContract(meta_vault_address)
sub_vaults_registry_address = await meta_vault_contract.sub_vaults_registry()
sub_vaults_registry_contract = SubVaultsRegistryContract(sub_vaults_registry_address)
return await sub_vaults_registry_contract.is_state_update_required()

# V4 release: canUpdateState is on the vault contract directly
v4_meta_vault_contract = V4MetaVaultContract(meta_vault_address)
return await v4_meta_vault_contract.is_state_update_required()
cyc60 added 2 commits May 5, 2026 10:43
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Comment thread src/commands/internal/process_redeemer.py
Comment thread src/commands/internal/process_redeemer.py
cyc60 added 2 commits May 6, 2026 17:29
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
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.

3 participants