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

pipelined requests through fake-chain linkage can fail #1400

Closed
dtribble opened this issue Aug 8, 2020 · 4 comments · Fixed by #1405
Closed

pipelined requests through fake-chain linkage can fail #1400

dtribble opened this issue Aug 8, 2020 · 4 comments · Fixed by #1405
Assignees
Labels
bug Something isn't working captp package: captp SwingSet package: SwingSet

Comments

@dtribble
Copy link
Member

dtribble commented Aug 8, 2020

Describe the bug
When sending pipelined messages from the api deploy script via ag-solo to objects on the chain, the comm internal fail. See below.

To Reproduce

  1. in one window, run agoric start --reset -v
  2. in another window, run agoric deploy contract/depoy.js api/deploy.js

Expected behavior
Contract and API server should complete installation

Platform Environment
WSL
agoric-sdk: new-zoe-spike-2
dapp-encouragement: new-zoe

Additional context
Specific exampel pipelining code that causes this:

  const assuranceIssuerP = E(publicAPI).getAssuranceIssuer();
  const asurranceBrandP = E(assuranceIssuerP).getBrand();

results in:

SwingSet: kernel: doProcess: vat[v2][p+59].getBrand dispatch failed: Error <Object <[Object: null prototype] {}>>: unknown target type o-64
    at getRemoteFor (v2/packages/SwingSet/src/vats/comms/outbound.js:41:9)
    at getRemoteFor (v2/packages/SwingSet/src/vats/comms/outbound.js:25:16)
    at Object.deliverToRemote (v2/packages/SwingSet/src/vats/comms/outbound.js:54:20)
    at Object.deliver (v2/packages/SwingSet/src/vats/comms/dispatch.js:42:23)
    at eval (kernel/packages/SwingSet/src/kernel/vatManager/deliver.js:48:48)

Adding an await to avoid pipelining also avoids the problem.

@dtribble dtribble added the bug Something isn't working label Aug 8, 2020
@warner warner added the SwingSet package: SwingSet label Aug 8, 2020
@warner warner self-assigned this Aug 8, 2020
@dtribble dtribble added the captp package: captp label Aug 8, 2020
@warner
Copy link
Member

warner commented Aug 8, 2020

I've tracked this down to a comms-vat bug that probably got introduced when we added vpid retirement to both kernel and liveslots, but we missed comms, and apparently I didn't have a message-patterns test which triggers it.

