-
Notifications
You must be signed in to change notification settings - Fork 215
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: fusdc chain policy limits #10814
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
750eb2f
to
1e30ac9
Compare
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.
oops; I gotta run.
this is what I have so far...
|
||
if (values.help) { | ||
console.log(` | ||
Usage: |
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 move this Usage string constant to the top of the file.
I was going to ask for a file comment, but this is in some ways better.
The file name gave very little clue about what it's for too... though now that I see what it's for, I suppose that name is not bad. But maybe fast-usdc-tool.ts
would be better.
./fast-usdc.ts fund-pool | ||
./fast-usdc.ts fund-faucet | ||
`); | ||
process.exit(0); |
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'd rather we don't hide use of this very powerful process.exit
authority under the name parseCommandLine()
. Return undefined
or throw or something instead, please?
}; | ||
|
||
const main = async () => { | ||
const { command, mnemonic, oracles, provisionOracles } = parseCommandLine(); |
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.
const { command, mnemonic, oracles, provisionOracles } = parseCommandLine(); | |
const job = parseCommandLine(); | |
if (!job) return; | |
const { command, mnemonic, oracles, provisionOracles } = job; |
); | ||
} | ||
}, | ||
} as unknown as ExecutionContext; |
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.
would this suffice?
} as unknown as ExecutionContext; | |
} as Pick<ExecutionContext, 'log' | 'is'>; |
const assertProvisioned = async address => { | ||
try { | ||
await vstorageClient.queryData(`published.wallet.${address}.current`); | ||
return 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.
return true; | |
return; |
}, | ||
nobleAgoricChannelId: 'channel-21', | ||
nobleDomainId: 4, | ||
body: '#{"chainPolicies":{"Arbitrum":{"attenuatedCttpBridgeAddress":"0xe298b93ffB5eA1FB628e0C0D55A43aeaC268e347","blockWindowSize":10,"cctpTokenMessengerAddress":"0x19330d10D9Cc8751218eaf51E8885D058642E08A","chainId":42161,"confirmations":2,"maxAmountPerBlockWindow":"+20000000000"}},"nobleAgoricChannelId":"channel-21","nobleDomainId":4}', |
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 function for documenting vstorage supports rendering this nicely. There's a show function or something.
return JSON.parse(feedPolicy); | ||
const parsed = JSON.parse(feedPolicy); | ||
if (!parsed.chainPolicies) { | ||
// chainPolicies contain bigints which can't be stringified |
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 should use LegibleCapData then, I think
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.
oic... this is saying "if the CLI arg doesn't have chainPolicies, fill it in from MAINNET"
maybe that's good enough
*/ | ||
const publishFeedPolicy = async (node, policy) => { | ||
const publishFeedPolicy = async (node, marshaller, policy) => { |
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.
can policy
have remotables in it? if not, you can use a data-only marshaller that's local to this function.
@@ -32,7 +35,7 @@ const publishFeedPolicy = async (node, policy) => { | |||
* @param {{ options: LegibleCapData<{feedPolicy: FeedPolicy & Passable}> }} config | |||
*/ | |||
export const updateFastUsdcPolicy = async ( | |||
{ consume: { agoricNames, chainStorage } }, | |||
{ consume: { agoricNames, board, chainStorage } }, |
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 board marshaller looks like overkill.
*/ | ||
const publishFeedPolicy = async (node, policy) => { | ||
const publishFeedPolicy = async (node, marshaller, policy) => { |
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.
again, I don't think the marshaller needs to be passed in
6555348
to
378f571
Compare
cctpTokenMessengerAddress: '0x1682Ae6375C4E4A97e4B583BC394c861A46D8962', | ||
chainId: 8453, | ||
confirmations: 2, | ||
maxAmountPerBlockWindow: 20000000000n, |
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.
to get this to show up next to blockWindowSize
, maybe...
maxAmountPerBlockWindow: 20000000000n, | |
blockWindowMaxAmount: 20000000000n, |
}; | ||
|
||
const start = async () => { | ||
if (!chainInfo.noble) { |
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 looks like the env stuff is gone (yay!), but I still can't see how chainInfo.noble
is anything but a design-time constant.
7088f49
to
3ec61df
Compare
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 for the feedback @dckc . I think all comments are addressed, thanks for spending time to walk me through the data only marshaller.
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.
👍
utility script to assist with local development. includes: - start contract with optional --oracles - fund agoric faucet with USDC from remote chain - fund Liquidity Pool for USDC - provision smart wallet (using --mnemonic)
- ensure `ChainPolicy` can support multiple bridge attenuation contracts
3ec61df
to
1b1b52d
Compare
closes: #10812
Description
rateLimits
to ChainPolicy:attenuatedCttpBridgeAddress
toattenuatedCttpBridgeAddresses
to accept a list of attenuated bridge contracts.fast-usdc-tool.ts
script tomultichain-testing
to bootstrapfast-usdc
and set up an environment for testing with the OCW.Security Considerations
This is an additional line of defense for FUSDC to limit the total value flowing through the system over a window of blocks.
Scaling Considerations
None, handled in off-chain oracle operator software.
Documentation Considerations
None
Testing Considerations
Updates existing tests
Upgrade Considerations
None, targeting initial release of FUSDC.