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: daemon: import: only setup stmgr if validating chain #11084

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

arajasek
Copy link
Contributor

Related Issues

@snissn reported that when running lotus daemon --halt-after-import --import-snapshot /mnt/latest.zst, he was getting the following error:

2023-07-17T20:27:58.025Z        INFO    drand   drand/drand.go:114      drand beacon without pubsub
2023-07-17T20:27:58.025Z        WARN    chainstore      store/store.go:634      reorgWorker quit
2023-07-17T20:27:58.356Z        INFO    badgerbs        v2@v2.2007.4/db.go:1027 Storing value log head: {Fid:98 Len:33 Offset:255692644}

2023-07-17T20:27:58.649Z        INFO    badgerbs        v2@v2.2007.4/levels.go:1000     [Compactor: 173] Running compaction: {level:0 score:1.73 dropPrefixes:[]} for level: 0

2023-07-17T20:28:00.533Z        INFO    badgerbs        v2@v2.2007.4/levels.go:962      LOG Compact 0->1, del 8 tables, add 6 tables, took 1.883811354s

2023-07-17T20:28:00.533Z        INFO    badgerbs        v2@v2.2007.4/levels.go:1010     [Compactor: 173] Compaction for level: 0 DONE
2023-07-17T20:28:00.533Z        INFO    badgerbs        v2@v2.2007.4/db.go:550  Force compaction on level 0 done
ERROR: failed to construct beacon schedule: creating drand beacon: creating drand client: no points of contact specified

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:

  • 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 July 18, 2023 14:08
@snissn
Copy link
Contributor

snissn commented Jul 18, 2023

looks good! able to import the chain and exit with a successful exit code

Copy link
Contributor

@snissn snissn left a comment

Choose a reason for hiding this comment

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

looks good! able to import the chain and exit with a successful exit code

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.

2 participants