Skip to content
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

feat: restake example contract #9821

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

0xpatrickdev
Copy link
Member

@0xpatrickdev 0xpatrickdev commented Aug 1, 2024

closes: #XXXX
refs: #9796

Description

Currently: a working restake contract that we'd like to refactor to use async-flow for continuing invitations (versus the current restake.kit.js methods which use vowTools)

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Upgrade Considerations

Copy link

cloudflare-workers-and-pages bot commented Aug 1, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7e01722
Status: ✅  Deploy successful!
Preview URL: https://af760719.agoric-sdk.pages.dev
Branch Preview URL: https://9796-restake-continuing-invs.agoric-sdk.pages.dev

View logs

* }} RestakeParams
*/

export const restakeInvitaitonGuardShape = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling

Comment on lines 223 to 227
const { delay, interval } = opts;
delay >= minimumDelay ||
Fail`delay must be at least ${minimumDelay}`;
interval >= minimumInterval ||
Fail`interval must be at least ${minimumInterval}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason not to use TimeMath here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No - thanks for bringing it to attention. The latest plan for #9796 doesn't seem to depend on this PR, but will make sure to use TimeMath when this PR is picked up again.

@turadg turadg force-pushed the 9796-restake-continuing-invs branch from 548878b to d56616a Compare September 3, 2024 19:52
Comment on lines 215 to 222
mustMatch(
validator,
ChainAddressShape,
'invalid validator address',
);
mustMatch(opts, RepeaterOptsShape, 'invalid repeater options');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mustMatch(
validator,
ChainAddressShape,
'invalid validator address',
);
mustMatch(opts, RepeaterOptsShape, 'invalid repeater options');

covered by interface guard

mergify bot added a commit that referenced this pull request Sep 6, 2024
closes: #9796

## Description
Demonstrates a pattern for creating continuing invitations that have handlers written as orchestration flows.

Builds upon the combine-invitation-makers from #9821

### Security Considerations
None

### Scaling Considerations
Augmenting an existing exo's invitationMaker requires two new ones: the exo holding the other makers and an exo to wrap them both.

### Documentation Considerations
Once this lands it should have an explicit tutorial for developers needing this functionality.

### Testing Considerations
new tests

### Upgrade Considerations
not yet deployed
- A contract that allows calls to make an OrchestrationAccount, and
 subsequently schedule a restake (claim and stake rewards) on an interval.
- Leverages existing invitation makers like Delegate and combines them with
 Restake and CancelRestake.
- interact with timerService and repeater in `contract` context (using E, promises)
- invoke flow in wake handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants