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

8672 acyclic zoe seat kit test #9010

Closed
wants to merge 5 commits into from

Conversation

Chris-Hibbert
Copy link
Contributor

refs: #8672
refs: #8682

Description

A manual test that exercises #8682. It shows that an existing seat is revived and can exit, and that a newly created seat can exit, and when that happens the code that drops cyclic references gets called.

Since the point of #8682 is to reduce uncollected garbage, we won't know whether this works until we can see the cycles being collected, which this test does not do.

NOT INTENDED TO BE MERGED TO MASTER

Here are some excerpts from a log.

SUCCESS: TEST: gov1 live offers: wanted 1, got 1
bid-1707775723723 bid-1707775723723
SUCCESS: TEST: bid-1707775723723: wanted bid-1707775723723, got bid-1707775723723

2024-02-28T21:14:55.545Z SwingSet: vat: v43: walletFactory.fromBridge: { blockHeight: 1085, blockTime: 1709154894, owner: 'agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9', spendAction: '{"body":"#{\\"method\\":\\"tryExitOffer\\",\\"offerId\\":\\"bid-1707775723723\\"}","slots":[]}', type: 'WALLET_SPEND_ACTION' }
2024-02-28T21:14:55.547Z SwingSet: vat: v43: walletFactory: { wallet: Object [Alleged: SmartWallet self] {}, actionCapData: { body: '#{"method":"tryExitOffer","offerId":"bid-1707775723723"}', slots: [] } }
2024-02-28T21:14:56.429Z SwingSet: vat: v9: OZSeat exiting from old seat
2024-02-28T21:14:56.469Z SwingSet: vat: v43: wallet agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9 offerStatus { id: 'bid-1707775723723', invitationSpec: { callPipe: [ [ 'makeBidInvitation', [ [Object] ] ] ], instancePath: [ 'auctioneer' ], source: 'agoricContract' }, offerArgs: { maxBuy: { brand: Object [Alleged: ATOM brand] {}, value: 1_000_000_000_000n }, offerPrice: { denominator: { brand: Object [Alleged: ATOM brand] {}, value: 1n }, numerator: { brand: Object [Alleged: IST brand] {}, value: 1n } } }, proposal: { give: { Bid: { brand: Object [Alleged: IST brand] {}, value: 1_000_000n } } }, result: 'Your bid has been accepted', numWantsSatisfied: 1 }
2024-02-28T21:14:56.658Z SwingSet: vat: v43: wallet agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9 offerStatus { id: 'bid-1707775723723', invitationSpec: { callPipe: [ [ 'makeBidInvitation', [ [Object] ] ] ], instancePath: [ 'auctioneer' ], source: 'agoricContract' }, numWantsSatisfied: 1, offerArgs: { maxBuy: { brand: Object [Alleged: ATOM brand] {}, value: 1_000_000_000_000n }, offerPrice: { denominator: { brand: Object [Alleged: ATOM brand] {}, value: 1n }, numerator: { brand: Object [Alleged: IST brand] {}, value: 1n } } }, proposal: { give: { Bid: { brand: Object [Alleged: IST brand] {}, value: 1_000_000n } } }, result: 'Your bid has been accepted', payouts: { Bid: { brand: Object [Alleged: IST brand] {}, value: 1_000_000n } } }


cancel action is broadcast:
{"timestamp":"2024-02-28T21:14:54Z","height":"1085","offerId":"bid-1707775723723","txhash":"1F2BDBBDE56ABCCCA598C3A930A9A85A543703F44D9C8B8D88996DB703E8770B"}
bid bid-1707775723723 is no longer live
{"time":"2024-02-28T21:14:56.739910002Z","height":"1087"}

