-
Notifications
You must be signed in to change notification settings - Fork 305
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
dex: move value circuit breaker accounting to dex engine boundaries #4025
Labels
A-dex
Area: Relates to the dex
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
Just a note: this is state breaking because we want to split tracking of asset balances into individualized state keys that map asset id to an Amount. Another reason to do this soon is that we want to fix the delta_2 bug asap, and point Zellic to the actual value breaker approach that we will use. |
erwanor
added
consensus-breaking
breaking change to execution of on-chain data
A-dex
Area: Relates to the dex
state-breaking
breaking change to on-chain data
labels
Mar 15, 2024
2 tasks
hdevalence
added a commit
that referenced
this issue
Mar 22, 2024
Closes #4025 This commit sketches a new mechanism but does not fix the existing tests; it needs to be picked up and pushed over the finish line. (We should be testing this).
zbuc
pushed a commit
that referenced
this issue
Mar 22, 2024
Closes #4025 This commit sketches a new mechanism but does not fix the existing tests; it needs to be picked up and pushed over the finish line. (We should be testing this).
hdevalence
added a commit
that referenced
this issue
Mar 25, 2024
Closes #4025 This commit sketches a new mechanism but does not fix the existing tests; it needs to be picked up and pushed over the finish line. (We should be testing this).
hdevalence
added a commit
that referenced
this issue
Mar 25, 2024
Closes #4025 This commit sketches a new mechanism but does not fix the existing tests; it needs to be picked up and pushed over the finish line. (We should be testing this).
hdevalence
added a commit
that referenced
this issue
Mar 25, 2024
Closes #4025 This commit sketches a new mechanism but does not fix the existing tests; it needs to be picked up and pushed over the finish line. (We should be testing this). --------- Co-authored-by: Chris Czub <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-dex
Area: Relates to the dex
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
Currently the DEX value circuit breaker is implemented within
put_position
, however this has two drawbacks:put_position
? I audited the codebase for any patterns like this during the initial implementation and couldn't find any, however it could appear in the future. However that seems like a "dark pattern" in general asput_position
has various other state machine checks and handles updating indices and liquidityInstead, there are only two places that value flows into the dex and two places value flows out:
IN:
OUT:
If we move the value circuit breaker management to the entry points for those operations, we are guaranteed to check that dex inflows > outflows and get the same assurance with fewer CPU cycles.
The text was updated successfully, but these errors were encountered: