-
Notifications
You must be signed in to change notification settings - Fork 212
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
chore(fast-usdc): limited operation before connecting to noble #10641
Conversation
@@ -81,9 +84,12 @@ const configurations = { | |||
}, | |||
}, | |||
chainInfo: /** @type {Record<string, CosmosChainInfo & Passable>} */ ( | |||
withChainCapabilities(fetchedChainInfo) | |||
withChainCapabilities({ |
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.
please explain in a comment why these two customizations are necessary
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.
good catch; turns out the noble:
one is not necessary after all.
p.s. I'm also adding a comment
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.
oh yeah... adding noble is required. to prevent that error
@@ -126,7 +126,7 @@ export const contract = async (zcf, privateArgs, zone, tools) => { | |||
}); | |||
|
|||
const makeFeedKit = prepareTransactionFeedKit(zone, zcf); | |||
assertAllDefined({ makeFeedKit, makeAdvancer, makeSettler, statusManager }); | |||
assertAllDefined({ makeFeedKit, makeSettler, statusManager }); |
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 whole line can be removed. they're all made locally.
}); | ||
|
||
const advancer = zone.makeOnce('Advancer', () => | ||
makeAdvancer({ | ||
const { advancer, admin: advancerAdmin } = zone.makeOnce('AdvancerKit', () => |
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.
while separate an admin
facet when advancer
is never passed out of this scope? It's also exposing two advancer facets that weren't before. Please justify (perhaps in a comment) or revert
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.
after internal discussion, I realized operating with no noble connection is change to the advancer API, so we might as well put the new method there.
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.
LGTM, nice solution keeping the startFn prompt.
what to do if nobleAccountV rejects?
It seems we can't do much without this. I'd suggest including a try/catch in connectToNoble
and log loudly if something fails. IRL remediation seems like a contract upgrade / additional proposal if this were to happen.
* @param {ChainAddress|undefined} intermediateRecipient | ||
* @returns {IBCMsgTransferOptions | undefined} | ||
*/ | ||
const ibcOpts = intermediateRecipient => |
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.
nit: consider moving this helper to utils
since we also use it in settler.js
. And maybe rename to ibcTransferOpts: IBCMsgTransferOptions
to be more specific
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 1-2 liners like this, I tend to think DRY is more trouble than it's worth.
One thing that really bugs me about typescript is that factoring out an expression like this as a function requires all sorts of type annotations. With flow, the tool just figured it out. The only thing you have to annotate is stuff that's exported from a module.
In this case, I may just inline it. intermediateRecipient
is allowed to be undefined anyway.
@@ -236,6 +236,11 @@ export const startFastUSDC = async ( | |||
|
|||
produceInstance.reset(); | |||
produceInstance.resolve(instance); | |||
|
|||
if ('uusdc' in assetInfo) { |
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 if block is to prevent us from calling connectToNoble
in the a3p environment? If so, it might conflict with the suggestion to include chainName: 'noble'
assets in assetInfo
.
Maybe we should have a builderOpt
instead, where the caller needs to opt-out?
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.
good idea; I'll try that...
ac8cf06
to
b58edbd
Compare
Deploying agoric-sdk with Cloudflare Pages
|
b58edbd
to
8056b7c
Compare
odd ci failure...
|
@@ -38,6 +38,7 @@ const options = { | |||
}, | |||
chainInfo: { type: 'string' }, | |||
assetInfo: { type: 'string' }, | |||
noNoble: { type: 'boolean', default: false }, |
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.
consider making the option phrased positively. e.g. connectNoble
.
I think the default could still be false. connecting to Noble has strictly more dependencies on the environment so makes sense to be opt-in
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, it's more dependencies, but without a connection to noble, the whole notion of "fast usdc" goes away. It's supported only for a limited form of testing. If somebody forgot to set the flag, the normal condition should be that the product works.
intermediateRecipient, | ||
}, | ||
}, | ||
{ denom: usdc.denom, value: advanceAmount.value }, |
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 surprised prettier change the second argument too
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 didn't. I tried a helper for the 1st arg and then took it out, and used the more concise form when I took it out. I realized the second arg didn't need the line-breaks either.
* }} config | ||
*/ | ||
config => { | ||
log('config', config); | ||
return { | ||
...config, | ||
// make sure the state record has this property, perhaps with an undefined value |
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.
consider using "the state schema" to suggest the implications
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 schema is below in stateShape
, right? That's how I knew to write the code this way: it refused to store the state record without this property.
chainInfo: Record<string, CosmosChainInfo & Passable>; | ||
assetInfo: [Denom, DenomDetail & { brandKey?: string }][]; | ||
}; | ||
} & CopyRecord; |
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.
consider putting it at the front (like Passable &
was) so it's more noticeable.
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 we want it to be noticeable? It's only here due to limitations in tsc or the Passable type or something.
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 we want it to be noticeable?
Because it's unexpected
/** | ||
* @type {Record<string, Pick<FastUSDCConfig, 'oracles' | 'feedPolicy' | 'chainInfo' | 'assetInfo' >>} | ||
* | ||
* TODO: determine OCW operator addresses | ||
* meanwhile, use price oracle addresses (from updatePriceFeeds.js). | ||
*/ | ||
export const configurations = { | ||
/** | ||
* NOTE: The a3p-integration runtime does _not_ include |
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.
👍
8056b7c
to
fac5834
Compare
now what?!?!?
|
fac5834
to
8874419
Compare
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
- contract start can't wait for noble account creation; must finish in one crank for upgrade - prune allDefined(...) of locally created objects - allow undefined intermediateRecipient in advancer, settler - prune goofy advancer default caps arg - add noNoble config option - Passable obscured that FastUSDCConfig is a record - no noble chain in a3p-integration config
8874419
to
c9ba09e
Compare
This pull request has been removed from the queue for the following reason: Pull request #10641 has been dequeued. The pull request rule doesn't match anymore. The pull request has been synchronized by a user.. You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
@Mergifyio requeue |
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
closes: #10657
refs: #10328
Description
nobleAccountV
vowSecurity / Documentation Considerations
While the noble account vow has not fulfilled, diagnostics for advancing to non-agoric chains are likely to be obscure.
Configuration flexibility leads to possibility of configuration errors.
Scaling Considerations
n/a
Testing Considerations
existing tests, but with
set -e
so that whenfastUsdc
is not inagoricNames.instance
, we actually notice.Upgrade Considerations
nobleAccountV
persists across incarnations, so we won't try to make another one on restart / upgrade.TODO:
nobleAccountV
rejects?