Closed kana-sama closed 3 hours ago
Can you check if your forked code contains the latest fixes for score calculation? I just glanced over the example and it seems to me that this ceil_div should make sure that
376 * 45566789239999872 / 514566789239999872 = 33.29618839090851 =round because on 0 decimals=> 34
which is what you expect.
Thanks!
Problem
In some cases score is not 0 for:
Example: https://etherscan.io/tx/0x2d5a6f593cdc44a9ca46e9c8cc62a89ce55497b68f7102dabaa264cfc647f3a2 tx with real score = 0 but driver reported score: 1305051573483203
original order: "sellAmount": "514566789239999872", "buyAmount": "376", "partiallyFillable": true, "kind": "sell", So the output amount should be 376 * 45566789239999872 / 514566789239999872 = 33.29618839090851 =round because on 0 decimals=> 34
But, real calculations in driver:
Impact
Indicate how significant you believe the impact of the bug is. Bugs that lead to data loss or corruption would be considered
critical
. In such cases, please also add thecritical
label.To reproduce
Trade partially fillable order with target token with decimal = 0
Expected behaviour
Expected to return score=0 Actual: score isn't zero so transaction submitted onchain and solver blacklisted
services version/commit hash and environment
Environment: production
Additional context
This issue appears in forked driver code, so it seems issue should be also in original cow-services master