-
Notifications
You must be signed in to change notification settings - Fork 206
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
fix: remove well-known-name limitation on reserved brands etc. #7604
Conversation
2f06b7e
to
4e9bad6
Compare
These are the symptoms reported in #7602, presumably fixed in #7612. So I suppose this is blocked by #7612.
https://github.com/Agoric/agoric-sdk/actions/runs/4886307394/jobs/8721581067?pr=7604#step:5:3566 |
@@ -85,7 +85,7 @@ export const makeNameHubKit = () => { | |||
|
|||
/** @type {import('./types.js').NameAdmin} */ | |||
const nameAdmin = Far('nameAdmin', { | |||
provideChild(key) { | |||
provideChild(key, reserved = []) { |
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 thought i was going to add this later; I guess I got split-brain.
* @typedef {{ | ||
* consume: Record<string, Promise<V>>, | ||
* produce: Record<string, Producer<V>>, | ||
* }} PromiseSpace |
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.
Odd; I thought I was using that in the hooks.
* ) | (typeof console.log)} [optsOrLog] | ||
* @returns {PromiseSpace<V>} | ||
* @returns {PromiseSpaceOf<T>} |
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. cool.
@@ -36,18 +36,18 @@ export {}; | |||
* @property {(key: string) => Promise<void>} reserve Mark a key as reserved; will | |||
* return a promise that is fulfilled when the key is updated (or rejected when | |||
* deleted). If the key was already set it does nothing. | |||
* @property {<T>( key: string, newValue: T, newAdmin?: unknown) => | |||
* @property {<T>( key: string, newValue: T, newAdmin?: NameAdmin) => |
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.
this is tricky... we can't really enforce it at runtime, but we sort of rely on 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.
for all our function signatures, the param types are meant to inform the caller. the function receiving the params can't trust anything except within a guarded Exo
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.
right; we shouldn't rely on the caller giving the correct type at runtime; i wonder whether we do
In the case of `{ brand: { consume: { abc } }`, reserve abc even though it's not among the statically defined reserved names.
206d58c
to
44fdc31
Compare
@Mergifyio refresh |
✅ Pull request refreshed |
@Mergifyio requeue |
☑️ This pull request is already queued |
The chain deployment tests passed but Mergify is wedged so I'm going to try a fresh push with bypass. |
@Mergifyio requeue |
☑️ This pull request is already queued |
refs: #4548
Description
While refactoring the promise space to support a backing store, I it was straightforward to address a long-standing wart:
In the case of
{ brand: { consume: { abc } }
, reserveabc
even though it's not among the statically defined reserved names.
Security / Scaling Considerations
none
Documentation Considerations
This reduces a burden on MN-2 core eval proposals, as discussed recently...
#6839 (comment)
Testing Considerations
happy-path unit tests for enhancements to PromiseSpace, NameHub APIs.