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

fix: miner: Don't require db config when it's not used #11420

Merged
merged 4 commits into from
Nov 24, 2023

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Nov 15, 2023

Related Issues

This fixes the issue where default config lotus-miner requires database configuration even though nothing is using it

Proposed Changes

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
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@magik6k magik6k requested a review from a team as a code owner November 15, 2023 14:05
@snadrus
Copy link
Collaborator

snadrus commented Nov 15, 2023

Please benefit from the fix-sturdy-tests branch to see if anything has broken.

@rjan90
Copy link
Contributor

rjan90 commented Nov 20, 2023

When running with all settings default, the lotus-miner run fails with:

2023-11-15T16:00:24.533+0100	WARN	events	events/observer.go:61	listenHeadChanges quit
ERROR: creating node: starting node: could not build arguments for function "reflect".makeFuncStub (/opt/homebrew/Cellar/go@1.20/1.20.8/libexec/src/reflect/asm_arm64.s:29): failed to build *harmonydb.DB: received non-nil error from function "reflect".makeFuncStub (/opt/homebrew/Cellar/go@1.20/1.20.8/libexec/src/reflect/asm_arm64.s:29): unable to connect to db: host=127.0.0.1 user=yugabyte password=yugabyte dbname=yugabyte port=5433 , err: failed to connect to `host=127.0.0.1 user=yugabyte database=yugabyte`: dial error (dial tcp 127.0.0.1:5433: connect: connection refused)

I played a little bit around with setting the different config.HarmonyDB in builder_miner.go:

lotus/node/builder_miner.go

Lines 107 to 109 in 57f5760

Override(new(*harmonydb.DB), func(cfg config.HarmonyDB, id harmonydb.ITestID) (*harmonydb.DB, error) {
return harmonydb.NewFromConfigWithITestID(cfg)(id)
}),

lotus/node/builder_miner.go

Lines 242 to 243 in 57f5760

Override(new(config.HarmonyDB), cfg.HarmonyDB),
Override(new(harmonydb.ITestID), harmonydb.ITestID("")),

to only be set if EnableSectorIndexDB is true, but I still encounter errors like this when trying to lotus-miner run

2023-11-20T10:37:50.683+0100    INFO    paramfetch      go-paramfetch@v0.0.4/paramfetch.go:233  parameter and key-fetching complete
ERROR: creating node: starting node: missing dependencies for function "reflect".makeFuncStub (/opt/homebrew/Cellar/go@1.20/1.20.8/libexec/src/reflect/asm_arm64.s:29): missing type: *harmonydb.DB

@snadrus
Copy link
Collaborator

snadrus commented Nov 23, 2023

It appears that
ci/circleci: test-itest-harmonydb
ci/circleci: test-itest-harmonytask
is broken here because it relied on the DB being default enabled.

Can you add to their constructor helpers the config it needs for the database to be reachable?

@snadrus snadrus merged commit 6328a35 into feat/sturdypost Nov 24, 2023
85 of 89 checks passed
@snadrus snadrus deleted the fix/no-miner-db-req branch November 24, 2023 01:55
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