Open zgfzgf opened 3 years ago
is this a difference between v3-core and v3-core-optimism or the code is the same b/t the two?
@zgfzgf do you have a test case reproduction of this bug? in your example, i'm already seeing a potential issue, index would never be 3 for the given self blockTimestamps, index always represents the most recently updated entry, in this case 9
when old cardinality 10. may index 3 because first 0-9 then start 0
when index=3 update cardinality =100
if it is bug. createPool and then increaseObservationCardinalityNext(65535). no problem. or modify contract code. @NoahZinsmeister
for example: old cardinality 10 new cardinality 100
when index=3 self blockTimestamp is 10,11,12,13,4,5,6,7,8,9,1,1,1,....1 call(self, 13, 7, 3, 100) l=4, r=103 first l=53 r=103 ... not find 7
https://github.com/Uniswap/uniswap-v3-core-optimism/blob/d99ea89a1f29e46bede8fab47e8e737190a6b6fa/contracts/libraries/Oracle.sol#L153-L184