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

dex: burn rounding error rather than halting the chain #2484

Merged
merged 1 commit into from
May 5, 2023

Conversation

hdevalence
Copy link
Member

After running these commands, similar to our test code:

cargo run --release --bin pcli -- -n http://localhost:8080 tx position order sell 25gn@1gm
cargo run --release --bin pcli -- -n http://localhost:8080 tx position order buy 1pusd@20gm
cargo run --release --bin pcli -- -n http://localhost:8080 tx position order buy 1pusd@20gm
cargo run --release --bin pcli -- -n http://localhost:8080 tx position order buy 5penumbra@1gm
cargo run --release --bin pcli -- -n http://localhost:8080 tx position order sell 1pusd@5penumbra
cargo run --release --bin pcli -- -n http://localhost:8080 tx swap 10penumbra --into gn

I saw this chain halt: https://gist.github.com/hdevalence/2ee2c17d6092dca701b45821b2cc9b0f

This commit changes the code to instead burn any rounding error and warn loudly about it. (We should also figure out what the cause is and fix that).

After running these commands, similar to our test code:
```
cargo run --release --bin pcli -- -n http://localhost:8080 tx position order sell 25gn@1gm
cargo run --release --bin pcli -- -n http://localhost:8080 tx position order buy 1pusd@20gm
cargo run --release --bin pcli -- -n http://localhost:8080 tx position order buy 1pusd@20gm
cargo run --release --bin pcli -- -n http://localhost:8080 tx position order buy 5penumbra@1gm
cargo run --release --bin pcli -- -n http://localhost:8080 tx position order sell 1pusd@5penumbra
cargo run --release --bin pcli -- -n http://localhost:8080 tx swap 10penumbra --into gn
```
I saw this chain halt: https://gist.github.com/hdevalence/2ee2c17d6092dca701b45821b2cc9b0f

This commit changes the code to instead burn any rounding error and warn loudly about it.
(We should also figure out what the cause is and fix that).
@hdevalence hdevalence requested a review from erwanor May 5, 2023 08:27
@hdevalence hdevalence temporarily deployed to smoke-test May 5, 2023 08:27 — with GitHub Actions Inactive
@hdevalence hdevalence merged commit 6aab792 into main May 5, 2023
@hdevalence hdevalence deleted the burn-rounding-error branch May 5, 2023 08:36
@cratelyn cratelyn added the A-dex Area: Relates to the dex label Mar 5, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants