-
Notifications
You must be signed in to change notification settings - Fork 10
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
Resolve block not found issue - Sapphire #793
Conversation
df_py/util/blocktime.py
Outdated
if abs(block_timestamp - timestamp) > 60 * 15: | ||
# pylint: disable=line-too-long | ||
print( | ||
"WARNING: timestamp_to_block() is returning a block that is more than 15 minutes away from the target timestamp" | ||
) | ||
print("target timestamp =", timestamp) | ||
print("block timestamp =", block_timestamp) | ||
print("block number =", block_i) | ||
print("delta =", abs(block_timestamp - timestamp)) | ||
raise Exception( | ||
"timestamp_to_block() is returning a block that is too far away" | ||
) | ||
print( | ||
"Returning block number", | ||
block_i, | ||
"for timestamp", | ||
timestamp, | ||
"diff", | ||
abs(block_timestamp - timestamp), | ||
) |
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.
Does a unit test capture this corner case?
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.
Not yet, I'll add it, thanks!
Code Climate has analyzed commit 247f2c4 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 90.9% (90% is the threshold). This pull request will bring the total coverage in the repository to 92.8% (0.0% change). View more on Code Climate. |
Ignore the failing "Dispense Predictoor ROSE Rewards" flow, there's an issue with subgraph |
On January 18th, the active flow failed due to block not found issue originated from Oasis RPC. This PR:
block_timestamp = 0
thus returning a negative value fromtimeSinceTimestamp
so that f(x) != 0