2024-02-28T21:14:59.883Z SwingSet: vat: v43: walletFactory.fromBridge: { blockHeight: 1089, blockTime: 1709154898, owner: 'agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9', spendAction: '{"body":"#{\\"method\\":\\"executeOffer\\",\\"offer\\":{\\"id\\":\\"bid-ephemerel\\",\\"invitationSpec\\":{\\"callPipe\\":[[\\"makeBidInvitation\\",[\\"$0.Alleged: BoardRemoteATOM brand\\"]]],\\"instancePath\\":[\\"auctioneer\\"],\\"source\\":\\"agoricContract\\"},\\"offerArgs\\":{\\"maxBuy\\":{\\"brand\\":\\"$0\\",\\"value\\":\\"+1000000000000\\"},\\"offerPrice\\":{\\"denominator\\":{\\"brand\\":\\"$0\\",\\"value\\":\\"+1\\"},\\"numerator\\":{\\"brand\\":\\"$1.Alleged: BoardRemoteIST brand\\",\\"value\\":\\"+1\\"}}},\\"proposal\\":{\\"give\\":{\\"Bid\\":{\\"brand\\":\\"$1\\",\\"value\\":\\"+1000000\\"}}}}}","slots":["board05557","board0257"]}', type: 'WALLET_SPEND_ACTION' }
2024-02-28T21:14:59.885Z SwingSet: vat: v43: walletFactory: { wallet: Object [Alleged: SmartWallet self] {}, actionCapData: { body: '#{"method":"executeOffer","offer":{"id":"bid-ephemerel","invitationSpec":{"callPipe":[["makeBidInvitation",["$0.Alleged: BoardRemoteATOM brand"]]],"instancePath":["auctioneer"],"source":"agoricContract"},"offerArgs":{"maxBuy":{"brand":"$0","value":"+1000000000000"},"offerPrice":{"denominator":{"brand":"$0","value":"+1"},"numerator":{"brand":"$1.Alleged: BoardRemoteIST brand","value":"+1"}}},"proposal":{"give":{"Bid":{"brand":"$1","value":"+1000000"}}}}}', slots: [ 'board05557', 'board0257' ] } }
2024-02-28T21:14:59.925Z SwingSet: vat: v43: wallet agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9 starting executeOffer bid-ephemerel
2024-02-28T21:15:00.641Z SwingSet: vat: v45: ----- AucBook.6  48 Object [Alleged: ATOM brand] {} acceptPrice
2024-02-28T21:15:00.644Z SwingSet: vat: v45: ----- AucBook.6  49 added Offer  { denominator: { brand: Object [Alleged: ATOM brand] {}, value: 1n }, numerator: { brand: Object [Alleged: IST brand] {}, value: 1n } } 1_000_000_000_000n
2024-02-28T21:15:00.755Z SwingSet: vat: v43: wallet agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9 bid-ephemerel seated
2024-02-28T21:15:00.901Z SwingSet: vat: v43: wallet agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9 offerStatus { id: 'bid-ephemerel', invitationSpec: { callPipe: [ [ 'makeBidInvitation', [ [Object] ] ] ], instancePath: [ 'auctioneer' ], source: 'agoricContract' }, offerArgs: { maxBuy: { brand: Object [Alleged: ATOM brand] {}, value: 1_000_000_000_000n }, offerPrice: { denominator: { brand: Object [Alleged: ATOM brand] {}, value: 1n }, numerator: { brand: Object [Alleged: IST brand] {}, value: 1n } } }, proposal: { give: { Bid: { brand: Object [Alleged: IST brand] {}, value: 1_000_000n } } }, result: 'Your bid has been accepted' }



bid is broadcast:
{"timestamp":"2024-02-28T21:14:58Z","height":"1089","offerId":"bid-ephemerel","txhash":"A84349842CF5F6B34D27FD9535F05F02D0BFB712BA8DE37548AF3A83E511ABBB"}
{"id":"bid-ephemerel","price":"1 IST/ATOM","give":{"Bid":"1 IST"},"maxBuy":"1000000 ATOM","result":"Your bid has been accepted"}

