• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gnosis / dex-services / 5602 / 3
31%
master: 31%

Build:
DEFAULT BRANCH: master
Ran 02 Dec 2020 11:15AM UTC
Files 112
Run time 24s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Dec 2020 10:51AM UTC coverage: 28.423% (+0.06%) from 28.362%
OPEN_SOLVER_VERSION=v0.1.2 PRIVATE_SOLVER_VERSION=v0.8.7

push

travis-pro

web-flow
Panic when reducing zero flow (#1568)

One half of #1566 

This PR adds an additional check when reducing a path's flow to make sure its not empty. This can happen in cases where the computed exchange and capacity along a path would become zero because of rounding errors as the smallest possible float is around `2e-308` while the exchange rate for an order can be `8e-73`, so it doesn't take many orders to reach this limit.

For more details, see the issue linked above and the added unit test.

### Test Plan

Added unit test demonstrating problem. Note that this test **still** passes in release mode which used to not be the case and cause infinite loops.
```
$ cargo test -p pricegraph --release -- panics_on_empty_flow
    Finished release [optimized] target(s) in 0.07s
     Running target/release/deps/pricegraph-4287836eda7f370d

running 1 test
test orderbook::tests::panics_on_empty_flow ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 53 filtered out
```

Additionally, running the price estimator in release mode we can see the error when requesting `curl -s "http://localhost:8080/api/v1/markets/157-4?batchId=5355804"` which used to cause an **infinite loop** previously:
```
$ cargo run --release -p price-estimator -- --orderbook-file target/stablex_orderbook_mainnet.bin
# ...
2020-12-01T18:25:20.243Z ERRO [services_core::logging] thread 'tokio-runtime-worker' panicked at 'stuck reducing path with empty flow: 181->4->157->158->159->160->161->162->163->164->165->166->167->168->169->170->171->172->173->174->175->176->177->178->179->180->181', pricegraph/src/orderbook.rs:368:13
```

13892 of 56301 branches covered (24.67%)

Branch coverage included in aggregate %.

3808 of 5972 relevant lines covered (63.76%)

39641.3 hits per line

Source Files on job 5602.3 (OPEN_SOLVER_VERSION=v0.1.2 PRIVATE_SOLVER_VERSION=v0.8.7)
  • Tree
  • List 0
  • Changed 34
  • Source Changed 2
  • Coverage Changed 34
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 1997
  • Travis Job 5602.3
  • 46c07de6 on github
  • Prev Job for OPEN_SOLVER_VERSION=v0.1.2 PRIVATE_SOLVER_VERSION=v0.8.7 on master (#5600.3)
  • Next Job for OPEN_SOLVER_VERSION=v0.2.0 PRIVATE_SOLVER_VERSION=v0.8.7 on master (#5604.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc