Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

feat: v1.14.0: fetch changes from version rc7 to v1.14.0 #185

Merged
merged 2 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions app/venus-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ var runCmd = &cli.Command{
Usage: "enable prove replica update 2",
Value: true,
},
&cli.BoolFlag{
Name: "regen-sector-key",
Usage: "enable regen sector key",
Value: true,
},
&cli.IntFlag{
Name: "parallel-fetch-limit",
Usage: "maximum fetch operations to run in parallel",
Expand Down Expand Up @@ -323,13 +328,15 @@ var runCmd = &cli.Command{
if cctx.Bool("commit") {
taskTypes = append(taskTypes, types.TTCommit2)
}
if cctx.Bool("replicaupdate") {
if cctx.Bool("replica-update") {
taskTypes = append(taskTypes, types.TTReplicaUpdate)
}
if cctx.Bool("prove-replica-update2") {
taskTypes = append(taskTypes, types.TTProveReplicaUpdate2)
}

if cctx.Bool("regen-sector-key") {
taskTypes = append(taskTypes, types.TTRegenSectorKey)
}
if len(taskTypes) == 0 {
return xerrors.Errorf("no task types specified")
}
Expand Down
13 changes: 8 additions & 5 deletions app/venus-worker/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ var tasksCmd = &cli.Command{
}

var allowSetting = map[types.TaskType]struct{}{
types.TTAddPiece: {},
types.TTPreCommit1: {},
types.TTPreCommit2: {},
types.TTCommit2: {},
types.TTUnseal: {},
types.TTAddPiece: {},
types.TTPreCommit1: {},
types.TTPreCommit2: {},
types.TTCommit2: {},
types.TTUnseal: {},
types.TTReplicaUpdate: {},
types.TTProveReplicaUpdate2: {},
types.TTRegenSectorKey: {},
}

var settableStr = func() string {
Expand Down
13 changes: 9 additions & 4 deletions config/default_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func DefaultMainnetStorageMiner() *StorageMiner {
AllowUnseal: true,
AllowReplicaUpdate: true,
AllowProveReplicaUpdate2: true,
AllowRegenSectorKey: true,

// Default to 10 - tcp should still be able to figure this out, and
// it's the ratio between 10gbit / 1gbit
Expand Down Expand Up @@ -96,7 +97,7 @@ func DefaultMainnetStorageMiner() *StorageMiner {
},
NetParams: NetParamsConfig{
UpgradeIgnitionHeight: 94000,
UpgradeOhSnapHeight: 999999999999,
UpgradeOhSnapHeight: 1594680,
ForkLengthThreshold: policy.ChainFinality,
BlockDelaySecs: 30,
},
Expand Down Expand Up @@ -148,6 +149,7 @@ func DefaultForceNetStorageMiner() *StorageMiner {
AllowUnseal: true,
AllowReplicaUpdate: true,
AllowProveReplicaUpdate2: true,
AllowRegenSectorKey: true,

// Default to 10 - tcp should still be able to figure this out, and
// it's the ratio between 10gbit / 1gbit
Expand Down Expand Up @@ -230,6 +232,7 @@ func DefaultCalibrationStorageMiner() *StorageMiner {
AllowUnseal: true,
AllowReplicaUpdate: true,
AllowProveReplicaUpdate2: true,
AllowRegenSectorKey: true,

// Default to 10 - tcp should still be able to figure this out, and
// it's the ratio between 10gbit / 1gbit
Expand Down Expand Up @@ -260,9 +263,9 @@ func DefaultCalibrationStorageMiner() *StorageMiner {
NetParams: NetParamsConfig{
UpgradeIgnitionHeight: -3,
// 2022-02-10T19:23:00Z
UpgradeOhSnapHeight: 682006,
ForkLengthThreshold: policy.ChainFinality,
BlockDelaySecs: 30,
UpgradeOhSnapHeight: 682006,
ForkLengthThreshold: policy.ChainFinality,
BlockDelaySecs: 30,
},
DB: DbConfig{
Type: "sqlite",
Expand Down Expand Up @@ -344,6 +347,7 @@ func Default2kStorageMiner() *StorageMiner {
AllowUnseal: true,
AllowReplicaUpdate: true,
AllowProveReplicaUpdate2: true,
AllowRegenSectorKey: true,

// Default to 10 - tcp should still be able to figure this out, and
// it's the ratio between 10gbit / 1gbit
Expand Down Expand Up @@ -429,6 +433,7 @@ func DefaultButterflyStorageMiner() *StorageMiner {
AllowUnseal: true,
AllowReplicaUpdate: true,
AllowProveReplicaUpdate2: true,
AllowRegenSectorKey: true,

// Default to 10 - tcp should still be able to figure this out, and
// it's the ratio between 10gbit / 1gbit
Expand Down
2 changes: 1 addition & 1 deletion constants/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (ve Version) EqMajorMinor(v2 Version) bool {
}

// BuildVersion is the local build version, set by build system
const BuildVersion = "1.4.0-rc5"
const BuildVersion = "1.4.0-prep"

func UserVersion() string {
if os.Getenv("VENUS_SEALER_VERSION_IGNORE_COMMIT") == "1" {
Expand Down
4 changes: 4 additions & 0 deletions sector-storage/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ type SealerConfig struct {
AllowUnseal bool
AllowReplicaUpdate bool
AllowProveReplicaUpdate2 bool
AllowRegenSectorKey bool

// ResourceFiltering instructs the system which resource filtering strategy
// to use when evaluating tasks against this worker. An empty value defaults
Expand Down Expand Up @@ -174,6 +175,9 @@ func New(ctx context.Context, lstor *stores.Local, stor *stores.Remote, ls store
if sc.AllowProveReplicaUpdate2 {
localTasks = append(localTasks, types.TTProveReplicaUpdate2)
}
if sc.AllowRegenSectorKey {
localTasks = append(localTasks, types.TTRegenSectorKey)
}

wcfg := WorkerConfig{
IgnoreResourceFiltering: sc.ResourceFiltering == ResourceFilteringDisabled,
Expand Down
9 changes: 7 additions & 2 deletions storage-sealing/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,13 @@ func checkReplicaUpdate(ctx context.Context, maddr address.Address, si types.Sec
if err != nil {
return &ErrApi{xerrors.Errorf("calling StateComputeDataCommitment: %w", err)}
}
if si.UpdateUnsealed == nil || !commD.Equals(*si.UpdateUnsealed) {
return &ErrBadRU{xerrors.Errorf("on chain CommD differs from sector: %s != %s", commD, si.CommD)}

if si.UpdateUnsealed == nil {
return &ErrBadRU{xerrors.New("nil UpdateUnsealed cid after replica update")}
}

if !commD.Equals(*si.UpdateUnsealed) {
return &ErrBadRU{xerrors.Errorf("calculated CommD differs from updated replica: %s != %s", commD, *si.UpdateUnsealed)}
}

if si.UpdateSealed == nil {
Expand Down