From 8e211f4f90ee26bd69ce91852fde134ff59dce2c Mon Sep 17 00:00:00 2001 From: LexLuthr <88259624+LexLuthr@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:44:37 +0400 Subject: [PATCH] remove wdPost pre-checks, unused config (#252) --- deps/config/doc_gen.go | 67 +------------------ deps/config/types.go | 57 +--------------- .../default-curio-configuration.md | 63 +---------------- tasks/window/compute_do.go | 40 ++--------- 4 files changed, 7 insertions(+), 220 deletions(-) diff --git a/deps/config/doc_gen.go b/deps/config/doc_gen.go index a951181d2..1a1cd15cb 100644 --- a/deps/config/doc_gen.go +++ b/deps/config/doc_gen.go @@ -308,7 +308,7 @@ WARNING: Setting this value too low may make sector challenge reading much slowe to late submission. After changing this option, confirm that the new value works in your setup by invoking -'lotus-miner proving compute window-post 0'`, +'curio test wd task 0'`, }, { Name: "SingleCheckTimeout", @@ -333,71 +333,6 @@ test challenge took longer than this timeout WARNING: Setting this value too high risks missing PoSt deadline in case IO operations related to this partition are blocked or slow`, }, - { - Name: "DisableWDPoStPreChecks", - Type: "bool", - - Comment: `Disable WindowPoSt provable sector readability checks. - -In normal operation, when preparing to compute WindowPoSt, lotus-miner will perform a round of reading challenges -from all sectors to confirm that those sectors can be proven. Challenges read in this process are discarded, as -we're only interested in checking that sector data can be read. - -When using builtin proof computation (no PoSt workers, and DisableBuiltinWindowPoSt is set to false), this process -can save a lot of time and compute resources in the case that some sectors are not readable - this is caused by -the builtin logic not skipping snark computation when some sectors need to be skipped. - -When using PoSt workers, this process is mostly redundant, with PoSt workers challenges will be read once, and -if challenges for some sectors aren't readable, those sectors will just get skipped. - -Disabling sector pre-checks will slightly reduce IO load when proving sectors, possibly resulting in shorter -time to produce window PoSt. In setups with good IO capabilities the effect of this option on proving time should -be negligible. - -NOTE: It likely is a bad idea to disable sector pre-checks in setups with no PoSt workers. - -NOTE: Even when this option is enabled, recovering sectors will be checked before recovery declaration message is -sent to the chain - -After changing this option, confirm that the new value works in your setup by invoking -'lotus-miner proving compute window-post 0'`, - }, - { - Name: "MaxPartitionsPerPoStMessage", - Type: "int", - - Comment: `Maximum number of partitions to prove in a single SubmitWindowPoSt messace. 0 = network limit (3 in nv21) - -A single partition may contain up to 2349 32GiB sectors, or 2300 64GiB sectors. -// -Note that setting this value lower may result in less efficient gas use - more messages will be sent, -to prove each deadline, resulting in more total gas use (but each message will have lower gas limit) - -Setting this value above the network limit has no effect`, - }, - { - Name: "MaxPartitionsPerRecoveryMessage", - Type: "int", - - Comment: `In some cases when submitting DeclareFaultsRecovered messages, -there may be too many recoveries to fit in a BlockGasLimit. -In those cases it may be necessary to set this value to something low (eg 1); -Note that setting this value lower may result in less efficient gas use - more messages will be sent than needed, -resulting in more total gas use (but each message will have lower gas limit)`, - }, - { - Name: "SingleRecoveringPartitionPerPostMessage", - Type: "bool", - - Comment: `Enable single partition per PoSt Message for partitions containing recovery sectors - -In cases when submitting PoSt messages which contain recovering sectors, the default network limit may still be -too high to fit in the block gas limit. In those cases, it becomes useful to only house the single partition -with recovering sectors in the post message - -Note that setting this value lower may result in less efficient gas use - more messages will be sent, -to prove each deadline, resulting in more total gas use (but each message will have lower gas limit)`, - }, }, "CurioSealConfig": { { diff --git a/deps/config/types.go b/deps/config/types.go index 2c1155037..12715f8e8 100644 --- a/deps/config/types.go +++ b/deps/config/types.go @@ -327,7 +327,7 @@ type CurioProvingConfig struct { // to late submission. // // After changing this option, confirm that the new value works in your setup by invoking - // 'lotus-miner proving compute window-post 0' + // 'curio test wd task 0' ParallelCheckLimit int // Maximum amount of time a proving pre-check can take for a sector. If the check times out the sector will be skipped @@ -346,61 +346,6 @@ type CurioProvingConfig struct { // WARNING: Setting this value too high risks missing PoSt deadline in case IO operations related to this partition are // blocked or slow PartitionCheckTimeout Duration - - // Disable WindowPoSt provable sector readability checks. - // - // In normal operation, when preparing to compute WindowPoSt, lotus-miner will perform a round of reading challenges - // from all sectors to confirm that those sectors can be proven. Challenges read in this process are discarded, as - // we're only interested in checking that sector data can be read. - // - // When using builtin proof computation (no PoSt workers, and DisableBuiltinWindowPoSt is set to false), this process - // can save a lot of time and compute resources in the case that some sectors are not readable - this is caused by - // the builtin logic not skipping snark computation when some sectors need to be skipped. - // - // When using PoSt workers, this process is mostly redundant, with PoSt workers challenges will be read once, and - // if challenges for some sectors aren't readable, those sectors will just get skipped. - // - // Disabling sector pre-checks will slightly reduce IO load when proving sectors, possibly resulting in shorter - // time to produce window PoSt. In setups with good IO capabilities the effect of this option on proving time should - // be negligible. - // - // NOTE: It likely is a bad idea to disable sector pre-checks in setups with no PoSt workers. - // - // NOTE: Even when this option is enabled, recovering sectors will be checked before recovery declaration message is - // sent to the chain - // - // After changing this option, confirm that the new value works in your setup by invoking - // 'lotus-miner proving compute window-post 0' - DisableWDPoStPreChecks bool - - // Maximum number of partitions to prove in a single SubmitWindowPoSt messace. 0 = network limit (3 in nv21) - // - // A single partition may contain up to 2349 32GiB sectors, or 2300 64GiB sectors. - // // - // Note that setting this value lower may result in less efficient gas use - more messages will be sent, - // to prove each deadline, resulting in more total gas use (but each message will have lower gas limit) - // - // Setting this value above the network limit has no effect - MaxPartitionsPerPoStMessage int - - // Maximum number of partitions to declare in a single DeclareFaultsRecovered message. 0 = no limit. - - // In some cases when submitting DeclareFaultsRecovered messages, - // there may be too many recoveries to fit in a BlockGasLimit. - // In those cases it may be necessary to set this value to something low (eg 1); - // Note that setting this value lower may result in less efficient gas use - more messages will be sent than needed, - // resulting in more total gas use (but each message will have lower gas limit) - MaxPartitionsPerRecoveryMessage int - - // Enable single partition per PoSt Message for partitions containing recovery sectors - // - // In cases when submitting PoSt messages which contain recovering sectors, the default network limit may still be - // too high to fit in the block gas limit. In those cases, it becomes useful to only house the single partition - // with recovering sectors in the post message - // - // Note that setting this value lower may result in less efficient gas use - more messages will be sent, - // to prove each deadline, resulting in more total gas use (but each message will have lower gas limit) - SingleRecoveringPartitionPerPostMessage bool } // Duration is a wrapper type for time.Duration diff --git a/documentation/en/configuration/default-curio-configuration.md b/documentation/en/configuration/default-curio-configuration.md index 930ce2fc6..3d40c69c5 100644 --- a/documentation/en/configuration/default-curio-configuration.md +++ b/documentation/en/configuration/default-curio-configuration.md @@ -325,7 +325,7 @@ description: The default curio configuration # to late submission. # # After changing this option, confirm that the new value works in your setup by invoking - # 'lotus-miner proving compute window-post 0' + # 'curio test wd task 0' # # type: int #ParallelCheckLimit = 32 @@ -351,67 +351,6 @@ description: The default curio configuration # type: Duration #PartitionCheckTimeout = "20m0s" - # Disable WindowPoSt provable sector readability checks. - # - # In normal operation, when preparing to compute WindowPoSt, lotus-miner will perform a round of reading challenges - # from all sectors to confirm that those sectors can be proven. Challenges read in this process are discarded, as - # we're only interested in checking that sector data can be read. - # - # When using builtin proof computation (no PoSt workers, and DisableBuiltinWindowPoSt is set to false), this process - # can save a lot of time and compute resources in the case that some sectors are not readable - this is caused by - # the builtin logic not skipping snark computation when some sectors need to be skipped. - # - # When using PoSt workers, this process is mostly redundant, with PoSt workers challenges will be read once, and - # if challenges for some sectors aren't readable, those sectors will just get skipped. - # - # Disabling sector pre-checks will slightly reduce IO load when proving sectors, possibly resulting in shorter - # time to produce window PoSt. In setups with good IO capabilities the effect of this option on proving time should - # be negligible. - # - # NOTE: It likely is a bad idea to disable sector pre-checks in setups with no PoSt workers. - # - # NOTE: Even when this option is enabled, recovering sectors will be checked before recovery declaration message is - # sent to the chain - # - # After changing this option, confirm that the new value works in your setup by invoking - # 'lotus-miner proving compute window-post 0' - # - # type: bool - #DisableWDPoStPreChecks = false - - # Maximum number of partitions to prove in a single SubmitWindowPoSt messace. 0 = network limit (3 in nv21) - # - # A single partition may contain up to 2349 32GiB sectors, or 2300 64GiB sectors. - # // - # Note that setting this value lower may result in less efficient gas use - more messages will be sent, - # to prove each deadline, resulting in more total gas use (but each message will have lower gas limit) - # - # Setting this value above the network limit has no effect - # - # type: int - #MaxPartitionsPerPoStMessage = 0 - - # In some cases when submitting DeclareFaultsRecovered messages, - # there may be too many recoveries to fit in a BlockGasLimit. - # In those cases it may be necessary to set this value to something low (eg 1); - # Note that setting this value lower may result in less efficient gas use - more messages will be sent than needed, - # resulting in more total gas use (but each message will have lower gas limit) - # - # type: int - #MaxPartitionsPerRecoveryMessage = 0 - - # Enable single partition per PoSt Message for partitions containing recovery sectors - # - # In cases when submitting PoSt messages which contain recovering sectors, the default network limit may still be - # too high to fit in the block gas limit. In those cases, it becomes useful to only house the single partition - # with recovering sectors in the post message - # - # Note that setting this value lower may result in less efficient gas use - more messages will be sent, - # to prove each deadline, resulting in more total gas use (but each message will have lower gas limit) - # - # type: bool - #SingleRecoveringPartitionPerPostMessage = false - [Ingest] # Maximum number of sectors that can be queued waiting for deals to start processing. diff --git a/tasks/window/compute_do.go b/tasks/window/compute_do.go index fae4f886a..07d506c06 100644 --- a/tasks/window/compute_do.go +++ b/tasks/window/compute_do.go @@ -31,8 +31,6 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -const disablePreChecks = false // todo config - func (t *WdPostTask) DoPartition(ctx context.Context, ts *types.TipSet, maddr address.Address, di *dline.Info, partIdx uint64, test bool) (out *miner2.SubmitWindowedPoStParams, err error) { defer func() { if r := recover(); r != nil { @@ -74,7 +72,6 @@ func (t *WdPostTask) DoPartition(ctx context.Context, ts *types.TipSet, maddr ad } var postPartition miner2.PoStPartition - var xsinfos []proof7.ExtendedSectorInfo { toProve, err := bitfield.SubtractBitField(partition.LiveSectors, partition.FaultySectors) @@ -95,53 +92,24 @@ func (t *WdPostTask) DoPartition(ctx context.Context, ts *types.TipSet, maddr ad if err != nil { return nil, xerrors.Errorf("copy toProve: %w", err) } - if !disablePreChecks { - good, err = checkSectors(ctx, t.api, t.faultTracker, maddr, toProve, ts.Key()) - if err != nil { - return nil, xerrors.Errorf("checking sectors to skip: %w", err) - } - } - - /*good, err = bitfield.SubtractBitField(good, postSkipped) - if err != nil { - return nil, xerrors.Errorf("toProve - postSkipped: %w", err) - } - - post skipped is legacy retry mechanism, shouldn't be needed anymore - */ - - skipped, err := bitfield.SubtractBitField(toProve, good) - if err != nil { - return nil, xerrors.Errorf("toProve - good: %w", err) - } - - sc, err := skipped.Count() - if err != nil { - return nil, xerrors.Errorf("getting skipped sector count: %w", err) - } - - skipCount := sc - ssi, err := t.sectorsForProof(ctx, maddr, good, partition.AllSectors, ts) + xsinfos, err := t.sectorsForProof(ctx, maddr, good, partition.AllSectors, ts) if err != nil { return nil, xerrors.Errorf("getting sorted sector info: %w", err) } - if len(ssi) == 0 { + if len(xsinfos) == 0 { return nil, xerrors.Errorf("no sectors to prove") } - xsinfos = append(xsinfos, ssi...) postPartition = miner2.PoStPartition{ - Index: partIdx, - Skipped: skipped, + Index: partIdx, } log.Infow("running window post", "chain-random", rand, "deadline", di, - "height", ts.Height(), - "skipped", skipCount) + "height", ts.Height()) tsStart := build.Clock.Now()