statechannels / dispute-game

A prototype of the dispute game in typescript and solidity.
MIT License
9 stars 0 forks source link

Fix Highest Step calculation #5

Closed lalexgap closed 3 years ago

lalexgap commented 3 years ago

I think we need to use stepForIndex when setting the newHighestStep.

An example with our current logic:

const correctStates = [0...89];
const incorrectStates = [0...,8.1,...89.1]
    proposer Init States 0,22.1,44.1,66.1,89.1
    challenger States updating to 0,5,11,16,22 interval: 5.5 highestStep: 22
    proposer States updating to 5,6,8.1,9.1,11.1 interval: 1.25 highestStep: 10
    challenger States updating to 6,7 interval: 0.25 highestStep: 7

We see tha the proposer provides they're 11th state, 11.1 but highestStep gets set to 10