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

add 'onCondition' exit rule support into Zoe #3657

Open
zarutian opened this issue Aug 11, 2021 · 3 comments
Open

add 'onCondition' exit rule support into Zoe #3657

zarutian opened this issue Aug 11, 2021 · 3 comments
Labels
Zoe package: Zoe

Comments

@zarutian
Copy link
Contributor

zarutian commented Aug 11, 2021

What is the Problem Being Solved?

currently Zoe seats have only three kinds of exit rules:

  • 'onDemand' - holder of UserSeat can .tryExit() at any time and succeed
  • 'waived' - holder of UserSeat can not exit the seat, only the smartcontract can
  • 'onExpiry' - the seat gets exited at (or azap after) the specified timer had reached the specified timestamp

Description of the Design

I propose the exit rule 'onCondition' that looks similiar to 'onExpiry'.
The parameters of the rule would have a ConditionChecker and a Condition (perhaps expressed in slightly extended jsonlogic but zoe treats it as if it were opaque)
When UserSeat holder does .tryExit(), zoe does

E(ConditionChecker).isTrue(Condition)

to see if the seat can be exited by the UserSeat holder or not.

Security Considerations

Same kind as with ERTP Issuers and TimerServices, the ConditionChecker being maliciously slow or non-responsive.

Test Plan

TBD

@zarutian zarutian added the enhancement New feature or request label Aug 11, 2021
@katelynsills
Copy link
Contributor

@zarutian, can you give a few user stories about how this would be used?

@zarutian
Copy link
Contributor Author

One userstory that comes to mind is that the user and the contract deployer do not want to fully relie on only one TimerService so the ConditionChecker (which they can relie on) gets a condition expr that amounts to 'either A OR B' have expired.

Another is where the user might want a recourse in the case of long expiry to exit sooner iff three fourths of klehios like arbitrators agree.

Yet another is where the seat can be exited only iff another spefic smart contract has signalled something. It might be a governence vote concluded or such.

Is this sufficient amount of coarsely painted user stories or do you want more?

@katelynsills
Copy link
Contributor

Thanks @zarutian! This sounds like a very helpful idea. I'll add this to our backlog of features to consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Zoe package: Zoe
Projects
None yet
Development

No branches or pull requests

4 participants