diff --git a/chain/actors/policy/policy.go b/chain/actors/policy/policy.go index d927f369f3e..a0e4728fe1a 100644 --- a/chain/actors/policy/policy.go +++ b/chain/actors/policy/policy.go @@ -622,7 +622,8 @@ func GetMaxPoStPartitions(nv network.Version, p abi.RegisteredPoStProof) (int, e if err != nil { return 0, err } - return int(uint64(maxSectors) / sectorsPerPart), nil + + return min(miner12.PoStedPartitionsMax, int(uint64(maxSectors)/sectorsPerPart)), nil } func GetDefaultAggregationProof() abi.RegisteredAggregationProof { @@ -865,3 +866,10 @@ func AggregatePreCommitNetworkFee(nwVer network.Version, aggregateSize int, base return big.Zero(), xerrors.Errorf("unsupported network version") } } + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/chain/actors/policy/policy.go.template b/chain/actors/policy/policy.go.template index c3ce4a9d918..8803c97e6a2 100644 --- a/chain/actors/policy/policy.go.template +++ b/chain/actors/policy/policy.go.template @@ -252,7 +252,8 @@ func GetMaxPoStPartitions(nv network.Version, p abi.RegisteredPoStProof) (int, e if err != nil { return 0, err } - return int(uint64(maxSectors) / sectorsPerPart), nil + + return min(miner{{.latestVersion}}.PoStedPartitionsMax, int(uint64(maxSectors) / sectorsPerPart)), nil } func GetDefaultAggregationProof() abi.RegisteredAggregationProof { @@ -341,3 +342,10 @@ func AggregatePreCommitNetworkFee(nwVer network.Version, aggregateSize int, base return big.Zero(), xerrors.Errorf("unsupported network version") } } + +func min(a, b int) int { + if a < b { + return a + } + return b +} \ No newline at end of file diff --git a/go.mod b/go.mod index 49ca2ff6439..778351e07d4 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/filecoin-project/go-jsonrpc v0.3.1 github.com/filecoin-project/go-padreader v0.0.1 github.com/filecoin-project/go-paramfetch v0.0.4 - github.com/filecoin-project/go-state-types v0.12.4-0.20231002153316-c656c180c4d2 + github.com/filecoin-project/go-state-types v0.12.4 github.com/filecoin-project/go-statemachine v1.0.3 github.com/filecoin-project/go-statestore v0.2.0 github.com/filecoin-project/go-storedcounter v0.1.0 @@ -338,3 +338,5 @@ require ( replace github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi replace github.com/filecoin-project/test-vectors => ./extern/test-vectors + +replace github.com/filecoin-project/go-state-types => ../go-state-types diff --git a/go.sum b/go.sum index 9f15520e773..e6b150a4cd4 100644 --- a/go.sum +++ b/go.sum @@ -288,7 +288,6 @@ github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoC github.com/filecoin-project/go-amt-ipld/v3 v3.0.0/go.mod h1:Qa95YNAbtoVCTSVtX38aAC1ptBnJfPma1R/zZsKmx4o= github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 h1:ZNJ9tEG5bE72vBWYiuh5bkxJVM3ViHNOmQ7qew9n6RE= github.com/filecoin-project/go-amt-ipld/v3 v3.1.0/go.mod h1:UjM2QhDFrrjD5s1CdnkJkat4ga+LqZBZgTMniypABRo= -github.com/filecoin-project/go-amt-ipld/v4 v4.0.0/go.mod h1:gF053YQ4BIpzTNDoEwHZas7U3oAwncDVGvOHyY8oDpE= github.com/filecoin-project/go-amt-ipld/v4 v4.2.0 h1:DQTXQwMXxaetd+lhZGODjt5qC1WYT7tMAlYrWqI/fwI= github.com/filecoin-project/go-amt-ipld/v4 v4.2.0/go.mod h1:0eDVF7pROvxrsxvLJx+SJZXqRaXXcEPUcgb/rG0zGU4= github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= @@ -331,15 +330,6 @@ github.com/filecoin-project/go-padreader v0.0.1/go.mod h1:VYVPJqwpsfmtoHnAmPx6MU github.com/filecoin-project/go-paramfetch v0.0.4 h1:H+Me8EL8T5+79z/KHYQQcT8NVOzYVqXIi7nhb48tdm8= github.com/filecoin-project/go-paramfetch v0.0.4/go.mod h1:1FH85P8U+DUEmWk1Jkw3Bw7FrwTVUNHk/95PSPG+dts= github.com/filecoin-project/go-retrieval-types v1.2.0 h1:fz6DauLVP3GRg7UuW7HZ6sE+GTmaUW70DTXBF1r9cK0= -github.com/filecoin-project/go-state-types v0.0.0-20200903145444-247639ffa6ad/go.mod h1:IQ0MBPnonv35CJHtWSN3YY1Hz2gkPru1Q9qoaYLxx9I= -github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= -github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= -github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= -github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= -github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= -github.com/filecoin-project/go-state-types v0.11.2-0.20230712101859-8f37624fa540/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8= -github.com/filecoin-project/go-state-types v0.12.4-0.20231002153316-c656c180c4d2 h1:eZvCTWl1Z3FxKB45gKN4RdDbaI0qBt+w2mG/lFEE3rs= -github.com/filecoin-project/go-state-types v0.12.4-0.20231002153316-c656c180c4d2/go.mod h1:iJTqGdWDvzXhuVf64Lw0hzt4TIoitMo0VgHdxdjNDZI= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= diff --git a/node/config/doc_gen.go b/node/config/doc_gen.go index b3df012ea4c..0aa63bf3a02 100644 --- a/node/config/doc_gen.go +++ b/node/config/doc_gen.go @@ -853,13 +853,10 @@ After changing this option, confirm that the new value works in your setup by in Name: "MaxPartitionsPerPoStMessage", Type: "int", - Comment: `Maximum number of partitions to prove in a single SubmitWindowPoSt messace. 0 = network limit (10 in nv16) + 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. - -The maximum number of sectors which can be proven in a single PoSt message is 25000 in network version 16, which -means that a single message can prove at most 10 partitions - +// 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) diff --git a/node/config/types.go b/node/config/types.go index 78f2d136193..28d671a879c 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -290,13 +290,10 @@ type ProvingConfig struct { // 'lotus-miner proving compute window-post 0' DisableWDPoStPreChecks bool - // Maximum number of partitions to prove in a single SubmitWindowPoSt messace. 0 = network limit (10 in nv16) + // 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. - // - // The maximum number of sectors which can be proven in a single PoSt message is 25000 in network version 16, which - // means that a single message can prove at most 10 partitions - // + // // // 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) // diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 5e137bfc4d9..b392083e175 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -934,10 +934,11 @@ func (a *StateAPI) stateComputeDataCIDv1(ctx context.Context, maddr address.Addr return cid.Undef, xerrors.Errorf("computing params for ComputeDataCommitment: %w", err) } ccmt := &types.Message{ - To: market.Address, - From: maddr, - Value: types.NewInt(0), - Method: market.Methods.ComputeDataCommitment, + To: market.Address, + From: maddr, + Value: types.NewInt(0), + // Hard coded, because the method has since been deprecated + Method: 8, Params: ccparams, } r, err := a.StateCall(ctx, ccmt, tsk) @@ -971,10 +972,11 @@ func (a *StateAPI) stateComputeDataCIDv2(ctx context.Context, maddr address.Addr return cid.Undef, xerrors.Errorf("computing params for ComputeDataCommitment: %w", err) } ccmt := &types.Message{ - To: market.Address, - From: maddr, - Value: types.NewInt(0), - Method: market.Methods.ComputeDataCommitment, + To: market.Address, + From: maddr, + Value: types.NewInt(0), + // Hard coded, because the method has since been deprecated + Method: 8, Params: ccparams, } r, err := a.StateCall(ctx, ccmt, tsk)