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

feat: chainstore: optimize BlockMsgsForTipset #10552

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

arajasek
Copy link
Contributor

@arajasek arajasek commented Mar 23, 2023

Related Issues

@raulk observed some slowness due to the repeated resolution of senders in this method.

It's necessary to resolve senders if AND ONLY IF we have a message sent by an ID address. If we don't (which we almost never do), we can just use robust addresses.

Proposed Changes

Use robust addresses, instead of ID addresses, to check nonces when selecting BlockMsgsForTipset, BUT check if we have any messages sent from ID addresses.

If we do find any messages sent from ID addresses, switch to using ID addresses for the resolution.

Speeds up BlockMsgsForTipset from ~25ms on average to ~5 ms on average (on my desktop).

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@arajasek arajasek requested a review from a team as a code owner March 23, 2023 16:01
@arajasek arajasek requested a review from Stebalien March 28, 2023 13:34
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that accounts will only ever have an f0 plus an f1/f3/f4 address, never more. That's currently true and likely to continue to be true? Maybe? With account abstraction, that may go away.

But I guess this should be OK for now.

@jennijuju jennijuju merged commit 5223888 into master Apr 4, 2023
@jennijuju jennijuju deleted the asr/optimize-blockmsgsfortipset branch April 4, 2023 17:53
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.

3 participants