2024-02-28T21:15:04.336Z SwingSet: vat: v43: walletFactory.fromBridge: { blockHeight: 1093, blockTime: 1709154903, owner: 'agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9', spendAction: '{"body":"#{\\"method\\":\\"tryExitOffer\\",\\"offerId\\":\\"bid-ephemerel\\"}","slots":[]}', type: 'WALLET_SPEND_ACTION' }
2024-02-28T21:15:04.338Z SwingSet: vat: v43: walletFactory: { wallet: Object [Alleged: SmartWallet self] {}, actionCapData: { body: '#{"method":"tryExitOffer","offerId":"bid-ephemerel"}', slots: [] } }
2024-02-28T21:15:04.379Z SwingSet: vat: v9: ZSeat cutting exitObj
2024-02-28T21:15:05.360Z SwingSet: vat: v43: wallet agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9 offerStatus { id: 'bid-ephemerel', invitationSpec: { callPipe: [ [ 'makeBidInvitation', [ [Object] ] ] ], instancePath: [ 'auctioneer' ], source: 'agoricContract' }, offerArgs: { maxBuy: { brand: Object [Alleged: ATOM brand] {}, value: 1_000_000_000_000n }, offerPrice: { denominator: { brand: Object [Alleged: ATOM brand] {}, value: 1n }, numerator: { brand: Object [Alleged: IST brand] {}, value: 1n } } }, proposal: { give: { Bid: { brand: Object [Alleged: IST brand] {}, value: 1_000_000n } } }, result: 'Your bid has been accepted', numWantsSatisfied: 1 }
2024-02-28T21:15:05.651Z SwingSet: vat: v43: wallet agoric1cn8dwvv3ac329sujgpqmccv6xd9d3sagd2t5l9 offerStatus { id: 'bid-ephemerel', invitationSpec: { callPipe: [ [ 'makeBidInvitation', [ [Object] ] ] ], instancePath: [ 'auctioneer' ], source: 'agoricContract' }, numWantsSatisfied: 1, offerArgs: { maxBuy: { brand: Object [Alleged: ATOM brand] {}, value: 1_000_000_000_000n }, offerPrice: { denominator: { brand: Object [Alleged: ATOM brand] {}, value: 1n }, numerator: { brand: Object [Alleged: IST brand] {}, value: 1n } } }, proposal: { give: { Bid: { brand: Object [Alleged: IST brand] {}, value: 1_000_000n } } }, result: 'Your bid has been accepted', payouts: { Bid: { brand: Object [Alleged: IST brand] {}, value: 1_000_000n } } }


cancel action is broadcast:
{"timestamp":"2024-02-28T21:15:03Z","height":"1093","offerId":"bid-ephemerel","txhash":"0799FFF2A42FAAB5D43E62E83BA51F142A15482C01585B5BEFDCDBD39C2BC8D6"}
{"time":"2024-02-28T21:15:05.908445881Z","height":"1095"}
bid bid-ephemerel is no longer live

Security Considerations

Not a security issue.

Scaling Considerations

This is about stopping the growth of one kind of uncollected garbage. Actually reducing the accumulated garbage will be a separate effort.

Documentation Considerations

None

Testing Considerations

Yes, this is a test meant to convince reviewers. It's not useful as a regression tests or unit test, since it can't make assertions about the consequences we care about.

Upgrade Considerations

#8682 preserves the old behavior for existing Zoe seats, and defines new behavior for new seats that will attempt to drop cycles when seats exit.

@Chris-Hibbert Chris-Hibbert added Zoe package: Zoe performance Performance related issues labels Feb 28, 2024
@Chris-Hibbert Chris-Hibbert self-assigned this Feb 28, 2024
@Chris-Hibbert Chris-Hibbert marked this pull request as draft February 28, 2024 21:39
Copy link
Member

@erights erights left a comment

Choose a reason for hiding this comment

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

Everything but test.sh LGTM

If you want me to review test.sh, I'll need you to walk me through the shell script and the nested jq script.

@erights
Copy link
Member

erights commented Feb 28, 2024

I looked at your one CI failure, and it looks like a flake. So I'm gonna hit the "Re-run failed jobs" button.

Note: that worked.

Base automatically changed from 8672-acyclicZoeSeatKit to master March 1, 2024 01:02
@Chris-Hibbert
Copy link
Contributor Author

Everything but test.sh LGTM

If you want me to review test.sh, I'll need you to walk me through the shell script and the nested jq script.

Not necessary from my POV. My claim is that running this test (or reviewing the transcript) in the description above should be convincing evidence that the cycles are broken. If you want convincing, I'd be happy to walk you through the action.

I'll leave this PR here in case @warner wants to take a more careful look at the swingstore.sqlite file to verify that we'll actually be able to collect the resulting released cycles.

@Chris-Hibbert
Copy link
Contributor Author

This PR is no longer of use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance related issues Zoe package: Zoe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants