Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 208 forks source link

orchestration - ICA Controller - Staking - BeginUndelegate API #9070

Closed ivanlei closed 6 months ago

ivanlei commented 8 months ago

What is the Problem Being Solved?

https://github.com/Agoric/agoric-sdk/issues/9065 describes a generic method for sending ICA commands.

The BeginUndelegate API should build on that, allowing a cosmos.staking.v1beta1.MsgBeginRedelegate message to be sent without the caller needing to build a representation of the message objects.

This API should make use of the faux notification capability to return a promise that resolves when the redelegate is complete.

see also:

Description of the Design

Security Considerations

Scaling Considerations

Test Plan

Upgrade Considerations

dckc commented 6 months ago

MsgCancelUnbondingDelegation requires creation_height. It seems unlikely that a contract would be able to come up with this. Do we assume the caller somehow comes up with it? For now, I assume so.

  // creation_height is the height which the unbonding took place.
  int64 creation_height = 4;

p.s. looks like there's a query to get creation_height: https://docs.cosmos.network/main/build/modules/staking#msgbeginredelegate

dckc commented 6 months ago

splitting out cancelUnbond, since it seems to need design and might not be as urgent: