Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

excessive reports of "⚠️ Excess collateral remaining " on MainNet #11017

Open
Chris-Hibbert opened this issue Feb 19, 2025 · 0 comments
Open
Labels
bug Something isn't working Vaults VaultFactor (née Treasury)

Comments

@Chris-Hibbert
Copy link
Contributor

Describe the bug

The mainNet logs show a lot of instances of ⚠️ Excess collateral remaining sent to reserve.. Since this check is immediately preceded by an attempt to send all the remaining collateral to the reserve, this will nearly always be incorrect.

To Reproduce

INFO 2025-02-19T00:24:20Z [resource.labels.containerName: log-app] Timed out
INFO 2025-02-19T00:24:20.424832702Z [resource.labels.containerName: log-app] 2025-02-19T00:24:19.584Z SwingSet: vat: v48: ----- VM.15 107779 LiqV after long wait { Minted: { brand: Object [Alleged: IST brand] {}, value: 0n }, Collateral: { brand: Object [Alleged: ATOM brand] {}, value: 1_005_272n } }
INFO 2025-02-19T00:24:20.424888152Z [resource.labels.containerName: log-app] 2025-02-19T00:24:19.594Z SwingSet: vat: v48: ----- VM.15 107780 PLAN { overage: { brand: Object [Alleged: IST brand] {}, value: 0n }, shortfallToReserve: { brand: Object [Alleged: IST brand] {}, value: 0n }, collateralForReserve: { brand: Object [Alleged: ATOM brand] {}, value: 108_927n }, actualCollateralSold: { brand: Object [Alleged: ATOM brand] {}, value: 108_927n }, collateralSold: { brand: Object [Alleged: ATOM brand] {}, value: 0n }, collatRemaining: { brand: Object [Alleged: ATOM brand] {}, value: 0n }, debtToBurn: { brand: Object [Alleged: IST brand] {}, value: 5_000_512n }, mintedForReserve: { brand: Object [Alleged: IST brand] {}, value: 0n }, mintedProceeds: { brand: Object [Alleged: IST brand] {}, value: 0n }, phantomDebt: { brand: Object [Alleged: IST brand] {}, value: 0n }, transfersToVault: [ [ 0, { Collateral: { brand: [Object], value: 896_345n } } ] ], vaultsToReinstate: [ 0 ], totalPenalty: { brand: Object [Alleged: ATOM brand] {}, value: 108_927n } }
INFO 2025-02-19T00:24:20.424896972Z [resource.labels.containerName: log-app] 2025-02-19T00:24:19.630Z SwingSet: vat: v48: ----- Vault.10 835 Object [Alleged: ATOM brand] {} updateUiState 147 { debtSnapshot: { debt: { brand: Object [Alleged: IST brand] {}, value: 5_000_500n }, interest: { denominator: { brand: Object [Alleged: IST brand] {}, value: 100_000_000_000_000_000_000n }, numerator: { brand: Object [Alleged: IST brand] {}, value: 101_818_633_791_913_807_934n } } }, locked: { brand: Object [Alleged: ATOM brand] {}, value: 896_345n }, vaultState: 'active' }
INFO 2025-02-19T00:24:20.424901692Z [resource.labels.containerName: log-app] 2025-02-19T00:24:19.644Z SwingSet: vat: v48: ----- Store.7 840 To Vault Key 0.1825109790225738
INFO 2025-02-19T00:24:20.424906532Z [resource.labels.containerName: log-app] 2025-02-19T00:24:19.673Z SwingSet: vat: v48: ----- VM.15 107781 Sending to reserve: { brand: Object [Alleged: ATOM brand] {}, value: 108_927n }
INFO 2025-02-19T00:24:20.424911782Z [resource.labels.containerName: log-app] 2025-02-19T00:24:19.673Z SwingSet: vat: v48: ⚠️ Excess collateral remaining sent to reserve. Expected {"brand":"[Alleged: ATOM brand]","value":"[0n]"}, sent {"brand":"[Alleged: ATOM brand]","value":"[108927n]"}
INFO 2025-02-19T00:24:24.425683065Z [resource.labels.containerName: log-app] 2025-02-19T00:24:24.335Z SwingSet: vat: v36: ----- ReserveKit.5 3113 received collateral { brand: Object [Alleged: ATOM brand] {}, value: 108_927n }
INFO 2025-02-19T00:24:25Z [resource.labels.containerName: log-app] executed block
INFO 2025-02-19T00:24:25.425917470Z [resource.labels.containerName: log-app] 2025-02-19T00:24:25.101Z block-manager: block 18430894 commit
INFO 2025-02-19T00:24:25.425928410Z [resource.labels.containerName: log-app] 2025-02-19T00:24:25.118Z block-manager: wrote SwingSet checkpoint [run=7151ms, chainSave=0ms, kernelSave=17ms]
DEFAULT 2025-02-19T00:24:26Z [resource.labels.containerName: log-app]

Expected behavior

There should only be a warning when something is wrong.

Expected fix

Either drop the console.error() conditional, or change the code to

          const collateralInLiqSeat = liqSeat.getCurrentAllocation().Collateral;
          if (!AmountMath.isEmpty(collateralInLiqSeat)) {
            facets.helper.sendToReserve(collateralInLiqSeat, liqSeat);
          }
          // if it didn't match what was expected, report
          if (!AmountMath.isEqual(liqSeat.getCurrentAllocation().Collateral, plan.collatRemaining)) {
            console.error(
              `⚠️ Excess collateral remaining sent to reserve. Expected ${q(
                plan.collatRemaining,
              )}, sent ${q(collateralInLiqSeat)}`,
            );
          }
@Chris-Hibbert Chris-Hibbert added bug Something isn't working Vaults VaultFactor (née Treasury) labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Vaults VaultFactor (née Treasury)
Projects
None yet
Development

No branches or pull requests

1 participant