-
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
orchestration package with stakeBLD #9078
Conversation
50e8da4
to
b1067c6
Compare
@@ -0,0 +1,23 @@ | |||
/* global setTimeout */ |
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 files in this directory are mostly from packages/agoric-cli. I think we'll want to DRY it but I don't know when. I'm reluctant to have more exports from agoric-cli. I could see them going in ui-kit though. Or @agoric/contracts as support tools. I figure it's okay to duplicate for tests .
I put them in "test-lib" instead of "lib" in service of Agoric/agoric-3-proposals#115
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 could see them going in ui-kit though.
I lean that way.
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.
Punting to #9109
*/ | ||
(account, storageNode) => { | ||
// must be the fully synchronous maker because the kit is held in durable state | ||
const topicKit = makeRecorderKit(storageNode, PUBLIC_TOPICS.account[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.
Is anything being published to vstorage yet? A requirement is not specified in the original ticket, but it seems like something we should tackle (perhaps via a follow up ticket). Could be a good addition to this test - we could check delegatorAddress against something published to vstorage.
This likely needs design and additional input, but as a rough sketch we might want to do something like -
// `${API_URL}/cosmos/auth/v1beta1/accounts/${ACCT_ADDR}`
{
"address": "agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce",
"pub_key": {
"@type": "/cosmos.crypto.secp256k1.PubKey",
"key": "AgX1pQy65LmFCazXlahDxmgoDXxaiVFRwOnxj5Wo8ZCo"
},
"account_number": "138",
"sequence": "404"
}
helper: UnguardedHelperI, | ||
holder: HolderI, | ||
invitationMakers: M.interface('invitationMakers', { | ||
Delegate: HolderI.payload.methodGuards.makeDelegateInvitation, |
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.
Not in the original requirements, but additional actions we'll likely need -
- Ability to claim (and withdraw) rewards
- Ability to undelegate / unbond
- Ability to redelegate to a different validator
Queries are also coming to mind -
- Current Delegations
- Claimable Rewards
- Current Redelegations
- Current Unbondings
* @param {string} validatorAddress | ||
* @param {Amount<'nat'>} ertpAmount | ||
*/ | ||
async makeDelegateInvitation(validatorAddress, ertpAmount) { |
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.
Likely out of scope for this PR, but thinking about how we are also accommodating contract consumers (that do not have a smart-wallet compat requirement).
This accommodation might manifest via multiple methods in the PF - one for a SW and one for a SC like sendTo
and makeSendInvitation
in postalSvc:
https://github.com/agoric-labs/ag-power-tools/blob/main/contract/src/postalSvc.js#L60-L61
We may instead want to treat this as just an example contract and tackle this requirement in vat-orchestration
.
Co-Authored-By: turadg <turadg@agoric.com>
closes: #9075
closes: #8857
Description
This implements a StakeBLD story and adds tests for it. The bootstrapTests were made first, to move quickly without Cosmos integration. The a3p test verifies the Cosmos delegation happens.
This also adds the
@agoric/orchestration
package, which could be separated into another PR.Security Considerations
Cosmos transactions through JS APIs. This is just an example contract though.
Scaling Considerations
n/a, won't be in production
Documentation Considerations
We will need to document LocalChain usage more and perhaps some of the testing utilities.
Testing Considerations
This required some new testing tools, adapted from agoric-cli. At some point we should make them a supported library.
Upgrade Considerations
The proposals here won't be sent to Mainnet.