-
Notifications
You must be signed in to change notification settings - Fork 232
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
Add Counter abstraction to Swingset #2400
Comments
I hope this is temporary until we make up our mind, and I hope we make up our mind quickly to use BigInt. Yes, there may be a performance cost currently for BigInts compared to floats on XS. But we do know how to fix that. Yes, we probably cannot get it fixed quickly. But neither do we know whether the performance difference will be a significant cost in the interim. Aside from the options value of enabling us to postpone this decision, #2420 does not seem like a useful abstraction beyond that already provided by |
The PR has additional benefits like:
|
The VatManager is responsible for maintaining a transcript of all deliveries to their vat worker, so the vat can be reloaded later. These transcript entries have been including the `crankNumber`: a global counter indicating how many cranks have been delivered (to all vats, not just the one for which the transcript entry is being created). This removes that crankNumber from the transcript: * each vat should be independent, this global crankNumber is revealing information about what happens in other vats * #2400 is changing the type of `crankNumber` to a BigInt, which cannot be serialized by the simple `JSON.stringify` used in vatKeeper.js It also removes the now-unnecessary `kernelKeeper` argument from `makeTranscriptManager`, and changes one test that happened to depend upon the presence of the crankNumber field. closes #2428
The VatManager is responsible for maintaining a transcript of all deliveries to their vat worker, so the vat can be reloaded later. These transcript entries have been including the `crankNumber`: a global counter indicating how many cranks have been delivered (to all vats, not just the one for which the transcript entry is being created). This removes that crankNumber from the transcript: * each vat should be independent, this global crankNumber is revealing information about what happens in other vats * #2400 is changing the type of `crankNumber` to a BigInt, which cannot be serialized by the simple `JSON.stringify` used in vatKeeper.js It also removes the now-unnecessary `kernelKeeper` argument from `makeTranscriptManager`, and changes one test that happened to depend upon the presence of the crankNumber field. closes #2428
As part of the work transitioning agoric-sdk to use the BigInt version of @agoric/nat, I realized that Swingset uses Nat extensively for asserting ids and counts. There is a open question of whether BigInt is the right thing to use for ids and counts which I will set aside for others to decide on, but to make the transition from the old versions of Nat easier, @warner suggested adding a
counter
abstraction such that the implementation details of usingnumber
orbigint
would be hidden.The counter would have:
And potentially:
The text was updated successfully, but these errors were encountered: