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

ETH API: Remove message search from EthFeeHistory #10288

Closed
5 of 15 tasks
Stebalien opened this issue Feb 16, 2023 · 0 comments
Closed
5 of 15 tasks

ETH API: Remove message search from EthFeeHistory #10288

Stebalien opened this issue Feb 16, 2023 · 0 comments
Labels
kind/enhancement Kind: Enhancement P2 P2: Should be resolved

Comments

@Stebalien
Copy link
Member

Stebalien commented Feb 16, 2023

Checklist

  • This is not a new feature or an enhancement to the Filecoin protocol. If it is, please open an FIP issue.
  • This is not a new feature request. If it is, please file a feature request instead.
  • This is not brainstorming ideas. If you have an idea you'd like to discuss, please open a new discussion on the lotus forum and select the category as Ideas.
  • I have a specific, actionable, and well motivated improvement to propose.

Lotus component

  • lotus daemon - chain sync
  • lotus miner - mining and block production
  • lotus miner/worker - sealing
  • lotus miner - proving(WindowPoSt)
  • lotus miner/market - storage deal
  • lotus miner/market - retrieval deal
  • lotus miner/market - data transfer
  • lotus client
  • lotus JSON-RPC API
  • lotus message management (mpool)
  • Other

Improvement Suggestion

EthFeeHistory currently:

  1. Loads all messages in a tipset.
  2. Searches for the message receipts using StateSearchMsg.
  3. Computes the "gas reward" from the message + receipt.

It also looks like it starts search at the current head.

This has a runtime of (height_scanned*messages_per_tipset)^2.

Given that we're walking backwards, we can instead:

  1. Load the "parent receipts" from the current tipset.
  2. Walk back one tipset.
  3. Load the messages.
  4. Use the receipts from step 1 and messages from step 3.
  5. Repeat.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Kind: Enhancement P2 P2: Should be resolved
Projects
None yet
Development

No branches or pull requests

1 participant