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

handle floating promises in /inter-protocol and /vats #7760

Merged
merged 9 commits into from
May 16, 2023

Conversation

turadg
Copy link
Member

@turadg turadg commented May 16, 2023

refs: #6000

Description

Because we don't have the floating promise lint in CI, they creep back. The last time inter-protocol was cleared:

This clears them again. To do so it reworks a few promise handling flows. Those are in separate commits from the mechanical ones.

This is stacked upon #7752 because that changes shortfall reporting in a way that was relevant to the test changes here.

This has omits changes that are related to auction fixes:

Security Considerations

n/a

Scaling Considerations

n/a

Documentation Considerations

n/a

Testing Considerations

Revised tests. The vaults-upgrade bootstrapTest had to shrink in scope.

@turadg turadg requested a review from Chris-Hibbert May 16, 2023 18:01
@@ -96,7 +96,7 @@ const scheduleLiquidationWakeups = async (
if (TimeMath.compareAbs(now, nominalStart) > 0) {
if (TimeMath.compareAbs(now, endTime) < 0) {
if (cancelToken) {
E(timer).cancel(cancelToken);
void E(timer).cancel(cancelToken);
Copy link
Contributor

Choose a reason for hiding this comment

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

If we don't wait, I think we should assign a new token so the old one doesn't get used to soon.

cancelToken = makeCancelToken();

@@ -176,7 +177,7 @@ export const makeScheduler = async (
'Unable to start auction cleanly. skipping this auction round.',
),
);
finishAuctionRound();
await finishAuctionRound();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why? finishAuctionRound() isn't async.

@@ -188,15 +189,15 @@ export const makeScheduler = async (
case 'before':
break;
case 'during':
advanceRound();
await advanceRound();
Copy link
Contributor

Choose a reason for hiding this comment

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

nor is advanceRound().

Comment on lines -1083 to -1084
// This schedule is published as a side effect of closing out the incomplete
// auction. The next one follows immediately and is correct.
Copy link
Contributor

Choose a reason for hiding this comment

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

Also removed in another pending PR.

Comment on lines -492 to +493
myAddressNameAdmin.reserve(WalletName.depositFacet);
// This may not finish before another reserve() call, but this one will win
void myAddressNameAdmin.reserve(WalletName.depositFacet);
Copy link
Member

Choose a reason for hiding this comment

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

makeMyAddressNameAdminKit is deprecated, yes? I'm not confident how this solo client stuff should work. I'd be inclined to have ci continue to gripe about it. Or leave an XXX or something.

Comment on lines -308 to +309
myAddressNameAdmin.reserve(WalletName.depositFacet);
// This may not finish before another reserve() call, but this one will win
void myAddressNameAdmin.reserve(WalletName.depositFacet);
Copy link
Member

Choose a reason for hiding this comment

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

Again, I'm not confident about this.

this.state.mint || Fail`minter cannot retain without a mint.`;
!!this.state.mint || Fail`minter cannot retain without a mint.`;
Copy link
Member

Choose a reason for hiding this comment

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

👍

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.

As discussed, if the changes for auctions and liquidation are moved to a different PR, I'm fine with what remains. We can discuss them there.

@ivanlei ivanlei added this to the Vaults Validation milestone May 16, 2023
@ivanlei ivanlei added bug Something isn't working vaults_triage DO NOT USE labels May 16, 2023
Base automatically changed from 7474-doubleReserve to master May 16, 2023 20:21
@turadg turadg added this pull request to the merge queue May 16, 2023
Merged via the queue into master with commit 210902d May 16, 2023
@turadg turadg deleted the 6000-inter-promises branch May 16, 2023 21:24
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_triage DO NOT USE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants