-
Notifications
You must be signed in to change notification settings - Fork 229
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
7300 remove pipeTopicToStorage #7389
Conversation
@@ -425,6 +424,7 @@ export const prepareVaultManagerKit = ( | |||
// about the installation and terms of the liqudation contract. We could | |||
// have another notifier for state downstream of governance changes, but | |||
// that doesn't seem to be cost-effective. | |||
// @ts-expect-error FIXME never defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Chris-Hibbert this seems like a genuine bug, but I can't tell the impact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think replaceable liquidator contracts wasn't preserved in the move to auctions. If I'm right, the impact is just some vestigial code and a little bit of unused storage. Orthogonal to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dan's right. The comment above and variable should go away. There doesn't appear to be any code that touches it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok removing
@@ -189,7 +201,9 @@ export const prepareRecorderKit = (baggage, marshaller) => { | |||
}; | |||
|
|||
/** | |||
* To be called at most once per baggage. | |||
* Convenience wrapper for DurablePublishKit and Recorder kinds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gibson042 I thought I had taken this out per our thread but maybe it reappeared in rebase.
In any case, it has proven handy for tests and I think it's okay in contracts with the caveat. WDYT?
*/ | ||
|
||
/** | ||
* @param {Baggage} baggage | ||
* @param {ZCF} zcf | ||
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not happy about these deep imports but I think the real solution is to have a new package for contract support. such that this would be,
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit | |
* @param {import('@agoric/contracts').MakeRecorderKit} makeRecorderKit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concur.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queued up: #7392
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. I'm not entirely confident I could maintain this code, so this might be more of an "I don't see any critical problems" review and you might want other eyes.
The notion of a breaking refactor hurts my head... but whatever... the breaking change is signaled.
* updatePublishKit: PublishKit<UpdateRecord>, | ||
* currentPublishKit: PublishKit<CurrentWalletRecord>, | ||
* updateRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<UpdateRecord>, | ||
* currentRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').RecorderKit<CurrentWalletRecord>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recorder.js is a zoe concern? hm.
(I see later your comment about an @agoric/contracts
package. makes sense)
return harden({ | ||
current: { | ||
description: 'Current state of wallet', | ||
subscriber: currentPublishKit.subscriber, | ||
storagePath: memoizedPath(currentStorageNode), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 getting rid of memoizedPat
seems like a nice simplification
// XXX how to handle errors here? | ||
E(latestRoundPublisher).write({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void
seems reasonable.
That is: rely on whatever unhandled rejection policy is used throughout the platform. Current state of the art seems to make them reasonably visible to node operators: #4939 / #4471. See also logging issues.
As to RPC clients: if writing latest round info fails, is writing an error message likely to succeed?
And if it's a transient problem, we can expect it to self-heal, since rounds happen on a regular cadence.
@@ -177,6 +177,7 @@ test.serial('invitations', async t => { | |||
* @returns {Promise<[{description: string, instance: Instance}]>} | |||
*/ | |||
const getInvitationFor = async (desc, len, balances) => { | |||
await eventLoopIteration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I often feel obliged to say why I'm adding await eventLoopIteration()
. I wonder about an alias such as await vstorageWritesVisible()
.
* | ||
* @param {import('@agoric/vat-data').Baggage} baggage | ||
*/ | ||
export const makeStorageNodePathProvider = baggage => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a breaking chore seems a little funky. I wonder if this is really a fix... if makeStorageNodePathProvider
broke some rule(s) and hence was buggy. not critical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*/ | ||
|
||
/** | ||
* @param {Baggage} baggage | ||
* @param {ZCF} zcf | ||
* @param {import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit} makeRecorderKit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concur.
import { setup } from '@agoric/zoe/test/unitTests/setupBasicMints.js'; | ||
import { makePublishKit } from '@agoric/notifier'; | ||
import { makeBoard } from '@agoric/vats/src/lib-board.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makeBoard
is no longer used? Oh... I see it moved up. I wonder what's missing in our toolkit that results in these spurious diffs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's missing in our toolkit
Linting for import ordering. When some import is no longer used there is a lint error, and I fix it up with TypeScript's "Organize imports" function. If we can agree on import ordering rule I'd use that instead (by doing Organize imports and then running the linter with --fix.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -232,7 +232,7 @@ export const subscriptionKey = subscription => { | |||
|
|||
/** | |||
* | |||
* @param {ERef<{getPublicTopics: () => import('@agoric/notifier').TopicsRecord}>} hasTopics | |||
* @param {ERef<{getPublicTopics: () => import('@agoric/zoe/src/contractSupport').TopicsRecord}>} hasTopics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're leaving off /index.js
on purpose, I trust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes b/c TS still automatically resolves /index.js
(Node style)
@@ -425,6 +424,7 @@ export const prepareVaultManagerKit = ( | |||
// about the installation and terms of the liqudation contract. We could | |||
// have another notifier for state downstream of governance changes, but | |||
// that doesn't seem to be cost-effective. | |||
// @ts-expect-error FIXME never defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think replaceable liquidator contracts wasn't preserved in the move to auctions. If I'm right, the impact is just some vestigial code and a little bit of unused storage. Orthogonal to this PR.
/** | ||
* For use in tests | ||
*/ | ||
export const prepareMockRecorderKitMakers = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test-only code doesn't usually belong under .../src
. Can this be a helper published from @agoric/zoe/tools
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll move it in #7392
@@ -425,6 +424,7 @@ export const prepareVaultManagerKit = ( | |||
// about the installation and terms of the liqudation contract. We could | |||
// have another notifier for state downstream of governance changes, but | |||
// that doesn't seem to be cost-effective. | |||
// @ts-expect-error FIXME never defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dan's right. The comment above and variable should go away. There doesn't appear to be any code that touches it.
closes: #7300
Description
Fully removes
pipeTopicToStorage
. To do so required updating these contracts:chain-main.js also imported it and I didn't want to touch that too much so moved the definition within the module.(removed separately)That freed up removing it from
@agoric/notifer
.This also moves the remaining exports of
stored-topics.js
to Zoe contract support, since they were to support "PublicTopic" and that's a contract level convention.There are also testing and types improvements along the way.
Security Considerations
--
Scaling Considerations
Eliminiates use of non-scalable
pipeTopicToStorage
in contracts.Documentation Considerations
Breaking changes, indicated with
!
commits.Testing Considerations
CI