The sequence is:

  • machine A transmits two messages to machine B, the second being pipelined to the result of the first
    • message one targets ro+15, has a result named rp-20
    • message two targets rp-20, and has a result named rp-21
  • B-comms receives the first message:
    • it looks up ro+15 and finds that it points to local object o-7 that it received from the kernel some time before
    • it allocates a VPID (say p+1) for the result,
    • it tells B-kernel to deliver one to o-7 with a result of p+1
  • Now, crucially, B-kernel resolves p+1 (to e.g. o-8) before B-comms receives the second message. This might be more likely when A actually sent three messages, zero, one, and two (or at least that's what happened in the original failure)
    • the kernel forgets about p+1 because it believes the vat will also retire the VPID
    • B-comms allocates a new ro+30, transmits a resolve(rp-20) to machine A
  • now B-comms receives the second message, addressed to rp-20
    • B-comms looks up rp-20 and, for some reason, still thinks it points at the p+1 that it allocated
      • this is clearly wrong, it should point at o-8
    • B-comms thinks it is pipelining two into the kernel promise for the result of one
    • B-comms tells B-kernel to deliver two to p+1, with some result we don't care about
  • B-kernel gets the two delivery from B-comms and sees that it targets p+1
    • B-kernel doesn't know about p+1 (it forgot it back when the vpid was retired), so it allocates a new c-list entry
    • p+1 is allocated by the vat (the +), so the vat is the decider
    • the delivery is pushed onto the run-queue
  • B-kernel's run-queue brings the two delivery up to the top
    • the target is p+1, whose decider is the comms vat
    • the comms vat is marked with enablePipelining: true
    • the kernel delivers the two to the comms vat, thinking it's doing a pipelined delivery
  • B-comms gets the kernel's two delivery to p+1
    • comms looks up p+1 and finds o-8
      • this is out of sync with the other table. We got rp-20 -> p+1, but p+1 -> o-8.
      • this suggests we're updating the per-remote table but not the local table
    • comms refuses to deliver the kernel's message to o-8 because that's back in the kernel, and the kernel shouldn't be sending gratuitous messages. "you know where it was supposed to go to, and it's not me, why are you bothering me with it?"

@warner
Copy link
Member

warner commented Aug 9, 2020

I'm working on a test to demonstrate this within swingset/comms directly. I don't think it involves capTP, but I'll prove that with the test before removing the CapTP label and upating the title.

@warner
Copy link
Member

warner commented Aug 10, 2020

For (mostly my own) reference, here's my annotated trace of the original expression of the bug:

web: 127.0.0.1:45306[3]: new WebSocket /private/captp
SwingSet: v2: --comms[ag-solo].deliver o+21 getValue r=p-127
SwingSet: v2: -- deliverToRemote
SwingSet: v2: -- remoteID remote1
SwingSet: v2: -- transmit deliver:ro+29:getValue:rp-72;["15326650"]
outbound: invoking deliverator; 1 new messages for sim-chain
SwingSet: v2: --comms[chain].deliver o+10{FROM-OTHER} receive r=p-95
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg deliver:ro+29:getValue:rp-72;["15326650"]
SwingSet: v2: -- syscall.send(o-62).getValue, r=p+52
SwingSet: v2: --comms[chain].notifyFulfillToPresence p+52 -> o-76
SwingSet: v2: -- transmit resolve:object:rp+72:ro-43;
SwingSet: v2: --comms[ag-solo].deliver o+10{FROM-OTHER} receive r=p-128
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg resolve:object:rp+72:ro-43;
SwingSet: v2: -- syscall.resolve(p-127) object}, o+35 [object Object]
outbound: invoking deliverator; 0 new messages for sim-chain

  const {
    creatorInvitation: adminInvite,
    creatorFacet
  } = await E(zoe).makeInstance(encouragementInstallation, issuerKeywordRecord);
SwingSet: v2: --comms[ag-solo].deliver o+22{solo.proxies[ZOE]} makeInstance r=p-129
SwingSet: v2: -- deliverToRemote
SwingSet: v2: -- remoteID remote1
SwingSet: v2: -- transmit deliver:ro+30{ZOE}:makeInstance:rp-73:ro+43:ro+35;[{"@qclass":"slot","index":0},{"Tip
outbound: invoking deliverator; 1 new messages for sim-chain
SwingSet: v2: --comms[chain].deliver o+10{FROM-OTHER} receive r=p-96
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg deliver:ro+30{ZOE}:makeInstance:rp-73:ro+43:ro+35;[{"@qclass":"slot","index":0},{"Tip
SwingSet: v2: -- syscall.send(o-63).makeInstance, r=p+53

SwingSet: v17: TERMS  Presence o-56 <[Object: null prototype] [Presence o-56] {}> [Presence o-56] {}
SwingSet: v2: --comms[chain].notifyFulfillToData p+53
SwingSet: v2: -- transmit resolve:data:rp+73:ro-44:ro-45;{"creatorFacet":{"@qclass":"slot","index":0},"cre
SwingSet: v2: --comms[ag-solo].deliver o+10{FROM-OTHER} receive r=p-130
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg resolve:data:rp+73:ro-44:ro-45;{"creatorFacet":{"@qclass":"slot","index":0},"cre
SwingSet: v2: -- syscall.resolve(p-129) data}, o+36 [object Object]
outbound: invoking deliverator; 0 new messages for sim-chain

  const instance = await E(creatorFacet).getInstance();
SwingSet: v2: --comms[ag-solo].deliver o+36 getInstance r=p-131
SwingSet: v2: -- deliverToRemote
SwingSet: v2: -- remoteID remote1
SwingSet: v2: -- transmit deliver:ro+44:getInstance:rp-74;[]
outbound: invoking deliverator; 1 new messages for sim-chain

SwingSet: v2: --comms[chain].deliver o+10{FROM-OTHER} receive r=p-97
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg deliver:ro+44:getInstance:rp-74;[]
SwingSet: v2: -- syscall.send(o-77).getInstance, r=p+54

SwingSet: v2: --comms[chain].notifyFulfillToPresence p+54 -> o-79
SwingSet: v2: -- transmit resolve:object:rp+74:ro-46;

SwingSet: v2: --comms[ag-solo].deliver o+10{FROM-OTHER} receive r=p-132
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg resolve:object:rp+74:ro-46;
SwingSet: v2: -- syscall.resolve(p-131) object}, o+38 [object Object] // instance

outbound: invoking deliverator; 0 new messages for sim-chain

  const publicAPI = E(zoe).getPublicFacet(instance);
SwingSet: v2: --comms[ag-solo].deliver o+22{solo.proxies[ZOE]} getPublicFacet r=p-133
SwingSet: v2: -- deliverToRemote
SwingSet: v2: -- remoteID remote1
SwingSet: v2: -- transmit deliver:ro+30{ZOE}:getPublicFacet:rp-75:ro+46;[{"@qclass":"slot","index":0}]
outbound: invoking deliverator; 1 new messages for sim-chain
solo->chain queue: getPublicFacet
solo waiting for: getPublicFacet

  const adminSeat = E(zoe).offer(adminInvite); // adding await here hides the bug
SwingSet: v2: --comms[ag-solo].deliver o+22{solo.proxies[ZOE]} offer r=p-134{solo.proxies[adminSeatP]} // adminSeat = E(zoe).offer(adminInvite)
SwingSet: v2: -- deliverToRemote
SwingSet: v2: -- remoteID remote1
SwingSet: v2: -- transmit deliver:ro+30{ZOE}:offer:rp-76:ro+45;[{"@qclass":"slot","index":0}]
solo->chain queue: getPublicFacet, offer
solo waiting for: getPublicFacet, offer


SwingSet: v2: --comms[chain].deliver o+10{FROM-OTHER} receive r=p-98
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg deliver:ro+30{ZOE}:getPublicFacet:rp-75:ro+46;[{"@qclass":"slot","index":0}]
SwingSet: v2: -- syscall.send(o-63).getPublicFacet, r=p+55
solo->chain queue: offer
kernel comms waiting on kernel for: getPublicFacet

SwingSet: v2: --comms[chain].notifyFulfillToPresence p+55 -> o-80
SwingSet: v2: -- transmit resolve:object:rp+75:ro-47;
outbound: invoking deliverator; 1 new messages for sim-chain
solo->chain queue: offer
kernel comms waiting on kernel for:
chain->solo: resolve(getPublicFacet)

  const outcomeP = E(adminSeat).getOfferResult(); // XXX
SwingSet: v2: --comms[ag-solo].deliver p-134{solo.proxies[adminSeatP]} getOfferResult r=p-135 // outcomeP = E(adminSeat).getOfferResult()
SwingSet: v2: -- deliverToRemote
SwingSet: v2: -- remoteID remote1
SwingSet: v2: -- transmit deliver:rp-76:getOfferResult:rp-77;[]
solo->chain queue: offer, getOfferResult
kernel comms waiting on kernel for:
chain->solo: resolve(getPublicFacet)

SwingSet: v2: --comms[chain].deliver o+10{FROM-OTHER} receive r=p-99
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg deliver:ro+30{ZOE}:offer:rp-76:ro+45;[{"@qclass":"slot","index":0}]
SwingSet: v2: -- syscall.send(o-63).offer, r=p+56
solo->chain queue: getOfferResult
kernel comms waiting on kernel for: offer
chain->solo: resolve(getPublicFacet)

SwingSet: v2: --comms[chain].notifyFulfillToPresence p+56 -> o-81{chain.adminSeat}
SwingSet: v2: -- transmit resolve:object:rp+76:ro-48;
outbound: invoking deliverator; 1 new messages for sim-chain
solo->chain queue: getOfferResult
kernel comms waiting on kernel for:
chain->solo: resolve(getPublicFacet), resolve(offer)
### chain.comms now knows p+56 -> o-81, BUT BUT kernel clist will retire+delete p+56

  E(scratch).set('adminPayoutP', E(adminSeat).getPayouts());
SwingSet: v2: --comms[ag-solo].deliver p-134{solo.proxies[adminSeatP]} getPayouts r=p-136
SwingSet: v2: -- deliverToRemote
SwingSet: v2: -- remoteID remote1
SwingSet: v2: -- transmit deliver:rp-76:getPayouts:rp-78;[]
solo->chain queue: getOfferResult, getPayouts
kernel comms waiting on kernel for:
chain->solo: resolve(getPublicFacet), resolve(offer)

SwingSet: v2: --comms[chain].deliver o+10{FROM-OTHER} receive r=p-100
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg deliver:rp-76:getOfferResult:rp-77;[] ## rp-76 should map to o-81, not p+56
SwingSet: v2: -- syscall.send(p+56).getOfferResult, r=p+57
solo->chain queue: getPayouts
kernel comms waiting on kernel for: getOfferResult
chain->solo: resolve(getPublicFacet), resolve(offer)

SwingSet: v2: --comms[chain].deliver p+56 getOfferResult r=p+57
SwingSet: v2: -- deliverToRemote
SwingSet: kernel: doProcess: vat[v2][p+56].getOfferResult dispatch failed: Error <Object <[Object: null prototype] {}>>: unknown target type o-81{chain.adminSeat}
    at getRemoteFor (v2/packages/SwingSet/src/vats/comms/outbound.js:41:9)
    at getRemoteFor (v2/packages/SwingSet/src/vats/comms/outbound.js:25:16)
    at Object.deliverToRemote (v2/packages/SwingSet/src/vats/comms/outbound.js:54:20)
    at Object.deliver (v2/packages/SwingSet/src/vats/comms/dispatch.js:50:23)
    at eval (kernel/packages/SwingSet/src/kernel/vatManager/deliver.js:48:48)
outbound: invoking deliverator; 1 new messages for sim-chain
SwingSet: v2: --comms[chain].deliver o+10{FROM-OTHER} receive r=p-101
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg deliver:rp-76:getPayouts:rp-78;[]
SwingSet: v2: -- syscall.send(p+56).getPayouts, r=p+58
SwingSet: v2: --comms[chain].deliver p+56 getPayouts r=p+58
SwingSet: v2: -- deliverToRemote
SwingSet: kernel: doProcess: vat[v2][p+56].getPayouts dispatch failed: Error <Object <[Object: null prototype] {}>>: unknown target type o-81{chain.adminSeat}
    at getRemoteFor (v2/packages/SwingSet/src/vats/comms/outbound.js:41:9)
    at getRemoteFor (v2/packages/SwingSet/src/vats/comms/outbound.js:25:16)
    at Object.deliverToRemote (v2/packages/SwingSet/src/vats/comms/outbound.js:54:20)
    at Object.deliver (v2/packages/SwingSet/src/vats/comms/dispatch.js:50:23)
    at eval (kernel/packages/SwingSet/src/kernel/vatManager/deliver.js:48:48)
SwingSet: v2: --comms[ag-solo].deliver o+10{FROM-OTHER} receive r=p-137
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg resolve:object:rp+75:ro-47;
SwingSet: v2: -- syscall.resolve(p-133) object}, o+39 [object Object]
outbound: invoking deliverator; 0 new messages for sim-chain
SwingSet: v2: --comms[ag-solo].deliver o+10{FROM-OTHER} receive r=p-138
SwingSet: v2: -- deliverFromRemote
SwingSet: v2: -- msg resolve:object:rp+76:ro-48;
SwingSet: v2: -- syscall.resolve(p-134{solo.proxies[adminSeatP]}) object}, o+40 [object Object]
outbound: invoking deliverator; 0 new messages for sim-chain

@warner
Copy link
Member

warner commented Aug 10, 2020

I found a way to test the fix. A key difference between the swingset unit tests (test-message-patterns.js) and the failing situation (using cosmic-swingset in the "fake-chain" mode) is the order of inter-machine message delivery. I have to change the way we do our tests to let them trigger the bug.

In the swingset unit tests, a turn or crank that produces multiple messages will deliver them to the "loopbox" device, which delivers them back into the same swingset machine (but to a second instance of vat-tp, which delivers them to a second instance of the comms vat). When the left vat sends right~.one()~.two(), both one and two turn into syscalls that get pushed onto the kernel run-queue. These arrive at the comms vat and are turned into syscalls aimed at the vat-tp vat.

When they arrive at vat-tp, the old loopbox device immediately pushed them onto the run-queue as separate messages to the right-side vat-tp vat. Then right-vattp pushes both messages to right-comms. Right-comms sees one and pushes a one to right-vat, then right-comms sees two and pushes two to the kernel (targeting the pipelined result of one, which works fine at that point because right-comms hasn't yet seen the resolution of one). Right-vat responds to one with a resolution, that gets pushed onto the end of the run-queue. Then two comes to the top of the run-queue, the kernel sees that the promise to which it was targetted has been resolved to some object, and the kernel delivers one to right-vat. Then a bunch of resolutions travel backwards.

The overall order of delivery is:

  • left-vat: start (pushes (A) one and (B) two to comms), q: [lcomms.one, lcomms.two]
  • left-comms: one (pushes one to left-vattp), q: [lcomms.two, lvattp.one]
  • left-comms: two (pushes two to left-vattp), q: [lvattp.one, lvattp.two]
  • left-vattp: one (invokes loopback, which pushes), q: [lvattp.two, rvattp.one]
  • left-vattp: two (same), q: [rvattp.one, rvattp.two]
  • right-vattp: one (pushes one to comms), q: [rvattp.two, rcomms.one]
  • right-vattp: two (pushes two to comms), q: [rcomms.one, rcomms.two]
  • right-comms: one (sends one), q: [rcomms.two, rvat.one]
  • right-comms: (C) two (pipelines two), q: [rvat.one, oneP.two]
  • right-vat: one (resolves to objOne), q: [oneP.two, notifyRComms(oneP)]
  • kernel: sees oneP.two, sees that oneP has been resolved to objOne
    • delivers two to right-vat, where objOne lives
    • q: [notifyRComms(oneP), notifyRComms(twoP)]
  • right-comms: (D) notify(oneP) (pushes resolve to right-vattp)
    • q: [notifyRComms(twoP), rvattp.resolve(oneP)]
  • etc

So the one and two messages are sent from one side to the other, and all deliveries strictly alternate between something involving one, and something involving two.

The bug here only happens when right-comms sees "D" (notifyRComms(oneP)) before it sees "C" (rcomms.two). The two message is aimed at oneP. When "C" arrives first, right-comms sees that oneP is unresolved, and pipelines two into the kernel as it's supposed to, aimed at the promiseID which it allocated when it sent one into the kernel.

If "D" happens first, right-comms dutifully updates its internal promise table to record the fact that oneP is now resolved to some object objOne, and sends a resolution message back to the left (meanwhile, the kernel has forgotten about the oneP identifier, because it's been retired). When "C" arrives, still targetting oneP (because the left side sent the message way back at "B", way too early to know about the resolution), right-comms is supposed to use the internal promise table to route the message to objOne. The bug is that it wasn't doing this lookup on the inbound side, so right-comms really sent two into the kernel aimed at oneP. The kernel says "I don't know that ID, you must be allocating a new one, sure whatever", and eventually pipelines two back into right-comms, which finally produces the error message we saw.

The failing delivery order is "A B D C". This happens because fake-chain uses a queue that lives above the kernel's run-queue, and cross-machine deliveries are made one message at a time. The first cross-machine delivery makes the right side do:

  • right-vattp: one (pushes one to comms), q: [rcomms.one]
  • right-comms: one (sends one), q: [rvat.one]
  • right-vat: one (resolves to objOne), q: [notifyRComms(oneP)]
  • right-comms: (D) notify(oneP) (pushes resolve to right-vattp)
    • q: [rvattp.resolve(oneP)]
  • right-vattp: resolve(oneP) (queues cross-machine message), q: []

and the second makes it do:

  • right-vattp: two (pushes two to comms), q: [rcomms.two]
  • right-comms: (C) two (pipelines two to oneP), q: [oneP.two]
  • kernel: sees brand new identifier "oneP", decider is right-comms, pipelines
    • q: [rcomms.two]
  • right-comms: two (aimed at oneP), throws error

The quick fix that @dtribble found was to add an await on the sender. By adding an await between A and B, it makes the total delivery order is "A D B C", in which case left-comms sends two at objOne, rather than oneP, which bypasses the bug.

To exercise the "A B D C" order in our unit tests, I'm changing (#1425) the loopbox device to have a higher-level queue, just like the fake-chain delivery code does.

@warner warner changed the title pipelined requests over capTP fail pipelined requests through fake-chain linkage can fail Aug 11, 2020
katelynsills added a commit that referenced this issue Aug 17, 2020
* refactor: refactor Zoe to use seat objects rather than offerHandles

* refactor: update seat namings, add seats.md to docs with diagrams

* refactor: move up init of instance, instanceAdmin

* fix: minting allocations in zcf (#1382)

* refactor: tests for sellItems and mintAndSellNFT pass - need to be reworked for new synchronous mint still

* refactor: fix jsdoc to recognize makeZCFMint as property

* fix: register the new minty issuer on zcf side (#1392)

* refactor: redirect main in package.json

* refactor: apply zoe renames

- `getInviteIssuer` to `getInvitationIssuer`
- `inviteDesc` to `description`

* fix: solve some easy types

* fix: use local amountMath (#1408)

* fix(swingset): check promise resolution table during comms.inbound

refs #1400

* refactor: multipoolAutoswap

* refactor: remove BrandName parameter from ERTP types

* feat: add the ability for a contract to get a synchronous seat

zcf.addEmptySeat() would return a zcfSeat that the contract could use
to hold allocations.

untested

* refactor: cleanup synchronous ZCF seat creation

drop keyword parameter in addEmptySeat()
extract makeZoeSeatAdminKit, use it for emptySeat, too.
rename zcf seat construction to use 'Kit'

* refactor: use updateFromNotifier from library

* refactor: add types to reveal the wallet changes needed for Zoe

* refactor: post review cleanups; mostly type info

improved type annotations
rename makeEmptySeat to makeOfferlessSeat
don't return the zcfSeatAdmin to the contract

* fix: make Zoe typesafe again

* refactor: bring autoswap up to date on the new Zoe spike branch

Based on the synchronous seat work.

The unit tests for autoswap pass. I haven't yet done the swingset tests.

* fix: update autoswap from addEmptySeat() to makeEmptySeatKit()

* chore: add publicFacet and instance to MakeInstanceResult (#1418)

* chore: fix typing of MakeInstanceResult

* chore: add hasExited, getNotifier to UserSeat

* Update more unit tests (#1422)

* chore: update tests

* chore: finish automaticRefund tests

* chore: update barterExchange and brokenContract tests. Small changes to Zoe and types (#1427)

* fix: make the wallet pass unit tests

* refactor: clear up some more types

* fix(dapp-svelte-wallet): minor cleanups

* fix: always use the published wallet payment facet

* test: invite -> creatorInvitation

* fix: noticed bug in exit code while doing (chore: update coveredCall tests) (#1428)

* chore: update tests for escrowToVote, grifter, multipoolAutoswap, publicAuction, sellTickets, simpleExchange

* chore: make more unit tests pass, linting

* chore: update tests for escrowToVote, grifter, multipoolAutoswap, publicAuction, sellTickets, simpleExchange (#1430)

* fix: minor wallet cleanup

* test: fix all the zoe swingSet tests

* chore: find usages of .getBrand() and make sure that brand and issuer match (#1443)

* refactor: rename makeInstance to startInstance (#1444)

* test(dapp-svelte-wallet): fix test log for determinism

The prior golden test log relied on a race between deposit and
the new purse values.  Correct that ambiguity.

* fix: generate unique petnames, and use them

* fix: only uniquify suffixes for petnames that are actually paths

* chore: fix brokenContracts tests, zoe-metering tests, skip ZoeHelpers tests for now (need to be rewritten entirely, I think using the real ZCF, not a mock) (#1435)

* fix: minor typing issue

* chore: clean up vestiges of encouragement dapp

* chore: remove contract/deploy.js from the wallet spec

* refactor: prevent the same seat being an argument multiple times in reallocate (#1452)

* refactor: remove makeEmptyOffer from zoeHelpers, use zcf.makeEmptySeatKit instead (#1451)

* refactor: move issuerKeywordRecord and brandKeywordRecord to terms (#1459)

* refactor: add issuers, brands, maths to terms

* refactor: rename NonCustomTerms in types

* chore: address PR comments

* refactor: move AmountMath from names to Kinds; easier local creation

Issuer no longer has getAmountMath(), instead exports makeLocalAmountMath();
added an enum for the three kinds of AmountMath
getAmountMathHelpersName replaced with getAmountMathKind
Add MathKind as an enum containing the legal values of AmountKind
Made progress on correct typing

* fix: review suggestions and merge conflicts.

* fix: clear up the types

* chore: export all of ERTP from index.js. Update all imports.

A few other review-suggested cleanups

* refactor: add Zoe methods for getting assured invitation values

The type declarations seem to work.

* refactor: drop unnecessary invitations in the metering tests.

* refactor: review of the following files in the form of code changes (#1475)

* refactor: review of:

packages/zoe/src/contracts/autoswap.js
packages/zoe/src/contracts/barterExchange.js
packages/zoe/src/contracts/simpleExchange.js
packages/zoe/test/swingsetTests/zoe/test-zoe.js
packages/zoe/test/swingsetTests/zoe/vat-alice.js
packages/zoe/test/swingsetTests/zoe/vat-bob.js
packages/zoe/test/swingsetTests/zoe/vat-carol.js
packages/zoe/test/swingsetTests/zoe/vat-dave.js
packages/zoe/test/swingsetTests/zoe/vat-zoe.js
packages/zoe/test/unitTests/contracts/test-autoswap.js
packages/zoe/test/unitTests/contracts/test-barter.js
packages/zoe/test/unitTests/contracts/test-simpleExchange.js
packages/zoe/test/unitTests/installFromSource.js
packages/zoe/test/unitTests/setupBasicMints.js
packages/zoe/test/unitTests/setupMixedMints.js
packages/zoe/test/unitTests/setupNonFungibleMints.js
packages/zoe/test/unitTests/test-cleanProposal.js
packages/zoe/test/unitTests/test-offerSafety.js
packages/zoe/test/unitTests/test-rightsConservation.js
packages/zoe/test/zoeTestHelpers.js

in PR form rather than comments

* fix: fix dapp-svelte-wallet issues

* fix: lint-fix

* fix: fix errors

* chore: review in the form of PR w/ changes (#1484)

* fix: resolve semantic merge conflict

The `@agoric/zoe/src/contractFacet` moved to:
`@agoric/zoe/src/contractFacet/contractFacet.js`.

* refactor: add typings for some sample Zoe contracts

* refactor: loosen unknown typings

* chore: expose '@agoric/zoe/contractFacet'

* docs: address review comments

* test(swingset-runner): update demo/exchangeBenchmark for new Zoe

* chore: follow #1194: take fresh copy of zoeTests from zoe

* fix: don't use monorepo-relative paths to @agoric/zoe

* chore: complete #1194 Problem 1

* fix: zcf is unused, so prepend an underscore

lint fix

* chore: complete #1194 Problem 2b

* chore: complete #1194 Problem 2c

* chore: move global harden declaration to package.json

* fix: undo invalid Zoe change

* fix: minor cleanups

* chore: rename userSeat.exit() to tryExit() (#1493)

* chore: rename userSeat.exit() to tryExit()

* Update packages/zoe/src/objArrayConversion.js

Co-authored-by: Mark S. Miller <erights@users.noreply.github.com>

* chore: address small PR comments

* chore: remove objToArray because unused

* chore: move cleanProposal.js (#1495)

* chore: remove more unused functions

* chore: remove escrowAndAllocateTo

* chore: remove unused type

* chore: rename invite to invitation, forever more. begone!

* Use flatMap

Co-authored-by: Mark S. Miller <erights@users.noreply.github.com>

* chore: change areRightsConserved to assertRightsConserved

* chore: address PR comments

* fix: reintroduce makeZoe's zcfBundleName argument; lost in merge

* Update packages/zoe/src/zoeService/zoeSeat.js

Co-authored-by: Chris Hibbert <Chris-Hibbert@users.noreply.github.com>

* chore: address PR comments

* chore: fix the lint

* chore: address PR comments about kick out messages (#1529)

* chore: address PR comments about exit behavior (#1527)

* chore: address PR comments about exit behavior

* Update packages/zoe/src/zoeService/zoeSeat.js

Co-authored-by: Mark S. Miller <erights@users.noreply.github.com>

* chore: fix lint, slight errors from merge

Co-authored-by: Mark S. Miller <erights@users.noreply.github.com>

Co-authored-by: Mark S. Miller <erights@users.noreply.github.com>
Co-authored-by: Dean Tribble <tribble@agoric.com>
Co-authored-by: Michael FIG <mfig@agoric.com>
Co-authored-by: Brian Warner <warner@lothar.com>
Co-authored-by: Chris Hibbert <hibbert@agoric.com>
Co-authored-by: Chris Hibbert <Chris-Hibbert@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working captp package: captp SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants