Skip to content

Bisection search causes inconsistency in DCV values #363

@trizin

Description

@trizin

Background / Motivation

We're using bisection search to find start and end block numbers for the DF week in the networks other than ETH mainnet. As these numbers are not 100% consistent between different runs we might get different results.

There are two possible paths:

  • (a) Specify a tolerance level, that's say 1/00 of a cent worth of OCEAN. Eg 0.0001 OCEAN
  • (b) Specify a tolerance level that's within Solidity's or Python's numerical precision

Roughly, I'm ok with either. And, (b) is less risky so I recommend it, unless it's too slow.

We should be able to readily get these numbers consistent within a target tolerance level

TODOs

My suggestion to proceed: (highest level: go for b first, and if needed go for a)

  1. Write unit tests that expose the inconsistency
  2. Update the unit tests to allow a target tolerance
  3. Update bisection code to hit target tolerance
  4. If needed, update other code to allow the target tolerance too

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions