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:update the lotus version #1153

Merged
merged 20 commits into from
Apr 6, 2023
Merged

feat:update the lotus version #1153

merged 20 commits into from
Apr 6, 2023

Conversation

Terryhung
Copy link
Collaborator

@Terryhung Terryhung commented Mar 11, 2023

Changes

  1. We need the lotus change to prevent from causing excessive CPU usage.
  2. Update the ffi version due to the lotus changes.

@Terryhung Terryhung requested a review from frrist March 14, 2023 02:37
@Terryhung Terryhung marked this pull request as ready for review March 14, 2023 02:56
commands/daemon.go Outdated Show resolved Hide resolved
commands/daemon.go Outdated Show resolved Hide resolved
lens/lily/impl.go Outdated Show resolved Hide resolved
tasks/survey/minerprotocols/minerprotocols.go Show resolved Hide resolved
@Terryhung Terryhung requested a review from frrist March 19, 2023 17:28
Copy link
Member

@frrist frrist left a comment

Choose a reason for hiding this comment

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

Left some more questions. https://github.com/filecoin-project/lily/pull/1153/files#diff-35818035b39b465ad281977acde860ea419bf987ddca1203c34f6904e3227dd7R25 will need to be addressed before this is ready for merge.

go.mod Show resolved Hide resolved
@@ -22,7 +22,7 @@ var log = logging.Logger("lily/lens")
var ErrExecutionTraceNotFound = fmt.Errorf("failed to find execution trace")

func StateManager(lmctx helpers.MetricsCtx, lc fx.Lifecycle, cs *store.ChainStore, exec stmgr.Executor, sys vm.SyscallBuilder, us stmgr.UpgradeSchedule, bs beacon.Schedule, em stmgr.ExecMonitor) (*stmgr.StateManager, error) {
sm, err := stmgr.NewStateManagerWithUpgradeScheduleAndMonitor(cs, exec, sys, us, bs, em)
sm, err := stmgr.NewStateManagerWithUpgradeScheduleAndMonitor(cs, exec, sys, us, bs, em, nil)
Copy link
Member

Choose a reason for hiding this comment

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

what is the nil value being passed to the stmgr? I assume it's a datastore? The statemanager will likely need a concrete value passed here to operate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it. But I am not familiar with it here. Could you help me to do it here? thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

So this should look something like:

func StateManager(lmctx helpers.MetricsCtx, lc fx.Lifecycle, cs *store.ChainStore, exec stmgr.Executor, sys vm.SyscallBuilder, us stmgr.UpgradeSchedule, bs beacon.Schedule, em stmgr.ExecMonitor, metadataDs dtypes.MetadataDS) (*stmgr.StateManager, error) {
	sm, err := stmgr.NewStateManagerWithUpgradeScheduleAndMonitor(cs, exec, sys, us, bs, em, metadataDs)

Copy link
Member

Choose a reason for hiding this comment

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

This is the package lotus and lily use for dep injection like this: https://github.com/uber-go/fx

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed! Thanks for your help!

.golangci.yml Outdated
@@ -40,6 +40,9 @@ issues:
- path: schemas/.*
linters:
- misspell
- linters:
- staticcheck
text: "SA1019:"
Copy link
Member

Choose a reason for hiding this comment

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

what does this change do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we skip the lint check for old package: commands/daemon.go:6:2: SA1019: package io/ioutil is deprecated: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)

old lint logs.

Copy link
Member

Choose a reason for hiding this comment

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

Instead of silencing the linter errors, replace the deprecated dependency: io/ioutil with either the io or os package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed!

lens/util/store.go Show resolved Hide resolved
@Terryhung Terryhung requested a review from frrist March 21, 2023 15:56
@Terryhung Terryhung merged commit d9e0301 into master Apr 6, 2023
@Terryhung Terryhung deleted the terryhung/upgrade-lotus-dep branch April 6, 2023 08:13
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.

None yet

2 participants