Skip to content
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

Use lotus head latency in deal tracker #383

Merged
merged 1 commit into from
Oct 12, 2023
Merged

Conversation

xinaxu
Copy link
Contributor

@xinaxu xinaxu commented Oct 12, 2023

resovles #336

Previously, we are making a 24 hour buffer time to account for potential latency of StateMarketDeals call. However, that leads to some deal state to change between expired and published during 24 hour window as the buffer time for marking a deal expired comes from the last updated time inside StateMarketDeal payload.

This change fixes most of the problem by first calling Lotus ChainHead to determine the current lotus latency first. Edges cases are handled below

  • If the StateMarketDeals response is based on an earlier epoch than ChainHead response, then it's likely some deals are in expired state based on ChainHead latency but is not expired in StateMarketDeals response, the state of the deal will be updated in the next run when StateMarketDeals response is based on a later epoch
  • If the StateMarketDeals response is based on a latter epoch than ChainHead response, then those deals that are in non_expired state based on ChainHead latency will be marked as expired

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (7a3b2c6) 74.29% compared to head (bcdd48f) 71.23%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
- Coverage   74.29%   71.23%   -3.07%     
==========================================
  Files         143      143              
  Lines        9433     9458      +25     
==========================================
- Hits         7008     6737     -271     
- Misses       1710     2033     +323     
+ Partials      715      688      -27     
Files Coverage Δ
util/util.go 80.00% <80.00%> (ø)
service/dealtracker/dealtracker.go 72.92% <46.66%> (-5.77%) ⬇️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xinaxu xinaxu merged commit 6727ea6 into main Oct 12, 2023
@xinaxu xinaxu deleted the xinaxu/use-lotus-head-latency branch October 12, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant