-
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
fix(fast-usdc): update noble connection info, make new ICA #11025
base: master
Are you sure you want to change the base?
Conversation
- adds `updateChain`, `updateConnection`, and `updateAsset` interfaces to `ChainHub`
... used in mainnet proposal 87 - skip start-fast-usdc in favor of prop 87 - never ack initial noble ICA creation
- snapshot fastUsdc.nobleICA
Their invitations are made with non-durable offer handlers.
Deploying agoric-sdk with
|
Latest commit: |
d613d1a
|
Status: | ✅ Deploy successful! |
Preview URL: | https://e3f8675f.agoric-sdk.pages.dev |
Branch Preview URL: | https://dc-noble-conn.agoric-sdk.pages.dev |
); | ||
if (contractName in instances) { | ||
return t.log('Contract found. Skipping installation...'); | ||
if (contractBuilder.endsWith('/start-fast-usdc.core.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.
this is a bit of a KLUDGE. Once I can tell that it's working, I expect to refactor it.
see XXX note below
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.
Suggestion: add a 4th opts bag argument to startContract
, { skipInstanceCheck = false }
, to make this declarative.
trace('noble ICA', nobleICAaddr); | ||
|
||
// publish ICA addr at published.fastUsdc.nobleICA | ||
// TODO: update vstorage snapshot tests |
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 done.
// TODO: update vstorage snapshot tests |
@@ -279,6 +285,8 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
const [_agoric, _noble, agToNoble] = await vowTools.when( | |||
chainHub.getChainsAndConnection('agoric', 'noble'), | |||
); | |||
// 1) should we have used zone.makeOnce 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.
yes, to preserve precious state (mintedEarly). TODO.
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.
let's discuss synchronously.
@@ -279,6 +285,8 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
const [_agoric, _noble, agToNoble] = await vowTools.when( | |||
chainHub.getChainsAndConnection('agoric', 'noble'), | |||
); | |||
// 1) should we have used zone.makeOnce here? | |||
// 2) will we get an error since we're trying to register a tap on the same LCA? |
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.
no, I gather. NEEDSTEST?
likewise, no re monitorMintingDeposits
below.
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.
+1
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.
We're going to need an a3p-integration proposal test eventually (since this proposal has to go into agoric-3-proposals) but using bootstrap suffices for merging to master.
|
||
[ | ||
[ | ||
'published.fastUsdc.nobleICA', |
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.
why create this node?
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.
Aside from being generally useful for grabbing the address for use in explorers and such, it's a handy way to tell whether this core eval succeeded.
Perhaps we should publish just the .value
of the address?
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.
why not put it on published.fastUsdc
with the other addresses? (e.g. poolAddress
)
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.
sure; that will work.
@@ -294,6 +294,8 @@ export const AckBehavior = { | |||
Queued: 'QUEUED', | |||
/** inbound messages are delivered immediately */ | |||
Immediate: 'IMMEDIATE', | |||
/** inbound responses never arrive (to simulate mis-configured connections etc.) */ | |||
Never: 'NEVER', |
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.
nice. do we need this implemented in all cases?
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.
there are other cases? help?
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.
just looking at that switch
, you handled case 'startChannelOpenInit'
but no change to case 'sendPacket'
const { writeCoreEval } = await makeHelpers(homeP, endowments); | ||
|
||
/** @returns {{ agoricToNoble?: IBCConnectionInfo } & Passable} */ | ||
const parseConnection = () => { |
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.
usually these builder functions are almost declarative.
consider moving this up to module scope,
export const parseConnection = (args) => {
that would also allow unit testing
@@ -197,6 +197,9 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
deleteCompletedTxs() { | |||
return statusManager.deleteCompletedTxs(); | |||
}, | |||
getChainHub() { |
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.
food for thought: withOrchestration
could automatically provide such methods, wrapping the contract
return value. E.g. instead of creatorFacet
it could return orchestrationFacet
or something.
probably too much magic as yet
@@ -258,7 +261,10 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
); | |||
} | |||
|
|||
const nobleAccountV = zone.makeOnce('NobleAccount', () => makeNobleAccount()); | |||
// v1 has `NobleAccount` which we don't expect to ever settle. how can we delete it? | |||
const nobleAccountV = zone.makeOnce('NobleAccount2', () => |
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.
maybe we can give this a name that doesn't reek of "oops"
perhaps with the channel id?
const nobleAccountV = zone.makeOnce('NobleAccount2', () => | |
const nobleAccountV = zone.makeOnce('NobleAccount-62', () => |
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.
or, NobleICA
@@ -279,6 +285,8 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
const [_agoric, _noble, agToNoble] = await vowTools.when( | |||
chainHub.getChainsAndConnection('agoric', 'noble'), | |||
); | |||
// 1) should we have used zone.makeOnce 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.
let's discuss synchronously.
@@ -305,6 +313,7 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
}, | |||
}); | |||
|
|||
// TODO do we need to wrap this in `if (!baggage.has(firstIncarnationKey))` ? |
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.
depends on whether settlerKit
persists. it was designed at first to be per incarnation
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 with mintedEarly: MapStore
in its state warrants making a singleton
bech32PrefixToChainName.delete(oldInfo.bech32Prefix); | ||
} | ||
chainInfos.set(chainName, chainInfo); | ||
if (chainInfo.bech32Prefix) { |
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.
why would new info and old info have different presence of bech32prefix
?
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 why someone would do this, but i think it's a foreseeable state this code needs to handle
* @throws {Error} If asset not registered or referenced chains not | ||
* registered | ||
*/ | ||
updateAsset(denom, detail) { |
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.
since it's replacing the entry replaceAsset
?
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.
if we want replace*
, we should make the same change on the *connection
, *chain
methods
@@ -258,7 +261,10 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
); | |||
} | |||
|
|||
const nobleAccountV = zone.makeOnce('NobleAccount', () => makeNobleAccount()); | |||
// v1 has `NobleAccount` which we don't expect to ever settle. how can we delete it? | |||
const nobleAccountV = zone.makeOnce('NobleAccount2', () => |
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.
or, NobleICA
@@ -279,6 +285,8 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
const [_agoric, _noble, agToNoble] = await vowTools.when( | |||
chainHub.getChainsAndConnection('agoric', 'noble'), | |||
); | |||
// 1) should we have used zone.makeOnce here? | |||
// 2) will we get an error since we're trying to register a tap on the same LCA? |
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.
+1
@@ -305,6 +313,7 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
}, | |||
}); | |||
|
|||
// TODO do we need to wrap this in `if (!baggage.has(firstIncarnationKey))` ? |
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 with mintedEarly: MapStore
in its state warrants making a singleton
if (!chainInfos.has(chainName)) { | ||
throw makeError(`Chain ${q(chainName)} not registered`); | ||
} | ||
if (!chainInfos.has(baseName)) { | ||
throw makeError(`Chain ${q(baseName)} not registered`); | ||
} |
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 code was written in haste - i think this block should be above the one where we brandDenoms.delete
* @throws {Error} If asset not registered or referenced chains not | ||
* registered | ||
*/ | ||
updateAsset(denom, detail) { |
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.
if we want replace*
, we should make the same change on the *connection
, *chain
methods
bech32PrefixToChainName.delete(oldInfo.bech32Prefix); | ||
} | ||
chainInfos.set(chainName, chainInfo); | ||
if (chainInfo.bech32Prefix) { |
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 why someone would do this, but i think it's a foreseeable state this code needs to handle
); | ||
if (contractName in instances) { | ||
return t.log('Contract found. Skipping installation...'); | ||
if (contractBuilder.endsWith('/start-fast-usdc.core.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.
Suggestion: add a 4th opts bag argument to startContract
, { skipInstanceCheck = false }
, to make this declarative.
test.serial('reconfigure: fix noble ICA', async t => { | ||
const { startContract, commonBuilderOpts } = t.context; | ||
const builder = | ||
'../packages/builders/scripts/fast-usdc/fast-usdc-reconfigure.build.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.
Nice. Thinking out loud...
Is it critical we have a reference to the original bundleId
/ build ? i.e. something without the new creator facet methods?
Probably not for now, the faulty chainInfo seems sufficient. Likely just something to think about for the future
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.
Here's hoping we get a3p + multichain better connected:
closes: #11013
Description
TODO:
fast-usdc.contract.js
: address upgrade TODOsSecurity Considerations
creatorFacet.getChainHub()
increases the surface area of the contract.Since the creator provided
chainInfo
andassetInfo
inprivateArgs
to start with, it's a small increase.Scaling Considerations
none, I think.
Testing Considerations
TODO:
boot/
. maybe this works now?)Upgrade / Documentation Considerations
OCW operators have to accept their invitations before the upgrade, since their invitations are attached to ephemeral offer handlers.
TODO: