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

gnosis / dex-services / 5390
31%

Build:
DEFAULT BRANCH: master
Ran 02 Nov 2020 02:29PM UTC
Jobs 1
Files 107
Run time 19s
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 Nov 2020 02:19PM UTC coverage: 28.698% (-0.001%) from 28.699%
5390

push

travis-pro

web-flow
Version orderbook file (#1292)

This PR adds a new `version` field to the `EventRegistry` to ensure that the orderbook file is compatible between new driver and price-estimator versions. This is because the `bincode` serialization seems to only care about binary size and may conflate unrelated types as well as different fields as long as they:
- are the same size
- are in the same position

This new `Version` struct is a 0-sized serialization helper that ensure that the file matches the correct version when deserializing. This gives us some manual control when updating the orderbook file structure so we can ensure it doesn't incorrectly read an orderbook file in the old format.

### Test Plan

First check that a significant change to the orderbook type goes undetected:
```
$ cargo checkout master
$ cargo run -p price-estimator -- --orderbook-file target/orderbook.mainnet.bin --log-filter "error,core::orderbook=info"
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/price-estimator --orderbook-file target/orderbook.mainnet.bin --log-filter 'error,core::orderbook=info'`
2020-08-11T06:52:26.097Z INFO [core::orderbook::streamed::updating_orderbook] Updating event based orderbook with from block 0 to block 10637118.
2020-08-11T07:10:45.764Z INFO [core::orderbook::streamed::updating_orderbook] Received 215399 events.
2020-08-11T07:23:39.519Z INFO [core::orderbook::streamed::updating_orderbook] Finished applying events
^C
```

<details>
<summary>apply this patch:</summary>
<p>

```diff
diff --git a/core/src/history/events.rs b/core/src/history/events.rs
index 47433ed..661dfd0 100644
--- a/core/src/history/events.rs
+++ b/core/src/history/events.rs
@@ -23,13 +23,20 @@ use typenum::U1;
 // However, the orderbook state (`State`) cannot remove events. To support this, we keep an ordered
 // list of all events based on which the state is built.
 
-#[derive(Debug, Deserialize, Eq, Ord, Partial... (continued)

13751 of 55089 branches covered (24.96%)

Branch coverage included in aggregate %.

3727 of 5814 relevant lines covered (64.1%)

40718.34 hits per line

Jobs
ID Job ID Ran Files Coverage
3 5390.3 (OPEN_SOLVER_VERSION=v0.1.1 PRIVATE_SOLVER_VERSION=v0.8.5) 02 Nov 2020 02:29PM UTC 0
28.7
Travis Job 5390.3
Source Files on build 5390
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5390
  • 84f9a7f5 on github
  • Prev Build on master (#5387)
  • Next Build on master (#5395)
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