2021-06-18 18:45:29 +00:00
|
|
|
package kit
|
2021-06-11 17:26:25 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
2022-12-13 12:03:42 +00:00
|
|
|
"time"
|
2021-06-11 17:26:25 +00:00
|
|
|
|
2022-06-14 15:00:51 +00:00
|
|
|
logging "github.com/ipfs/go-log/v2"
|
|
|
|
|
2021-06-11 17:26:25 +00:00
|
|
|
"github.com/filecoin-project/go-state-types/abi"
|
2021-07-07 17:35:27 +00:00
|
|
|
"github.com/filecoin-project/go-state-types/big"
|
2021-08-20 14:53:24 +00:00
|
|
|
|
2021-06-11 17:26:25 +00:00
|
|
|
"github.com/filecoin-project/lotus/build"
|
|
|
|
"github.com/filecoin-project/lotus/chain/actors/policy"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
_ = logging.SetLogLevel("*", "INFO")
|
|
|
|
|
feat: refactor: actor bundling system (#8838)
1. Include the builtin-actors in the lotus source tree.
2. Embed the bundle on build instead of downloading at runtime.
3. Avoid reading the bundle whenever possible by including bundle
metadata (the bundle CID, the actor CIDs, etc.).
4. Remove everything related to dependency injection.
1. We're no longer downloading the bundle, so doing anything ahead
of time doesn't really help.
2. We register the manifests on init because, unfortunately, they're
global.
3. We explicitly load the current actors bundle in the genesis
state-tree method.
4. For testing, we just change the in-use bundle with a bit of a
hack. It's not great, but using dependency injection doesn't make
any sense either because, again, the manifest information is
global.
5. Remove the bundle.toml file. Bundles may be overridden by
specifying an override path in the parameters file, or an
environment variable.
fixes #8701
2022-06-13 17:15:00 +00:00
|
|
|
// These values mimic the values set in the builtin-actors when configured to use the "testing" network. Specifically:
|
|
|
|
// - All proof types.
|
|
|
|
// - 2k minimum power.
|
|
|
|
// - "small" verified deals.
|
|
|
|
// - short precommit
|
|
|
|
//
|
|
|
|
// See:
|
|
|
|
// - https://github.com/filecoin-project/builtin-actors/blob/0502c0722225ee58d1e6641431b4f9356cb2d18e/actors/runtime/src/runtime/policy.rs#L235
|
|
|
|
// - https://github.com/filecoin-project/builtin-actors/blob/0502c0722225ee58d1e6641431b4f9356cb2d18e/actors/runtime/build.rs#L17-L45
|
2021-07-07 17:35:27 +00:00
|
|
|
policy.SetProviderCollateralSupplyTarget(big.Zero(), big.NewInt(1))
|
2021-06-11 17:26:25 +00:00
|
|
|
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
|
|
|
|
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
feat: refactor: actor bundling system (#8838)
1. Include the builtin-actors in the lotus source tree.
2. Embed the bundle on build instead of downloading at runtime.
3. Avoid reading the bundle whenever possible by including bundle
metadata (the bundle CID, the actor CIDs, etc.).
4. Remove everything related to dependency injection.
1. We're no longer downloading the bundle, so doing anything ahead
of time doesn't really help.
2. We register the manifests on init because, unfortunately, they're
global.
3. We explicitly load the current actors bundle in the genesis
state-tree method.
4. For testing, we just change the in-use bundle with a bit of a
hack. It's not great, but using dependency injection doesn't make
any sense either because, again, the manifest information is
global.
5. Remove the bundle.toml file. Bundles may be overridden by
specifying an override path in the parameters file, or an
environment variable.
fixes #8701
2022-06-13 17:15:00 +00:00
|
|
|
policy.SetPreCommitChallengeDelay(10)
|
|
|
|
policy.SetSupportedProofTypes(
|
|
|
|
abi.RegisteredSealProof_StackedDrg2KiBV1,
|
|
|
|
abi.RegisteredSealProof_StackedDrg8MiBV1,
|
|
|
|
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
|
|
|
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
|
|
|
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
|
|
|
)
|
|
|
|
policy.SetProviderCollateralSupplyTarget(big.NewInt(0), big.NewInt(100))
|
2021-06-11 17:26:25 +00:00
|
|
|
|
|
|
|
build.InsecurePoStValidation = true
|
|
|
|
|
2022-12-13 12:03:42 +00:00
|
|
|
// NOTE: If we want the payment channel itests to pass that use a
|
|
|
|
// block time of 5*millisecond, we need to set the consistent broadcast
|
|
|
|
// delay to something lower than that block time.
|
|
|
|
// todo: configure such a low delay only for paych tests.
|
|
|
|
build.CBDeliveryDelay = 2 * time.Millisecond
|
|
|
|
|
2021-06-11 17:26:25 +00:00
|
|
|
if err := os.Setenv("BELLMAN_NO_GPU", "1"); err != nil {
|
|
|
|
panic(fmt.Sprintf("failed to set BELLMAN_NO_GPU env variable: %s", err))
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := os.Setenv("LOTUS_DISABLE_WATCHDOG", "1"); err != nil {
|
|
|
|
panic(fmt.Sprintf("failed to set LOTUS_DISABLE_WATCHDOG env variable: %s", err))
|
|
|
|
}
|
|
|
|
}
|