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

Add tipset -> Message lookup cache #10519

Closed
fridrik01 opened this issue Mar 20, 2023 · 2 comments
Closed

Add tipset -> Message lookup cache #10519

fridrik01 opened this issue Mar 20, 2023 · 2 comments
Assignees
Labels
kind/enhancement Kind: Enhancement

Comments

@fridrik01
Copy link
Contributor

Right now, resolving the messages in a tipset requires quite a few state loads. We can add a cache in the ChainStore’s BlockMsgsForTipset

method. This is probably the biggest “win” as the cache should be trivial and should speed up quite a few lotus APIs.

This will optimize:

  • The Eth API block accesses.
  • Fee history.
  • Tipset message counts
  • StateListMessages
  • (and likely more)
@fridrik01 fridrik01 added the kind/enhancement Kind: Enhancement label Mar 20, 2023
@fridrik01 fridrik01 self-assigned this Mar 20, 2023
@fridrik01 fridrik01 changed the title Cache tipset -> Message lookup Add tipset -> Message lookup cache Mar 20, 2023
@jennijuju jennijuju added this to the v1.23.0 milestone Mar 20, 2023
fridrik01 added a commit that referenced this issue Mar 21, 2023
This commit adds a cache for looking up block messages in a
tipset. This should improve performance for quite a few lotus
APIs, including:

- The Eth API block accesses.
- Fee history.
- Tipset message counts
- StateListMessages
- (and likely more)

Fixes: #10519
@arajasek
Copy link
Contributor

Is this really worth doing? Just based on some quick metrics, this method is currently taking 25ms on average (on my desktop). With this optimization, it falls to 3-5 ms.

@fridrik01
Copy link
Contributor Author

Closing issue until we know if this is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Kind: Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants