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

auction: define action handlers and validation rules #4211

Closed
3 tasks done
Tracked by #4196
erwanor opened this issue Apr 15, 2024 · 3 comments
Closed
3 tasks done
Tracked by #4196

auction: define action handlers and validation rules #4211

erwanor opened this issue Apr 15, 2024 · 3 comments
Assignees
Labels
A-auction Area: Relates to the auction component _P-high High priority _P-V1 Priority: slated for V1 release
Milestone

Comments

@erwanor
Copy link
Member

erwanor commented Apr 15, 2024

Once we have #4206, we can start filling in their validation/execution handlers:

  • ActionDutchAuctionSchedule
  • ActionDutchAuctionEnd
  • ActionDutchAuctionWithdraw
@github-project-automation github-project-automation bot moved this to Backlog in Penumbra Apr 15, 2024
@github-actions github-actions bot added the needs-refinement unclear, incomplete, or stub issue that needs work label Apr 15, 2024
@erwanor erwanor added _P-V1 Priority: slated for V1 release _P-high High priority A-auction Area: Relates to the auction component and removed needs-refinement unclear, incomplete, or stub issue that needs work labels Apr 15, 2024
@erwanor erwanor moved this from Backlog to Todo in Penumbra Apr 15, 2024
@erwanor erwanor added this to the Sprint 4 milestone Apr 15, 2024
@erwanor
Copy link
Member Author

erwanor commented Apr 16, 2024

For the validation rules, we should try to use anyhow::ensure!(INVARIANT, MSG_INVARIANT_CONTEXT) as much as possible, so that we can formulate validation rules positively (like they would be in a natural language spec) e.g.

// Spec: The sequence number must be zero.
ensure!(seq == 0, "opened auction nft MUST have sequence set to zero (got {bad_seq})");

@erwanor erwanor self-assigned this Apr 16, 2024
erwanor added a commit that referenced this issue Apr 17, 2024
## Describe your changes

This PR adds validation logic for:
- `ActionDutchAuctionSchedule`
- `ActionDutchAuctionEnd`
- `ActionDutchAuctionWithdraw`

and a component implementation, on a model similar-but-simpler to the
DEX:

- a `DutchAuctionManager` extension trait defines a crate-level API to
effect a validated action
- an `Inner` internal implementation manages writing to the state
- internal data can be accessed via a general `AuctionStoreRead` trait
which manage tentatively deserializing raw auction state (wkt `Any`)
into a useful domain type.

## Issue ticket number and link

#4211 

## Checklist before requesting a review

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

> Those actions are not integrated in our transaction system, our
application impl.
@TalDerei
Copy link
Collaborator

can this issue be closed?

@erwanor
Copy link
Member Author

erwanor commented Apr 18, 2024

Not yet, we have to finish the component impl and then #4228

@erwanor erwanor moved this from Todo to In progress in Penumbra Apr 18, 2024
@erwanor erwanor closed this as completed Apr 19, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Penumbra Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-auction Area: Relates to the auction component _P-high High priority _P-V1 Priority: slated for V1 release
Projects
Archived in project
Development

No branches or pull requests

2 participants