Skip to content

Report descriptive error message when migrations fail #472

@rickstaa

Description

@rickstaa

Describe the bug

During a migration, when a user claims their stake, the pool calls the bonding manager to execute a transferBond. Due to protocol safeguards, this call will fail if the orchestrator the user originally staked to on L1 (now represented on L2) has not yet called reward. At present, this failure surfaces to users as a generic error, providing no indication of the underlying cause.

To Reproduce

Currently hard to reproduce without us launching a testnet unless you have an old wallet with unmigrated stake.

Expected behavior

We should catch the error and explain this behavoir. "The migration currently failed since your orchestrator has not yet called rewards and doing the claim would cause the pool to lose out of inflation rewards. If the orchestrator stays inactive for to long you could use the claimEarnings yourself on L2 to override this`.

Screenshots

We should catch the ILLEGAL_CLAIM_EARNINGS error and surface a clear explanation to the user.

“The migration failed because your orchestrator has not yet called reward. Proceeding with the claim now would cause the pool to forgo inflationary rewards. If the orchestrator remains inactive for too long, you may manually call [claimEarnings](https://github.com/livepeer/protocol/blob/d03671e2e159bbc856feace83371876cf25124e3/contracts/bonding/BondingManager.sol#L455) on L2 to override this.”

Desktop OS

No response

Desktop Browser

No response

Desktop Wallet

No response

Desktop App/Extension Version

No response

Smartphone Device

No response

Smartphone OS

No response

Smartphone Browser

No response

Smartphone Wallet

No response

Smartphone App/Extension Version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIncremental improvement to existing functionality.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions