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(dutch): credit VCB when ending an auction #4388

Closed
erwanor opened this issue May 15, 2024 · 0 comments
Closed

auction(dutch): credit VCB when ending an auction #4388

erwanor opened this issue May 15, 2024 · 0 comments
Assignees
Labels
A-auction Area: Relates to the auction component C-bug Category: a bug consensus-breaking breaking change to execution of on-chain data _P-high High priority _P-V1 Priority: slated for V1 release state-breaking breaking change to on-chain data
Milestone

Comments

@erwanor
Copy link
Member

erwanor commented May 15, 2024

Issue
Auctions can be ended by the protocol and users. The component VCB is only credited when a closure is issued by the protocol. Instead, it should credit the component balance in both cases.

Context
The auction component maintains a value circuit breaker (VCB) accounting for a nonnegative Balance of assets deployed in the component.

This mechanism serves two purposes: fault detection and isolation. The VCB detect value balance irregularities by systematically crediting/debiting the component as assets flows in and out of it. If its invariant is breached (negative balance) the component halts. Halting on a serious invariant breach insulates the rest of the system from excess value leaking into it. x-ref #4363

Remediation

To remediate this, we need a combination of:

  • a hotfix that patch the incorrect logic
  • a fix that enshrine the failure conditions into unit tests
  • a migration that heals the chain state

Hotfix
The fix for this bug is simple: we need to credit the component with the value it pulls from the DEX engine.

Fix
We have a unit test that reproduces the exact failure conditions for this bug (omitted here) and memorialize context around it, similar to 53 halts.

Migration
The migration for this bug is difficult: we need to reconstruct an accurate tally of the component's balance.

@erwanor erwanor added the A-auction Area: Relates to the auction component label May 15, 2024
@erwanor erwanor added this to the Sprint 6 milestone May 15, 2024
@erwanor erwanor added this to Penumbra May 15, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Penumbra May 15, 2024
@erwanor erwanor moved this from Backlog to In progress in Penumbra May 15, 2024
@github-actions github-actions bot added the needs-refinement unclear, incomplete, or stub issue that needs work label May 15, 2024
@erwanor erwanor added C-bug Category: a bug _P-V1 Priority: slated for V1 release _P-high High priority consensus-breaking breaking change to execution of on-chain data state-breaking breaking change to on-chain data labels May 15, 2024
@aubrika aubrika removed the needs-refinement unclear, incomplete, or stub issue that needs work label May 15, 2024
@aubrika aubrika modified the milestones: Sprint 6, Sprint 7 May 20, 2024
erwanor added a commit that referenced this issue May 21, 2024
## Describe your changes

- [x] hotfix for #4388
- [x] reproduction for #4388 
- [x] migration for #4388 

## 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:

  > This is consensus-breaking and state-breaking. Migration WIP.
@erwanor erwanor closed this as completed May 21, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Penumbra May 21, 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 C-bug Category: a bug consensus-breaking breaking change to execution of on-chain data _P-high High priority _P-V1 Priority: slated for V1 release state-breaking breaking change to on-chain data
Projects
Archived in project
Development

No branches or pull requests

3 participants