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

Release empty escrowed payments #9401

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Chris-Hibbert
Copy link
Contributor

@Chris-Hibbert Chris-Hibbert commented May 22, 2024

closes: #8686

Description

Release empty IST payments from Zoe's recoverySet for escrowed payments.
#8404 described the general problem. #8498 #9013 stopped adding empty payments to recovery sets. The largest known collection of retained empty payments was in Zoe. This removes a limited number. The presumption is that nothing else refers to them, so the kernel wouldn't have to propagate news of their release. If that's not true, then we shouldd release them gradually.

Security Considerations

None. The action is benign and idempotent. We should remove the code after exercising it once, but it's inaccessible to users.

Scaling Considerations

Cleans up some leftover unneeded objects.

Documentation Considerations

None

Testing Considerations

Tested in A3P, where it successfully deleted 4 vestigial empty payments. On MainNet, we counted 1718 a few months ago.

Upgrade Considerations

This requires an upgrade to Zoe, with its downstream consequences. The release is triggered by a proposal, which could be run once with a large parameter, or multiple times with a smaller parameter to clean up these excess objects.

@Chris-Hibbert Chris-Hibbert added Zoe package: Zoe performance Performance related issues contract-upgrade next-release about next agoric-sdk or endo release labels May 22, 2024
@Chris-Hibbert Chris-Hibbert self-assigned this May 22, 2024
Comment on lines 211 to 213
// recoverySet claims to be a copySet, but it's a record with a payload
// field containing an array of payment promises
for (const p of recoverySet.payload) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// recoverySet claims to be a copySet, but it's a record with a payload
// field containing an array of payment promises
for (const p of recoverySet.payload) {
for (const p of getCopySetKeys(recoverySet)) {

The comment is correct, but for the "but". recoverySet is a CopySet. A CopySet is a Tagged, which is a record-like structure with a tag (accessed by getTag) and a payload field, as you discovered. However, as a user of a copySet, you should generally avoid assuming too much about its internal implementation. Rather, use the getCopySetKeys function for obtaining those keys. Its implementation at https://github.com/endojs/endo/blob/0a91fbe7a066ef3d754b350d5da7ccf55638c12d/packages/patterns/src/keys/checkKey.js#L200-L209 is

export const getCopySetKeys = s => {
  assertCopySet(s);
  return s.payload;
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked and didn't find useful declarations or documentation. The wonderful endojs docs do link from CopySet to CopyTagged, but I didn't find anything to suggest that getCopySetKeys() was the appropriate way to access it. If I wasn't just looking in the wrong place, where can we add it so others will know?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the code and dropped the comment.

Copy link
Member

Choose a reason for hiding this comment

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

I looked and didn't find useful declarations or documentation. The wonderful endojs docs do link from CopySet to CopyTagged, but I didn't find anything to suggest that getCopySetKeys() was the appropriate way to access it. If I wasn't just looking in the wrong place, where can we add it so others will know?

Please file a bug on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@erights erights self-requested a review May 22, 2024 23:33
Copy link

cloudflare-pages bot commented May 23, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7159bbf
Status: ✅  Deploy successful!
Preview URL: https://e9c0a509.agoric-sdk.pages.dev
Branch Preview URL: https://8686-releaseemptyescrowedpay.agoric-sdk.pages.dev

View logs

@erights
Copy link
Member

erights commented May 24, 2024

From the top PR comment:

#8498 stopped adding empty payments to recovery sets.

But #8498 was closed without merging. Did you mean the PR that was merged in its place?

@Chris-Hibbert
Copy link
Contributor Author

#8498 was closed without merging. Did you mean the PR that was merged in its place?

Yes. #9013 was the one that actually merged those changes. I'll update the top comment.

Base automatically changed from 8400-upgradeScaledPAs to master May 24, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contract-upgrade next-release about next agoric-sdk or endo release performance Performance related issues Zoe package: Zoe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants