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

refactor ZoeSeat to drop cyclic structure that blocked GC #8682

Merged
merged 4 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions a3p-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ code, and must be rebuilt every time there is a change. The
`/scripts/generate-a3p-submission.sh` script contains commands to generate the
core-eval content and move it to the expected proposal package's submission
directory. It is executed as part of `a3p-integration`'s `build:submission` step.
Each proposal that requires such a build step should add a `submission` entry in
the `agoricProposal` section of package.json. This value specifies the name of
another entry which gives parameters to be passed to `generate-a3p-submission.sh`.
Each proposal that requires such a build step should add a `build:submission`
rule in its package.json to specify the details of proposals that require a
build step.

## Building synthetic-chain images

Expand Down
3 changes: 2 additions & 1 deletion a3p-integration/proposals/a:upgrade-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
]
},
"scripts": {
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops"
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops",
"build:submission": "../../../scripts/generate-a3p-submission.sh probe-zcf-bundle a:upgrade-next probeZcfBundle probe-submission"
},
"packageManager": "[email protected]"
}
3 changes: 3 additions & 0 deletions a3p-integration/proposals/b:localchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"!submission"
]
},
"scripts": {
"build:submission": "../../../scripts/generate-a3p-submission.sh test-localchain b:localchain"
},
"packageManager": "[email protected]"
}
1 change: 1 addition & 0 deletions packages/zoe/src/contractFacet/exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const makeMakeExiter = baggage => {
exit() {
const { state } = this;
state.zcfSeat.exit();
state.zcfSeat = undefined;
},
},
{
Expand Down
2 changes: 2 additions & 0 deletions packages/zoe/src/contractFacet/zcfSeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@
assertActive(self);
assertNoStagedAllocation(self);
doExitSeat(self);
E(zoeInstanceAdmin).exitSeat(zcfSeatToSeatHandle.get(self), completion);

Check warning on line 161 in packages/zoe/src/contractFacet/zcfSeat.js

View workflow job for this annotation

GitHub Actions / lint-primary

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
zcfSeatToSeatHandle.delete(self);
},
fail(
reason = Error(
Expand All @@ -175,10 +176,11 @@
}
if (!hasExited(self)) {
doExitSeat(self);
E(zoeInstanceAdmin).failSeat(

Check warning on line 179 in packages/zoe/src/contractFacet/zcfSeat.js

View workflow job for this annotation

GitHub Actions / lint-primary

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
zcfSeatToSeatHandle.get(self),
harden(reason),
);
zcfSeatToSeatHandle.delete(self);
}
return reason;
},
Expand Down Expand Up @@ -392,8 +394,8 @@
}
},
reallocate(/** @type {ZCFSeat[]} */ ...seats) {
seats.forEach(assertActive);

Check warning on line 397 in packages/zoe/src/contractFacet/zcfSeat.js

View workflow job for this annotation

GitHub Actions / lint-primary

Prefer for...of instead of Array.forEach
seats.forEach(assertStagedAllocation);

Check warning on line 398 in packages/zoe/src/contractFacet/zcfSeat.js

View workflow job for this annotation

GitHub Actions / lint-primary

Prefer for...of instead of Array.forEach

// Ensure that rights are conserved overall.
const flattenAllocations = allocations =>
Expand Down Expand Up @@ -438,7 +440,7 @@
// for each of the seats) and inform Zoe of the
// newAllocation.

seats.forEach(commitStagedAllocation);

Check warning on line 443 in packages/zoe/src/contractFacet/zcfSeat.js

View workflow job for this annotation

GitHub Actions / lint-primary

Prefer for...of instead of Array.forEach

const seatHandleAllocations = seats.map(seat => {
const seatHandle = zcfSeatToSeatHandle.get(seat);
Expand Down
Loading
Loading