Skip to content

Commit

Permalink
Merge branch 'release/v1.20.0' into jen/resolveconflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jennijuju committed Jan 14, 2023
2 parents 574b684 + 0731fe2 commit 427fbdb
Show file tree
Hide file tree
Showing 17 changed files with 149 additions and 243 deletions.
12 changes: 3 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,9 @@ jobs:
- run: go install golang.org/x/tools/cmd/goimports
- run: go install github.com/hannahhoward/cbor-gen-for
- run: make gen
- run: git --no-pager diff
- run: git --no-pager diff --quiet
- run: git --no-pager diff && git --no-pager diff --quiet
- run: make docsgen-cli
- run: git --no-pager diff
- run: git --no-pager diff --quiet
- run: git --no-pager diff && git --no-pager diff --quiet

docs-check:
executor: golang
Expand All @@ -412,11 +410,7 @@ jobs:
- run: zcat build/openrpc/full.json.gz | jq > ../post-openrpc-full
- run: zcat build/openrpc/miner.json.gz | jq > ../post-openrpc-miner
- run: zcat build/openrpc/worker.json.gz | jq > ../post-openrpc-worker
- run: git --no-pager diff
- run: diff ../pre-openrpc-full ../post-openrpc-full
- run: diff ../pre-openrpc-miner ../post-openrpc-miner
- run: diff ../pre-openrpc-worker ../post-openrpc-worker
- run: git --no-pager diff --quiet
- run: diff ../pre-openrpc-full ../post-openrpc-full && diff ../pre-openrpc-miner ../post-openrpc-miner && diff ../pre-openrpc-worker ../post-openrpc-worker && git --no-pager diff && git --no-pager diff --quiet

lint: &lint
description: |
Expand Down
12 changes: 3 additions & 9 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,9 @@ jobs:
- run: go install golang.org/x/tools/cmd/goimports
- run: go install github.com/hannahhoward/cbor-gen-for
- run: make gen
- run: git --no-pager diff
- run: git --no-pager diff --quiet
- run: git --no-pager diff && git --no-pager diff --quiet
- run: make docsgen-cli
- run: git --no-pager diff
- run: git --no-pager diff --quiet
- run: git --no-pager diff && git --no-pager diff --quiet

docs-check:
executor: golang
Expand All @@ -412,11 +410,7 @@ jobs:
- run: zcat build/openrpc/full.json.gz | jq > ../post-openrpc-full
- run: zcat build/openrpc/miner.json.gz | jq > ../post-openrpc-miner
- run: zcat build/openrpc/worker.json.gz | jq > ../post-openrpc-worker
- run: git --no-pager diff
- run: diff ../pre-openrpc-full ../post-openrpc-full
- run: diff ../pre-openrpc-miner ../post-openrpc-miner
- run: diff ../pre-openrpc-worker ../post-openrpc-worker
- run: git --no-pager diff --quiet
- run: diff ../pre-openrpc-full ../post-openrpc-full && diff ../pre-openrpc-miner ../post-openrpc-miner && diff ../pre-openrpc-worker ../post-openrpc-worker && git --no-pager diff && git --no-pager diff --quiet

lint: &lint
description: |
Expand Down
3 changes: 3 additions & 0 deletions chain/exchange/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ func (c *client) sendRequestToPeer(ctx context.Context, peer peer.ID, req *Reque
}
_ = stream.SetWriteDeadline(time.Time{}) // clear deadline // FIXME: Needs
// its own API (https://github.com/libp2p/go-libp2p/core/issues/162).
if err := stream.CloseWrite(); err != nil {
log.Warnw("CloseWrite err", "error", err)
}

// Read response.
var res Response
Expand Down
10 changes: 0 additions & 10 deletions chain/stmgr/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,6 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr
Data: make([]byte, 65),
},
}
default:
// XXX: Hack to make sending from f099 (and others) "just work".
// REMOVE ME.
msgApply = &types.SignedMessage{
Message: *msg,
Signature: crypto.Signature{
Type: crypto.SigTypeSecp256k1,
Data: make([]byte, 65),
},
}
}

ret, err = vmi.ApplyMessage(ctx, msgApply)
Expand Down
6 changes: 3 additions & 3 deletions chain/vm/fvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ func (x *FvmExtern) VerifyConsensusFault(ctx context.Context, a, b, extra []byte
// check blocks are properly signed by their respective miner
// note we do not need to check extra's: it is a parent to block b
// which itself is signed, so it was willingly included by the miner
gasA, sigErr := x.VerifyBlockSig(ctx, &blockA)
gasA, sigErr := x.verifyBlockSig(ctx, &blockA)
totalGas += gasA
if sigErr != nil {
log.Info("invalid consensus fault: cannot verify first block sig: %w", sigErr)
return ret, totalGas
}

gas2, sigErr := x.VerifyBlockSig(ctx, &blockB)
gas2, sigErr := x.verifyBlockSig(ctx, &blockB)
totalGas += gas2
if sigErr != nil {
log.Info("invalid consensus fault: cannot verify second block sig: %w", sigErr)
Expand All @@ -226,7 +226,7 @@ func (x *FvmExtern) VerifyConsensusFault(ctx context.Context, a, b, extra []byte
return ret, totalGas
}

func (x *FvmExtern) VerifyBlockSig(ctx context.Context, blk *types.BlockHeader) (int64, error) {
func (x *FvmExtern) verifyBlockSig(ctx context.Context, blk *types.BlockHeader) (int64, error) {
waddr, gasUsed, err := x.workerKeyAtLookback(ctx, blk.Miner, blk.Height)
if err != nil {
return gasUsed, err
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-bench/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ var sealBenchCmd = &cli.Command{
}

bo.EnvVar = make(map[string]string)
for _, envKey := range []string{"BELLMAN_NO_GPU", "FIL_PROOFS_MAXIMIZE_CACHING", "FIL_PROOFS_USE_GPU_COLUMN_BUILDER",
for _, envKey := range []string{"BELLMAN_NO_GPU", "FIL_PROOFS_USE_GPU_COLUMN_BUILDER",
"FIL_PROOFS_USE_GPU_TREE_BUILDER", "FIL_PROOFS_USE_MULTICORE_SDR", "BELLMAN_CUSTOM_GPU"} {
envValue, found := os.LookupEnv(envKey)
if found {
Expand Down
16 changes: 15 additions & 1 deletion cmd/lotus-miner/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,10 @@ var sectorsRenewCmd = &cli.Command{
Usage: "use up to this amount of FIL for one message. pass this flag to avoid message congestion.",
Value: "0",
},
&cli.Int64Flag{
Name: "max-sectors",
Usage: "the maximum number of sectors contained in each message message",
},
&cli.BoolFlag{
Name: "really-do-it",
Usage: "pass this flag to really renew sectors, otherwise will only print out json representation of parameters",
Expand Down Expand Up @@ -1020,10 +1024,20 @@ var sectorsRenewCmd = &cli.Command{
for l, exts := range extensions {
for newExp, numbers := range exts {
scount += len(numbers)
addrSectors, err := policy.GetAddressedSectorsMax(nv)
var addrSectors int
sectorsMax, err := policy.GetAddressedSectorsMax(nv)
if err != nil {
return err
}
if cctx.Int("max-sectors") == 0 {
addrSectors = sectorsMax
} else {
addrSectors = cctx.Int("max-sectors")
if addrSectors > sectorsMax {
return xerrors.Errorf("the specified max-sectors exceeds the maximum limit")
}
}

declMax, err := policy.GetDeclarationsMax(nv)
if err != nil {
return err
Expand Down
1 change: 0 additions & 1 deletion cmd/lotus-shed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func main() {
exportChainCmd,
exportCarCmd,
consensusCmd,
storageStatsCmd,
syncCmd,
stateTreePruneCmd,
datastoreCmd,
Expand Down
199 changes: 0 additions & 199 deletions cmd/lotus-shed/storage-stats.go

This file was deleted.

1 change: 1 addition & 0 deletions documentation/en/cli-lotus-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,7 @@ OPTIONS:
--extension value try to extend selected sectors by this number of epochs, defaults to 540 days (default: 1555200)
--from value only consider sectors whose current expiration epoch is in the range of [from, to], <from> defaults to: now + 120 (1 hour) (default: 0)
--max-fee value use up to this amount of FIL for one message. pass this flag to avoid message congestion. (default: "0")
--max-sectors value the maximum number of sectors contained in each message message (default: 0)
--new-expiration value try to extend selected sectors to this epoch, ignoring extension (default: 0)
--only-cc only extend CC sectors (useful for making sector ready for snap upgrade) (default: false)
--really-do-it pass this flag to really renew sectors, otherwise will only print out json representation of parameters (default: false)
Expand Down
1 change: 0 additions & 1 deletion node/builder_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ func ConfigFullNode(c interface{}) Option {

// Actor event filtering support
Override(new(events.EventAPI), From(new(modules.EventAPI))),

// in lite-mode Eth event api is provided by gateway
ApplyIf(isFullNode, Override(new(full.EthEventAPI), modules.EthEventAPI(cfg.ActorEvent))),
)
Expand Down
3 changes: 3 additions & 0 deletions node/hello/hello.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ func (hs *Service) SayHello(ctx context.Context, pid peer.ID) error {
if err := cborutil.WriteCborRPC(s, hmsg); err != nil {
return xerrors.Errorf("writing rpc to peer: %w", err)
}
if err := s.CloseWrite(); err != nil {
log.Warnw("CloseWrite err", "error", err)
}

go func() {
defer s.Close() //nolint:errcheck
Expand Down
Loading

0 comments on commit 427fbdb

Please sign in to comment.