fix: Return nil if negative time elapsed from last block happens#1018
fix: Return nil if negative time elapsed from last block happens#1018RafilxTenfen merged 6 commits intomainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1018 +/- ##
==========================================
- Coverage 43.96% 43.87% -0.09%
==========================================
Files 64 64
Lines 8332 8335 +3
==========================================
- Hits 3663 3657 -6
- Misses 4414 4422 +8
- Partials 255 256 +1
|
| "prev", prevInterestTime, | ||
| ) | ||
|
|
||
| return nil |
There was a problem hiding this comment.
Log is not enough. I think we should either return some message or keep the error.
There was a problem hiding this comment.
What do you think about these options? @robert-zaremba
There was a problem hiding this comment.
IMHO, we should fix the genesis logic rather than handling it here. Let's continue at: #543 (comment)
robert-zaremba
left a comment
There was a problem hiding this comment.
Don't want to block this PR, but I don't think this is the right way for handling the issue.
Side note: issuing Error log without returning error smells bad.
| "prev", prevInterestTime, | ||
| ) | ||
|
|
||
| return nil |
There was a problem hiding this comment.
IMHO, we should fix the genesis logic rather than handling it here. Let's continue at: #543 (comment)
|
@robert-zaremba So, do you think we should change from |
There is no Warn in Only [ |
|
Message can keep |
| "prev", prevInterestTime, | ||
| ) | ||
|
|
||
| return nil |
Description
Implemented Option 3: Modify AccrueAllInterest to treat "negative time elapsed" as "zero time elapsed", aborting the function without modifying the state until an EndBlock where BlockTime > LastInterestTime.
closes: #543
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!in the type prefix if API or client breaking change