Skip to content

Migrate stale collateralAdapter / yakRouterAddress struct fields to *_DEPRECATED #471

Description

@arturbeg

Summary

Eleven shared TOML files use struct field names that have been renamed to *_DEPRECATED in the deployed reya-core router ABI (router version reya-core:1.0.26@router on cronos and reya network). Viem rejects these encodings with InvalidAddressError: Address "undefined" whenever cannon re-evaluates the corresponding invokes, because the field names in the TOML no longer match the ABI.

The bug has been latent for months — cannon was skipping these invokes via --upgrade-from reya-omnibus:latest@main because the on-chain state already had them applied. Re-execution can be triggered by a cannon CLI bump, a fresh inheritance baseline, or any change that propagates through invoke.upgrade_core_proxy's digest. When that happens, every downstream invoke that targets CoreProxy fails, and *_create_spot_market ops cascade with GlobalCollateralNotFound.

The fix is mechanical: rename the struct field in each TOML to match the current ABI. This is the same pattern already applied for wbtc, reya, sreya, and rselini (migrated in past commits) — these eleven were missed.

Files to update

Rename collateralAdaptercollateralAdapter_DEPRECATED

In the args of [invoke.*_global_collateral_config] (line 7 of each):

  • packages/tomls/src/core/configs/tokens/deusd.toml
  • packages/tomls/src/core/configs/tokens/ramber.toml
  • packages/tomls/src/core/configs/tokens/rhedge.toml
  • packages/tomls/src/core/configs/tokens/rusd.toml
  • packages/tomls/src/core/configs/tokens/sdeusd.toml
  • packages/tomls/src/core/configs/tokens/srusd.toml
  • packages/tomls/src/core/configs/tokens/susde.toml
  • packages/tomls/src/core/configs/tokens/usde.toml
  • packages/tomls/src/core/configs/tokens/weth.toml
  • packages/tomls/src/core/configs/tokens/wsteth.toml

Example diff for srusd.toml:

 [invoke.srusd_global_collateral_config]
 target = ["CoreProxy"]
 fromCall.func = "owner"
 func = "setGlobalCollateralConfig"
 args = [
     "<%= contracts.SRUSDProxy.address %>",
-    { collateralAdapter = "<%= settings.srusdCollateralAdapter %>", withdrawalWindowSize = "<%= settings.srusdWithdrawalWindowSize %>", withdrawalTvlPercentageLimit = "<%= parseEther(settings.srusdWithdrawalTvlPercentageLimitUnscaled)  %>" },
+    { collateralAdapter_DEPRECATED = "<%= settings.srusdCollateralAdapter %>", withdrawalWindowSize = "<%= settings.srusdWithdrawalWindowSize %>", withdrawalTvlPercentageLimit = "<%= parseEther(settings.srusdWithdrawalTvlPercentageLimitUnscaled)  %>" },
 ]

withdrawalWindowSize and withdrawalTvlPercentageLimit stay as-is — they are still active fields in router 1.0.26. Only the collateralAdapter slot was renamed.

Rename yakRouterAddressyakRouterAddress_DEPRECATED

In the configureProtocol args:

  • packages/tomls/src/core/configs/protocol_config.toml (line 22)

Diff:

 [invoke.core_configure_protocol]
 target = ["CoreProxy"]
 fromCall.func = "owner"
 func = "configureProtocol"
 args = [
-    { oracleManagerAddress = "<%= settings.oracleManagerProxy %>", exchangePassNFTAddress = "<%= contracts.ExchangePassProxy.address %>", feeCollectorAccountId = "<%= settings.coreFeeCollectorAccountId %>", yakRouterAddress = "<%= settings.camelotYakRouter %>", ordersGatewayAddress = "<%= contracts.OrdersGatewayProxy.address %>", passivePoolAddress = "<%= contracts.PassivePoolProxy.address %>" },
+    { oracleManagerAddress = "<%= settings.oracleManagerProxy %>", exchangePassNFTAddress = "<%= contracts.ExchangePassProxy.address %>", feeCollectorAccountId = "<%= settings.coreFeeCollectorAccountId %>", yakRouterAddress_DEPRECATED = "<%= settings.camelotYakRouter %>", ordersGatewayAddress = "<%= contracts.OrdersGatewayProxy.address %>", passivePoolAddress = "<%= contracts.PassivePoolProxy.address %>" },
 ]

Note: packages/tomls/src/devnet/core/protocol_config.toml already has yakRouterAddress_DEPRECATED and does not need an edit.

Validation

Both renames were validated in a dry-run cronos simulation:

yarn reya_cronos:simulate
# 19 Executing invokes, 0 Skipping, 0 errors
# 💥 reya-omnibus:1.0.136@main would have been successfully built

Specifically:

✔ Successfully called setGlobalCollateralConfig(0xb9F531A54Fc0E9AdCa1b931d9533B4e49bB2fAD6,
    {"collateralAdapter_DEPRECATED":"0x0000…","withdrawalWindowSize":"86400","withdrawalTvlPercentageLimit":"200000000000000000"})

✔ Successfully called configureProtocol(
    {"oracleManagerAddress":"0x689f13829e9b218841a0Cf59f44bD5c92F0d64eA",
     "exchangePassNFTAddress":"0x1Acd15A57Aff698440262A2A13AE22F8Ff2FA0cB",
     "feeCollectorAccountId":"1",
     "yakRouterAddress_DEPRECATED":"0x0000…",
     "ordersGatewayAddress":"0x5A0aC2f89E0BDeaFC5C549e354842210A3e87CA5",
     "passivePoolAddress":"0x9A3A664987b88790A6FDC1632e3b607813fd94fF"})

Without the rename, those calls fail at viem encoding time with InvalidAddressError: Address "undefined", and every dependent invoke is skipped with dependency operation not completed.

Scope and risk

  • Pure config rename in TOML templates — no on-chain effect (the values being passed are unchanged: AddressZero for collateralAdapter slots, camelotYakRouter setting for the yak slot).
  • Applies to both reya_cronos and reya_network omnibuses since both include core/mainnet.toml.
  • Devnet is unaffected — devnet/core/protocol_config.toml and devnet/core/tokens/*.toml were already migrated.
  • No test changes expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions