-
Notifications
You must be signed in to change notification settings - Fork 208
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
9063 init chainInfo #9477
9063 init chainInfo #9477
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
5014f3e
to
d90897b
Compare
"ava": { | ||
"concurrency": 1, | ||
"serial": true, |
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.
@0xpatrickdev you mentioned using serial
in the starship work; apparently that's pretty normal for this sort of thing.
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 sure about some details around publishNameHubs
@@ -16,7 +16,6 @@ const makeDefaultTestContext = async t => { | |||
); | |||
return swingsetTestKit; | |||
}; | |||
|
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.
stray/left-over edit?
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.
spacing for readability
const current = await wd.getCurrentWalletRecord(); | ||
const latest = await wd.getLatestUpdateRecord(); | ||
const current = wd.getCurrentWalletRecord(); | ||
const latest = wd.getLatestUpdateRecord(); |
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.
synchronous IO feels funny. But I guess the wallet driver API is that it doesn't do IO here?
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, what it's reading is local
@@ -17,7 +17,6 @@ const makeDefaultTestContext = async t => { | |||
); | |||
return swingsetTestKit; | |||
}; | |||
|
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.
another stray / leftover edit?
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.
ditto
* stakeBld: Installation< | ||
* import('../../src/examples/stakeBld.contract.js').start |
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.
that would be a Promise<Installation<...>>
, right?
In fact, why declare a stakeBld
installation here at all? it's not used.
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.
thanks. leftover from an earlier state. I'll remove
@@ -86,6 +108,12 @@ export const getManifestForOrchestration = (_powers, { orchestrationRef }) => ({ | |||
orchestrationVat: 'orchestrationVat', | |||
}, | |||
}, | |||
[initChainInfo.name]: { | |||
consume: { | |||
agoricNames: true, |
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.
it's harmless, but why is agoricNames
here?
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.
thanks. leftover from an earlier state. I'll remove
* @deprecated use reflectAgoricNamesToChainStorage | ||
* @deprecated use publishAgoricNamesToChainStorage |
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.
that prompted me to realize: adding chain
under agoricNames doesn't automatically publish it to vstorage. We need to call E(agoricNames).publishNameHubs(..., ['chain'])
.
Want to add a test that the chain info is visible from vstorage?
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.
that explains the trouble I was running into.
what happens when a new chain is added, do we need to call publishNameHubs
again? I kind of expected agoricNames would auto-update its vstorage using the onUpdate
callback. Should 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.
confirmed:
agoric-sdk/packages/vats/src/vat-agoricNames.js
Lines 64 to 67 in e193e66
const recorderKit = | |
await E(vatBoard).makePublishingRecorderKit(kindNode); | |
kindAdmin.onUpdate(recorderKit.recorder); | |
}), |
Doesn't adding chain
to agoricNamesReserved
get this auto-updater? I"ll add an explicit test
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.
Once we call E(agoricNames).publishNameHubs(..., ['chain'])
, each time a chain is added, the whole list of entries in vstorage will get updated. But just doing E(agoricNamesAdmin).provideChild('chain')
isn't enough to get the updates started for the new namehub.
packages/vats/src/core/utils.js
Outdated
chain: { | ||
agoric: 'Agoric chain info', | ||
}, |
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.
Is this used? It suggests that agoricNames
had a chain
child all along. It might hide the problem that we need to call E(agoricNames).publishNameHubs(..., ['chain'])
when running the orchestration-proposal.js
core eval.
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.
It suggests that agoricNames had a chain child all along
I was on the fence about this but the js doesn't say anything about bootstrap,
agoric-sdk/packages/vats/src/core/utils.js
Lines 16 to 17 in 96c19f5
* We reserve these keys in name hubs. | |
* |
If it means only reserved before the chain boots, I can take this out but I'd want to include new documentation and probably move these core/utils.js
things that are meant only for bootstrap into a module that makes that clear. Please advise.
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.
Note, this is the change that was necessary to make publishNameHubs
set up an onUpdate
to publish each new entry to vstorage.
{ | ||
"interestRateValue": 1000, | ||
"interchainAssetOptions": { | ||
"denom": "ibc/toyatom", |
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.
Calling this ibc/toyatom
/ ATOM
will present an issue when using this config for e2e testing with sim chains and relayers.
Is it straightforward to call this something generic like STAKE
to prevent the collision?
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.
It will require a lot of other things to change. I'll see if they fit easily into 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.
The wallet driver depends on that right now,
agoricNamesRemotes.brand.ATOM || Fail`ATOM missing from agoricNames`; |
This was the status quo so I consider changing it out of scope. Many tests use that so it's worth handling in its own PR or in one that will break because of it.
"@agoric/builders/scripts/vats/init-network.js", | ||
"@agoric/builders/scripts/vats/init-localchain.js", | ||
"@agoric/builders/scripts/vats/init-transfer.js", | ||
"@agoric/builders/scripts/vats/init-transfer.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.
"@agoric/builders/scripts/vats/init-transfer.js", |
d90897b
to
f880c46
Compare
f880c46
to
5d4b6fd
Compare
if (!chainStorage) { | ||
console.warn('no chain storage, not registering chain info'); | ||
return; | ||
} |
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.
sigh; here's hoping we can get rid of this before long
Far('chain info writer', { | ||
write(entries) { | ||
// chainInfo has no cap data but we need to marshal bigints | ||
const marshalData = makeMarshal(_val => Fail`data only`); |
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.
👍 interesting... no round trip thru board
refs: #9063
Description
Progress on,
To be closed when all the names in the checklist are present.
Security Considerations
none
Scaling Considerations
none
Documentation Considerations
none
Testing Considerations
Updated test setup
Upgrade Considerations
Not yet deployed