feat: daemon: import: only setup stmgr if validating chain #11084
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issues
@snissn reported that when running
lotus daemon --halt-after-import --import-snapshot /mnt/latest.zst
, he was getting the following error:The immediate cause is that #11080 caused us to start using the "real" drand config when importing chains. While correct, this is exposing a longer-running issue related to trying to create drand clients without any specified servers. We walked up to this issue before, but hacked around it without actual understanding.
Proposed Changes
We need an actual fix to this issue, for which I'll open a separate PR and issue. For now, we can make a quick improvement that also unblocks @snissn, which is to only bother creating the stmgr (and so setting up the beacon schedule) if we're actually validating the imported chain. We don't need to be doing this if we're just importing a snapshot and trusting it.
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps