Skip to content

Commit

Permalink
Merge branch 'master' into chore/make-help
Browse files Browse the repository at this point in the history
  • Loading branch information
rjan90 authored Jan 10, 2025
2 parents 0d00cfa + f422705 commit 466a285
Show file tree
Hide file tree
Showing 59 changed files with 2,216 additions and 1,433 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
- Add Magik's bootstrap node. ([filecoin-project/lotus#12792](https://github.com/filecoin-project/lotus/pull/12792))
- Lotus now reports the network name as a tag in most metrics. Some untagged metrics will be completed in a follow-up at a later date. ([filecoin-project/lotus#12733](https://github.com/filecoin-project/lotus/pull/12733))
- Refactored Ethereum API implementation into smaller, more manageable modules in a new `github.com/filecoin-project/lotus/node/impl/eth` package. ([filecoin-project/lotus#12796](https://github.com/filecoin-project/lotus/pull/12796))
- Generate the cli docs directly from the code instead compiling and executing binaries' `help` output. ([filecoin-project/lotus#12717](https://github.com/filecoin-project/lotus/pull/12717))
- Add `lotus-shed msg --gas-stats` to show summarised gas stats for a given message. ([filecoin-project/lotus#12817](https://github.com/filecoin-project/lotus/pull/12817))

# UNRELEASED v.1.32.0


See https://github.com/filecoin-project/lotus/blob/release/v1.32.0/CHANGELOG.md

# Node and Miner v1.31.0 / 2024-12-02
Expand Down
2 changes: 1 addition & 1 deletion LOTUS_RELEASE_FLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The specific steps executed for Lotus software releases are captured in the [Rel
## Release Candidates (RCs)

- For regular (i.e., no critical security patch) releases with no accompanying network upgrade, the RC period is typically around 1 week.
- For releases accompanying network upgrades, the release candiadte period is a lot longer to allow for more extensive testing, usually around 5 to 6 weeks.
- For releases accompanying network upgrades, the release candidate period is a lot longer to allow for more extensive testing, usually around 5 to 6 weeks.
- Releases rushing out a critical security patch will likely have an RC period on the order of hours or days, or may even forgo the RC phase. To compensate for the release speed, these releases will include the minimum delta necessary, meaning they'll be a patch on top of an existing release rather than taking the latest changes in the `master` branch.

## Security Fix Policy
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,6 @@ snap: lotus lotus-miner lotus-worker ## Build snap package
# separate from gen because it needs binaries
docsgen-cli: lotus lotus-miner lotus-worker ## Generate CLI documentation
$(GOCC) run ./scripts/docsgen-cli
./lotus config default > documentation/en/default-lotus-config.toml
./lotus-miner config default > documentation/en/default-lotus-miner-config.toml
.PHONY: docsgen-cli

print-%: ## Print variable value
Expand Down
2 changes: 1 addition & 1 deletion api/api_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ type StorageMiner interface {
//
// If allowFetch is set, list of paths to which the sector can be fetched will also be returned.
// - Paths which have sector files locally (don't require fetching) will be listed first.
// - Paths which have sector files locally will not be filtered based on based on AllowTypes/DenyTypes.
// - Paths which have sector files locally will not be filtered based on AllowTypes/DenyTypes.
// - Paths which require fetching will be filtered based on AllowTypes/DenyTypes. If multiple
// file types are specified, each type will be considered individually, and a union of all paths
// which can accommodate each file type will be returned.
Expand Down
2 changes: 1 addition & 1 deletion build/openrpc/miner.json
Original file line number Diff line number Diff line change
Expand Up @@ -6731,7 +6731,7 @@
{
"name": "Filecoin.StorageFindSector",
"description": "```go\nfunc (s *StorageMinerStruct) StorageFindSector(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]storiface.SectorStorageInfo, error) {\n\tif s.Internal.StorageFindSector == nil {\n\t\treturn *new([]storiface.SectorStorageInfo), ErrNotSupported\n\t}\n\treturn s.Internal.StorageFindSector(p0, p1, p2, p3, p4)\n}\n```",
"summary": "StorageFindSector returns list of paths where the specified sector files exist.\n\nIf allowFetch is set, list of paths to which the sector can be fetched will also be returned.\n- Paths which have sector files locally (don't require fetching) will be listed first.\n- Paths which have sector files locally will not be filtered based on based on AllowTypes/DenyTypes.\n- Paths which require fetching will be filtered based on AllowTypes/DenyTypes. If multiple\n file types are specified, each type will be considered individually, and a union of all paths\n which can accommodate each file type will be returned.\n",
"summary": "StorageFindSector returns list of paths where the specified sector files exist.\n\nIf allowFetch is set, list of paths to which the sector can be fetched will also be returned.\n- Paths which have sector files locally (don't require fetching) will be listed first.\n- Paths which have sector files locally will not be filtered based on AllowTypes/DenyTypes.\n- Paths which require fetching will be filtered based on AllowTypes/DenyTypes. If multiple\n file types are specified, each type will be considered individually, and a union of all paths\n which can accommodate each file type will be returned.\n",
"paramStructure": "by-position",
"params": [
{
Expand Down
4 changes: 2 additions & 2 deletions chain/index/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ func (si *SqliteIndexer) backfillIndex(ctx context.Context, tx *sql.Tx, head *ty
log.Infof("reached stop height %d; backfilled %d tipsets", stopAfter, totalApplied)
return nil
}

height := currTs.Height()
currTs, err = si.cs.GetTipSetFromKey(ctx, currTs.Parents())
if err != nil {
return xerrors.Errorf("failed to walk chain at height %d: %w", currTs.Height(), err)
return xerrors.Errorf("failed to walk chain beyond height %d: %w", height, err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion chain/lf3/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type signer struct {
}

// Sign signs a message with the private key corresponding to a public key.
// The the key must be known by the wallet and be of BLS type.
// The key must be known by the wallet and be of BLS type.
func (s *signer) Sign(ctx context.Context, sender gpbft.PubKey, msg []byte) ([]byte, error) {
addr, err := address.NewBLSAddress(sender)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion chain/types/tipset_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func init() {
type TipSetKey struct {
// The internal representation is a concatenation of the bytes of the CIDs, which are
// self-describing, wrapped as a string.
// These gymnastics make the a TipSetKey usable as a map key.
// These gymnastics make a TipSetKey usable as a map key.
// The empty key has value "".
value string
}
Expand Down
2 changes: 1 addition & 1 deletion cli/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func BackupCmd(repoFlag string, rt repo.RepoType, getApi BackupApiFn) *cli.Comma
Description: `The backup command writes a copy of node metadata under the specified path
Online backups:
For security reasons, the daemon must be have LOTUS_BACKUP_BASE_PATH env var set
For security reasons, the daemon must have LOTUS_BACKUP_BASE_PATH env var set
to a path where backup files are supposed to be saved, and the path specified in
this command must be within this base path`,
Flags: []cli.Flag{
Expand Down
8 changes: 4 additions & 4 deletions cli/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ var GetStorageMinerAPI = cliutil.GetStorageMinerAPI
var GetWorkerAPI = cliutil.GetWorkerAPI

var CommonCommands = []*cli.Command{
AuthCmd,
LogCmd,
WaitApiCmd,
FetchParamCmd,
WithCategory("developer", AuthCmd),
WithCategory("developer", LogCmd),
WithCategory("developer", WaitApiCmd),
WithCategory("developer", FetchParamCmd),
PprofCmd,
VersionCmd,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus/backup.go → cli/lotus/backup.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package lotus

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus/config.go → cli/lotus/config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package lotus

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus/daemon.go → cli/lotus/daemon.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build !nodaemon
// +build !nodaemon

package main
package lotus

import (
"bufio"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build nodaemon
// +build nodaemon

package main
package lotus

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus/debug_advance.go → cli/lotus/debug_advance.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:build debug
// +build debug

package main
package lotus

import (
"encoding/binary"
Expand Down
123 changes: 123 additions & 0 deletions cli/lotus/lotus.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
package lotus

import (
"context"
"os"

"github.com/fatih/color"
logging "github.com/ipfs/go-log/v2"
"github.com/mattn/go-isatty"
"github.com/urfave/cli/v2"
"go.opencensus.io/trace"

"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/cli/clicommands"
cliutil "github.com/filecoin-project/lotus/cli/util"
"github.com/filecoin-project/lotus/lib/lotuslog"
"github.com/filecoin-project/lotus/lib/tracing"
"github.com/filecoin-project/lotus/node/repo"
)

var log = logging.Logger("lotus")

var AdvanceBlockCmd *cli.Command

func App() *cli.App {
api.RunningNodeType = api.NodeFull

lotuslog.SetupLogLevels()

local := []*cli.Command{
DaemonCmd,
backupCmd,
configCmd,
}
if AdvanceBlockCmd != nil {
local = append(local, AdvanceBlockCmd)
}

jaeger := tracing.SetupJaegerTracing("lotus")
defer func() {
if jaeger != nil {
_ = jaeger.ForceFlush(context.Background())
}
}()

for _, cmd := range local {
cmd := cmd
originBefore := cmd.Before
cmd.Before = func(cctx *cli.Context) error {
if jaeger != nil {
_ = jaeger.Shutdown(cctx.Context)
}
jaeger = tracing.SetupJaegerTracing("lotus/" + cmd.Name)

if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}

if originBefore != nil {
return originBefore(cctx)
}
return nil
}
}
ctx, span := trace.StartSpan(context.Background(), "/cli")
defer span.End()

interactiveDef := isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())

app := &cli.App{
Name: "lotus",
Usage: "Filecoin decentralized storage network client",
Version: string(build.NodeUserVersion()),
EnableBashCompletion: true,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "panic-reports",
EnvVars: []string{"LOTUS_PANIC_REPORT_PATH"},
Hidden: true,
Value: "~/.lotus", // should follow --repo default
},
&cli.BoolFlag{
// examined in the Before above
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
&cli.StringFlag{
Name: "repo",
EnvVars: []string{"LOTUS_PATH"},
Hidden: true,
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
},
&cli.BoolFlag{
Name: "interactive",
Usage: "setting to false will disable interactive functionality of commands",
Value: interactiveDef,
},
&cli.BoolFlag{
Name: "force-send",
Usage: "if true, will ignore pre-send checks",
},
cliutil.FlagVeryVerbose,
},
After: func(c *cli.Context) error {
if r := recover(); r != nil {
// Generate report in LOTUS_PATH and re-raise panic
build.GenerateNodePanicReport(c.String("panic-reports"), c.String("repo"), c.App.Name)
panic(r)
}
return nil
},

Commands: append(local, clicommands.Commands...),
}

app.Setup()
app.Metadata["traceContext"] = ctx
app.Metadata["repoType"] = repo.FullNode

return app
}
2 changes: 1 addition & 1 deletion cmd/lotus-miner/actor.go → cli/miner/actor.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package miner

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-miner/actor_test.go → cli/miner/actor_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package miner

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package miner

import (
"flag"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-miner/backup.go → cli/miner/backup.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package miner

import (
"github.com/urfave/cli/v2"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-miner/config.go → cli/miner/config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package miner

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-miner/info.go → cli/miner/info.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package miner

import (
"context"
Expand Down
4 changes: 2 additions & 2 deletions cmd/lotus-miner/info_all.go → cli/miner/info_all.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package miner

import (
"flag"
Expand Down Expand Up @@ -194,7 +194,7 @@ var infoAllCmd = &cli.Command{

if !_test {
fmt.Println("\n#: Goroutines")
if err := lcli.PprofGoroutines.Action(cctx); err != nil {
if err := lcli.PprofGoroutinesCmd.Action(cctx); err != nil {
fmt.Println("ERROR: ", err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-miner/init.go → cli/miner/init.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package miner

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package miner

import (
"context"
Expand Down
Loading

0 comments on commit 466a285

Please sign in to comment.