Search the whole checkpoint trace if offset overflows during initial exponential search. (#3662)
This commit is contained in:
@ -83,7 +83,7 @@ function upperLookupRecent(${opts.historyTypeName} storage self, ${opts.keyTypeN
|
||||
offset <<= 1;
|
||||
}
|
||||
|
||||
uint256 low = offset < length ? length - offset : 0;
|
||||
uint256 low = 0 < offset && offset < length ? length - offset : 0;
|
||||
uint256 high = length - (offset >> 1);
|
||||
uint256 pos = _upperBinaryLookup(self.${opts.checkpointFieldName}, key, low, high);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user