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

feat(ertp): upgraded quotes incrementally empty recovery-sets #8498

Closed
wants to merge 4 commits into from

Conversation

erights
Copy link
Member

@erights erights commented Nov 3, 2023

Staged on #8497
Extracted from #8418 but adapted to incrementally empty the recovery sets, rather than dropping lots all at once.

closes: #XXXX
refs: #8418 #8497

Description

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Upgrade Considerations

@erights erights changed the title feat(ertp): upgraded quotes incrementally empty recovery-sets feat(ertp): upgraded quotes to incrementally empty recovery-sets Nov 3, 2023
@erights erights changed the title feat(ertp): upgraded quotes to incrementally empty recovery-sets feat(ertp): upgraded quotes incrementally empty recovery-sets Nov 3, 2023
@erights erights force-pushed the markm-really-prepare-issuer-kit branch from 45d94ee to 71cf064 Compare November 6, 2023 23:25
Base automatically changed from markm-really-prepare-issuer-kit to master November 7, 2023 00:35
@Chris-Hibbert Chris-Hibbert force-pushed the markm-chris-recovery-sets-incremental-gc branch from b33b024 to fb64db7 Compare November 7, 2023 19:18
Comment on lines +228 to +230
* `'hasRecoverySets'`. By contrast, the absence of `RecoverySetsOption` provide
* parameter defaults to the predecessor's `RecoverySetsOption` state, or
* `'hasRecoverySets'` if none.
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't parse the "By contrast" sentence. I suspect 'defaults' is the verb, but I can't tell how to parse "provide parameter defaults". I think it's trying to tell me something about a situation where some parameter is going to default to a previous state, but I don't know which 'provide' method is referred to. Something resembling this was going on in preparePaymentLedger when it called preparePurseKind, but the description doesn't match up.

Copy link
Member Author

@erights erights Nov 7, 2023

Choose a reason for hiding this comment

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

This difference is more clearly represented by the distinction between variables labeled recoverySetsState and recoverySetsOption. If there is no previously stored recoverySetsState, then the implicit recoverySetsState is considered equivalent to 'hasRecoverySets' (and made explicit in oldRecoverySetsState). If there is no provided recoverySetsOption in the optional options parameter typed IssuerOptionsRecord, especially in the optional options parameter of reallyPrepareIssuerKit and upgradeIssuerKit), then this absence defaults to preserving oldRecoverySetsState as the new recoverySetsState. Otherwise, the new recoverySetsState is made the same as the recoverySetsOption if possible (and errors in not possible).

Copy link
Member Author

Choose a reason for hiding this comment

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

The logic implementing this defaulting logic is in upgradeIssuerKit, but it should be understood at all call sites upstream of it with a IssuerOptionsRecord-typed options parameter or simply an optional recoverySetsOption parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, fwiw, "defaults" is the verb of that bad sentence :( .

packages/ERTP/src/purse.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

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

I was waiting to understand the upgrade process. The process is that PRs should be approved on the master branch before they can be added to a release branch. This has been ready for a while. Now would be a good time to approve it for master, and prepare to add it to a branch for release to the chain.

erights and others added 4 commits February 8, 2024 18:22
cleanerRecoverySet() asserts paymentRecoverySet !== undefined when
recoverSetState === noRecoverySets, so paymentLedger must provide it
when calling preparePurseKind().
@erights erights force-pushed the markm-chris-recovery-sets-incremental-gc branch from 646cccb to fcde617 Compare February 9, 2024 02:22
@mergify mergify bot closed this in #9013 Mar 1, 2024
mergify bot added a commit that referenced this pull request May 24, 2024
refs: #8400
refs: #8498
closes: #9371

## Description

#8400 reported that the priceFeed vats hold onto old quotes in their
recoverySet, preventing them from being collected. #9283 applied the
fixes to master. These fixes address the growth in priceFeed vats and
Zoe, but scaledPriceAuthorities were still growing. This resolves that
problem by upgrading scaledPriceAuthority contracts to not use their
recoverySets.

<details>
  <summary><b>Expand</b> for performance graphs</summary>
  
<img width="809" alt="image"
src="https://github.com/Agoric/agoric-sdk/assets/13372636/889bb283-89c8-434f-8a67-efa56d0382ad">

Kernel allocation is in blue, and the scale is on the left. It varies
from 48862 to 49743, with a small amount of long-term growth.The other
active vats (v9=Zoe, v29=ATOM-USD_priceFeed, v43=wallet,
72=ATOM-USD_priceFeed, 74=auctioneer) use the scale on the right, with
Zoe varying tightly around 3600, and the others low and stable.

scaledPriceAuthority-ATOM doesn't have enough variation to be worth
graphing.

</details>

### Security Considerations

Upgrade existing contracts. No new vulnerabilities.

### Scaling Considerations

This addresses the largest known category of growth on the chain.

### Documentation Considerations

Add some documentation on creating proposals.

### Testing Considerations

Tested in A3P. We should exercise all the clients of priceFeeds in our
test environments.

### Upgrade Considerations

This PR includes a proposal that will upgrade all vats with
`scaledPriceAuthority` in their label. That should work on or test
chains as well as MainNet. These changes should be included in the next
release.
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.

2 participants