-
Notifications
You must be signed in to change notification settings - Fork 227
Fix vault freshness check and repeating reports #1215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/vaults
Are you sure you want to change the base?
Conversation
Hardhat Unit Tests Coverage Summary
Diff against master
Results for commit: b284ef8 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
9627031
to
9e5226d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a small change needed in comments.
// happy path. vault's report ts is the same as the latest AO report ts | ||
if (latestReportTimestamp32 == vaultReportTimestamp) { | ||
// check if AO has not stopped bringing the report | ||
return block.timestamp - latestReportTimestamp < REPORT_FRESHNESS_DELTA; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// happy path. vault's report ts is the same as the latest AO report ts | |
if (latestReportTimestamp32 == vaultReportTimestamp) { | |
// check if AO has not stopped bringing the report | |
return block.timestamp - latestReportTimestamp < REPORT_FRESHNESS_DELTA; | |
} |
🔪
/// @dev Returns the distance between two 32-bit numbers in counterclockwise direction | ||
/// @param a the first number that's suppose to be larger than b | ||
/// @param b the second number that's suppose to be smaller than a | ||
/// @return the distance between a and b in counterclockwise direction modulo 2**32 + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// @return the distance between a and b in counterclockwise direction modulo 2**32 + 1 | |
/// @return the distance between a and b in counterclockwise direction modulo 2**32 |
/// @return the distance between a and b in counterclockwise direction modulo 2**32 + 1 | ||
/// @dev this function is used to check if a is larger than b taking into account the overflow of uint32 | ||
function ccwDistance32(uint32 a, uint32 b) internal pure returns (uint256) { | ||
uint256 modulo = uint256(~uint32(0)) + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint256 modulo = uint256(~uint32(0)) + 1; | |
uint256 modulo = 1 << 32; |
Fix #1190
Fix #1200