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

handler could fail to do one of steps to satisfy an offer #1483

Open
dtribble opened this issue Aug 15, 2020 · 3 comments
Open

handler could fail to do one of steps to satisfy an offer #1483

dtribble opened this issue Aug 15, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request z~audit-zestival Vulnerability assessment of ERTP + Zoe Zoe package: Zoe

Comments

@dtribble
Copy link
Member

Describe the issue
In the current API, for a given offer to be satisfied, the contract must:

  • stage an allocation change for the offer's seat
  • do the reallocate
  • exit the seat

Having forgotten to add the appropriate exit operation for an offer, these each seem like steps that the contract could miss without warning. For example, the offer might be staged, but the reallocate is in a conditional, and then the offer gets exited. Or staging and reallocation happens, but the offer never gets exited.

Possible solutions

  • have a separate operation for decline which is exiting an offer unchanged. At the very least to issue a warning.
  • statically analyze whether each offer has a path to completion
  • require that stages be consumed in a handler, so that if a seat gets staged but not reallocated (or cancelled) it's a bug.
  • require that' seats that will stay open beyond their initial handler have that declared. (e.g., without seat.keepOpen(), an error or warning is issued).
@dtribble dtribble added bug Something isn't working Zoe package: Zoe enhancement New feature or request and removed bug Something isn't working labels Aug 15, 2020
@katelynsills
Copy link
Contributor

We think that we might want to see more usages before working on this.

@katelynsills
Copy link
Contributor

We haven't been able to prevent all of the missing steps in (stage, reallocate, exit), but we have been able to enforce:

  1. Exiting a seat will error if a staged allocation exists for the seat (meaning no reallocation occurred)
  2. Reallocations will error if not all seats with staged allocations are included.

@erights erights added the z~audit-zestival Vulnerability assessment of ERTP + Zoe label Jan 10, 2022
@erights erights self-assigned this Jan 20, 2022
@erights
Copy link
Member

erights commented Jan 20, 2022

Since we're killing staging (See #3850 and #4327 ), I like the last bullet above best:

  • require that seats that will stay open beyond their initial handler have that declared. (e.g., without seat.keepOpen(), an error or warning is issued).

Assigning myself. But I have no immediate plans to do anything about this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request z~audit-zestival Vulnerability assessment of ERTP + Zoe Zoe package: Zoe
Projects
None yet
Development

No branches or pull requests

4 participants