diff --git a/CHANGELOG.md b/CHANGELOG.md index 75cf916020e..f106ccc70ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,11 @@ # Lotus changelog -# v1.13.0-rc2 / 2021-10-06 +# v1.13.0-rc3 / 2021-10-13 -This is the second release candidates for lotus v1.13.0, a recommended lotus release that supports the upcoming +This is the third release candidates for lotus v1.13.0, a recommended lotus release that supports the upcoming [Network v14 Chocolate upgrade](https://github.com/filecoin-project/lotus/discussions/7431). This feature release includes latest functionality and improvements, like data transfer rate-limiting, rust-proof-ffi experimental CUDA support and so on. We *highly recommend* users like storage providers, data brokers, and so on to upgrade your nodes and all subsystems to this release! -> Note: This release candidate sets the upgrade epoch for calibration net, however, it does not set the Network v14 -> Chocolate upgrade for mainnet. FIPs(FIP0020-0025) included are based on optimistic acceptance, things may well -> change according to the result of FIP last calls. - ## Highlights - Enable separate storage and retrieval transfer limits ([filecoin-project/lotus#7405](https://github.com/filecoin-project/lotus/pull/7405)) - Update proofs to v10.0.0 ([filecoin-project/lotus#7420](https://github.com/filecoin-project/lotus/pull/7420)) @@ -40,33 +36,15 @@ This feature release includes latest functionality and improvements, like data t ## Bug Fixes - StateSearchMsg: Correct usage of the allowReplaced flag ([filecoin-project/lotus#7450](https://github.com/filecoin-project/lotus/pull/7450)) - fix staging area path buildup ([filecoin-project/lotus#7363](https://github.com/filecoin-project/lotus/pull/7363)) -- Randomness: Move getters from ChainAPI to StateAPI ([filecoin-project/lotus#7322](https://github.com/filecoin-project/lotus/pull/7322)) - storagemgr: Cleanup workerLk around worker resources ([filecoin-project/lotus#7334](https://github.com/filecoin-project/lotus/pull/7334)) - fix: check padSector Cid ([filecoin-project/lotus#7310](https://github.com/filecoin-project/lotus/pull/7310)) +- sealing: Recover sectors after failed AddPiece ([filecoin-project/lotus#7492](https://github.com/filecoin-project/lotus/pull/7492)) +- fix: support node instantiation in external packages ([filecoin-project/lotus#7511](https://github.com/filecoin-project/lotus/pull/7511)) ## Dependency Updates - github.com/filecoin-project/go-data-transfer (v1.10.1 -> v1.11.1): - github.com/filecoin-project/go-fil-markets (v1.12.0 -> v1.13.1): - github.com/filecoin-project/go-paramfetch (v0.0.2-0.20210614165157-25a6c7769498 -> v0.0.2): -- github.com/filecoin-project/specs-actors/v6-rc1: - - Better logging (#1503) ([filecoin-project/specs-actors#1503](https://github.com/filecoin-project/specs-actors/pull/1503)) - - Defensive programming: harden power actor against seal verify failures (#1502) ([filecoin-project/specs-actors#1502](https://github.com/filecoin-project/specs-actors/pull/1502)) - - BatchBalancer fee charged on precommit aggregate (#1497) ([filecoin-project/specs-actors#1497](https://github.com/filecoin-project/specs-actors/pull/1497)) - - Fix #1486 (#1489) ([filecoin-project/specs-actors#1489](https://github.com/filecoin-project/specs-actors/pull/1489)) - - Sector extension deal weight bug fix (#1498) ([filecoin-project/specs-actors#1498](https://github.com/filecoin-project/specs-actors/pull/1498)) - - Fip 0021 (#1487) ([filecoin-project/specs-actors#1487](https://github.com/filecoin-project/specs-actors/pull/1487)) - - Fix #176 (swap to xerrors from pkg/errors) (#1494) ([filecoin-project/specs-actors#1494](https://github.com/filecoin-project/specs-actors/pull/1494)) - - Merge branch 'master' of github.com:filecoin-project/specs-actors - - Merge branch 'fix-799' - - compute the hash of the proposal iff the proposal hash is present (#1365) ([filecoin-project/specs-actors#1365](https://github.com/filecoin-project/specs-actors/pull/1365)) - - Revert "Remove cc upgrade (#1473)" (#1475) ([filecoin-project/specs-actors#1475](https://github.com/filecoin-project/specs-actors/pull/1475)) - - Remove cc upgrade (#1473) ([filecoin-project/specs-actors#1473](https://github.com/filecoin-project/specs-actors/pull/1473)) - - Update to v6 (#1468) ([filecoin-project/specs-actors#1468](https://github.com/filecoin-project/specs-actors/pull/1468)) - - go state types version revert (#1467) ([filecoin-project/specs-actors#1467](https://github.com/filecoin-project/specs-actors/pull/1467)) - - Adjust code for subtle change in go-multihash 0.0.15 (#1463) ([filecoin-project/specs-actors#1463](https://github.com/filecoin-project/specs-actors/pull/1463)) - - Bump go state types (#1464) ([filecoin-project/specs-actors#1464](https://github.com/filecoin-project/specs-actors/pull/1464)) - - Create CODEOWNERS (#1465) ([filecoin-project/specs-actors#1465](https://github.com/filecoin-project/specs-actors/pull/1465)) - - Test deterministic offset (#1462) ([filecoin-project/specs-actors#1462](https://github.com/filecoin-project/specs-actors/pull/1462) - Update go-libp2p to v0.15.0 ([filecoin-project/lotus#7362](https://github.com/filecoin-project/lotus/pull/7362)) ## Others @@ -76,34 +54,95 @@ This feature release includes latest functionality and improvements, like data t - sync branch main with master on updates ([filecoin-project/lotus#7366](https://github.com/filecoin-project/lotus/pull/7366)) - remove job to install jq ([filecoin-project/lotus#7309](https://github.com/filecoin-project/lotus/pull/7309)) - restore filters for the build-macos job ([filecoin-project/lotus#7309](https://github.com/filecoin-project/lotus/pull/7455)) + ## Contributors | Contributor | Commits | Lines ± | Files Changed | |-------------|---------|---------|---------------| -| ZenGround0 | 12 | +4202/-2752 | 187 | -| Aayush Rajasekaran | 28 | +5023/-1059 | 213 | -| c r | 4 | +1276/-435 | 37 | -| Claudia Richoux | 12 | +1350/-209 | 43 | -| Łukasz Magiera | 10 | +1214/-68 | 30 | | dirkmc | 8 | +845/-375 | 55 | +| Łukasz Magiera | 10 | +1056/-60 | 26 | | Aarsh Shah | 6 | +813/-259 | 16 | -| Peter Rabbitson | 5 | +498/-74 | 19 | +| Aayush Rajasekaran | 10 | +552/-251 | 43 | +| Peter Rabbitson | 6 | +505/-78 | 22 | +| Jennifer Wang | 6 | +197/-288 | 33 | | Anton Evangelatov | 10 | +335/-139 | 19 | | Mike Greenberg | 15 | +336/-67 | 26 | -| Jennifer Wang | 7 | +66/-206 | 26 | | Dirk McCormick | 8 | +149/-55 | 16 | -| Steven Allen | 2 | +115/-12 | 6 | -| hannahhoward | 3 | +53/-30 | 15 | -| Rod Vagg | 3 | +58/-10 | 7 | -| Jiaying Wang | 1 | +0/-56 | 1 | -| Travis Person | 3 | +33/-19 | 8 | +| hannahhoward | 4 | +56/-32 | 17 | +| Rod Vagg | 4 | +61/-13 | 9 | +| Jiaying Wang | 2 | +0/-57 | 2 | | Hannah Howard | 1 | +33/-18 | 7 | -| Jakub Sztandera | 3 | +22/-11 | 4 | +| Jakub Sztandera | 8 | +27/-16 | 9 | +| Cory Schwartz | 1 | +16/-2 | 2 | +| Travis Person | 1 | +14/-0 | 1 | +| frrist | 1 | +12/-0 | 2 | | ognots | 1 | +0/-10 | 2 | -| Steve Loeppky | 1 | +6/-0 | 1 | | Adrian Lanzafame | 1 | +3/-3 | 1 | +| jennijuju | 1 | +2/-2 | 1 | | swift-mx | 1 | +1/-1 | 1 | +# v1.12.0 / 2021-10-12 + +This is a mandatory release of Lotus that introduces [Filecoin Network v14](https://github.com/filecoin-project/community/discussions/74#discussioncomment-1398542), codenamed the Chocolate upgrade. The Filecoin mainnet will upgrade at epoch 1231620, on 2021-10-26T13:30:00Z. + +The Chocolate upgrade introduces the following FIPs, delivered in [v6 actors](https://github.com/filecoin-project/specs-actors/releases/tag/v6.0.0) + +- [FIP-0020](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0020.md): Add return value to `WithdrawBalance` +- [FIP-0021](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0021.md): Correct quality calculation on expiration +- [FIP-0022](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0022.md): Bad deals don't fail PublishStorageDeals +- [FIP-0023](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0023.md): Break ties between tipsets of equal weight +- [FIP-0024](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0024.md): BatchBalancer & BatchDiscount Post-HyperDrive Adjustment +- [FIP-0026](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0026.md): Extend sector faulty period from 2 weeks to 6 weeks + +Note that this release is built on top of lotus v1.11.3. Enterprising users like storage providers, data brokers and others are recommended to use lotus v1.13.0 for latest new features, improvements and bug fixes. + +## New Features and Changes +- Implement and support [FIP-0024](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0024.md) BatchBalancer & BatchDiscount Post-HyperDrive Adjustment: + - Precommit batch balancer support/config ([filecoin-project/lotus#7410](https://github.com/filecoin-project/lotus/pull/7410)) + - Set `BatchPreCommitAboveBaseFee` to decide whether sending out a PreCommits in individual messages or in a batch. + - The default value of `BatchPreCommitAboveBaseFee` and `AggregateAboveBaseFee` are now updated to 0.32nanoFIL. +- The amount of FIL withdrawn from `WithdrawBalance` from miner or market via lotus CLI is now printed out upon message landing on the chain. + +## Improvements +- Implement [FIP-0023](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0023.md) (Break ties between tipsets of equal weight) + - ChainStore: Add a tiebreaker rule for tipsets of equal weight ([filecoin-project/lotus#7378](https://github.com/filecoin-project/lotus/pull/7378)) +- Randomness: Move getters from ChainAPI to StateAPI ([filecoin-project/lotus#7322](https://github.com/filecoin-project/lotus/pull/7322)) + +## Bug Fixes +- Fix Drand fetching around null tipsets ([filecoin-project/lotus#7376](https://github.com/filecoin-project/lotus/pull/7376)) + +## Dependency Updates +- Add [v6 actors](https://github.com/filecoin-project/specs-actors/releases/tag/v6.0.0) + - **Protocol changes** + - Multisig Approve only hashes when hash in params + - FIP 0020 WithdrawBalance methods return withdrawn value + - FIP 0021 Fix bug in power calculation when extending verified deals sectors + - FIP 0022 PublishStorageDeals drops errors in batch + - FIP 0024 BatchBalancer update and burn added to PreCommitBatch + - FIP 0026 Add FaultMaxAge extension + - Reduce calls to power and reward actors by passing values from power cron + - Defensive programming hardening power cron against programmer error + - **Implementation changes** + - Move to xerrors + - Improved logging: burn events are not logged with reasons and burned value. +- github.com/filecoin-project/go-state-types (v0.1.1-0.20210810190654-139e0e79e69e -> v0.1.1-0.20210915140513-d354ccf10379): + +## Others +- v1.12.0-rc1 prep ([filecoin-project/lotus#7426](https://github.com/filecoin-project/lotus/pull/7426) +- Extend FaultMaxAge to 6 weeks for actors v6 on test networks only ([filecoin-project/lotus#7421](https://github.com/filecoin-project/lotus/pull/7421)) + +## Contributors +| @ZenGround0 | 12 | +4202/-2752 | 187 | +| @arajasek | 25 | +4567/-854 | 190 | +| @laudiacay | 4 | +1276/-435 | 37 | +| @laudiacay | 12 | +1350/-209 | 43 | +| @magik6k | 1 | +171/-13 | 8 | +| @Stebalien | 2 | +115/-12 | 6 | +| @jennijuju | 7 | +73/-34 | 26 | +| @travisperson | 2 | +19/-19 | 7 | +| @coryschwartz | 1 | +16/-2 | 2 | +| @Kubuxu | 5 | +5/-5 | 5 | +| @ribasushi | 1 | +5/-3 | 1 | # v1.11.3 / 2021-09-29 diff --git a/build/openrpc/full.json.gz b/build/openrpc/full.json.gz index d9615ebdba6..2a89c6d4af4 100644 Binary files a/build/openrpc/full.json.gz and b/build/openrpc/full.json.gz differ diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz index ef273a78d6e..7eb8c1df68c 100644 Binary files a/build/openrpc/miner.json.gz and b/build/openrpc/miner.json.gz differ diff --git a/build/openrpc/worker.json.gz b/build/openrpc/worker.json.gz index 9eef4715b92..9421e919107 100644 Binary files a/build/openrpc/worker.json.gz and b/build/openrpc/worker.json.gz differ diff --git a/build/params_2k.go b/build/params_2k.go index 485f7bec008..b9db0a46703 100644 --- a/build/params_2k.go +++ b/build/params_2k.go @@ -12,7 +12,6 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/chain/actors/policy" - miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner" ) const BootstrappersFile = "" @@ -92,8 +91,6 @@ func init() { BuildType |= Build2k - // To test out what this proposal would like on devnets / testnets: https://github.com/filecoin-project/FIPs/pull/190 - miner6.FaultMaxAge = miner6.WPoStProvingPeriod * 42 } const BlockDelaySecs = uint64(4) diff --git a/build/params_butterfly.go b/build/params_butterfly.go index 70d1cff9599..9a0018e73a2 100644 --- a/build/params_butterfly.go +++ b/build/params_butterfly.go @@ -9,7 +9,6 @@ import ( "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/chain/actors/policy" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner" "github.com/ipfs/go-cid" ) @@ -54,9 +53,6 @@ func init() { Devnet = true BuildType = BuildButterflynet - - // To test out what this proposal would like on devnets / testnets: https://github.com/filecoin-project/FIPs/pull/190 - miner6.FaultMaxAge = miner6.WPoStProvingPeriod * 42 } const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds) diff --git a/build/params_calibnet.go b/build/params_calibnet.go index be16d08b94b..8cd99d642cc 100644 --- a/build/params_calibnet.go +++ b/build/params_calibnet.go @@ -9,7 +9,6 @@ import ( "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/lotus/chain/actors/policy" builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner" "github.com/ipfs/go-cid" ) @@ -68,8 +67,6 @@ func init() { BuildType = BuildCalibnet - // To test out what this proposal would like on devnets / testnets: https://github.com/filecoin-project/FIPs/pull/190 - miner6.FaultMaxAge = miner6.WPoStProvingPeriod * 42 } const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds) diff --git a/build/params_interop.go b/build/params_interop.go index e928da8a0dc..de5ee9a12c8 100644 --- a/build/params_interop.go +++ b/build/params_interop.go @@ -12,10 +12,8 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/network" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/actors/policy" + builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" ) const BootstrappersFile = "interopnet.pi" @@ -99,8 +97,6 @@ func init() { SetAddressNetwork(address.Testnet) Devnet = true - // To test out what this proposal would like on devnets / testnets: https://github.com/filecoin-project/FIPs/pull/190 - miner6.FaultMaxAge = miner6.WPoStProvingPeriod * 42 } const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds) diff --git a/build/params_mainnet.go b/build/params_mainnet.go index e6b730335c8..0c8c53ba8cf 100644 --- a/build/params_mainnet.go +++ b/build/params_mainnet.go @@ -64,8 +64,8 @@ const UpgradeTurboHeight = 712320 // 2021-06-30T22:00:00Z var UpgradeHyperdriveHeight = abi.ChainEpoch(892800) -// ??? -var UpgradeChocolateHeight = abi.ChainEpoch(999999999) +// 2021-10-26T13:30:00Z +var UpgradeChocolateHeight = abi.ChainEpoch(1231620) func init() { if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" { diff --git a/build/params_nerpanet.go b/build/params_nerpanet.go new file mode 100644 index 00000000000..0e2913adcab --- /dev/null +++ b/build/params_nerpanet.go @@ -0,0 +1,87 @@ +//go:build nerpanet +// +build nerpanet + +package build + +import ( + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/network" + "github.com/filecoin-project/lotus/chain/actors/policy" + "github.com/ipfs/go-cid" + + builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" +) + +var DrandSchedule = map[abi.ChainEpoch]DrandEnum{ + 0: DrandMainnet, +} + +const GenesisNetworkVersion = network.Version0 + +const BootstrappersFile = "nerpanet.pi" +const GenesisFile = "nerpanet.car" + +const UpgradeBreezeHeight = -1 +const BreezeGasTampingDuration = 0 + +const UpgradeSmokeHeight = -1 + +const UpgradeIgnitionHeight = -2 +const UpgradeRefuelHeight = -3 + +const UpgradeLiftoffHeight = -5 + +const UpgradeAssemblyHeight = 30 // critical: the network can bootstrap from v1 only +const UpgradeTapeHeight = 60 + +const UpgradeKumquatHeight = 90 + +const UpgradeCalicoHeight = 100 +const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 1) + +const UpgradeClausHeight = 250 + +const UpgradeOrangeHeight = 300 + +const UpgradeTrustHeight = 600 +const UpgradeNorwegianHeight = 201000 +const UpgradeTurboHeight = 203000 +const UpgradeHyperdriveHeight = 379178 + +const UpgradeChocolateHeight = 999999999 + +func init() { + // Minimum block production power is set to 4 TiB + // Rationale is to discourage small-scale miners from trying to take over the network + // One needs to invest in ~2.3x the compute to break consensus, making it not worth it + // + // DOWNSIDE: the fake-seals need to be kept alive/protected, otherwise network will seize + // + policy.SetConsensusMinerMinPower(abi.NewStoragePower(4 << 40)) + + policy.SetSupportedProofTypes( + abi.RegisteredSealProof_StackedDrg512MiBV1, + abi.RegisteredSealProof_StackedDrg32GiBV1, + abi.RegisteredSealProof_StackedDrg64GiBV1, + ) + + // Lower the most time-consuming parts of PoRep + policy.SetPreCommitChallengeDelay(10) + + // TODO - make this a variable + //miner.WPoStChallengeLookback = abi.ChainEpoch(2) + + Devnet = false + + BuildType = BuildNerpanet + +} + +const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds) + +const PropagationDelaySecs = uint64(6) + +// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start +const BootstrapPeerThreshold = 4 + +var WhitelistedBlock = cid.Undef diff --git a/build/params_shared_vals.go b/build/params_shared_vals.go index 5b6197d9bd1..22d1c30e302 100644 --- a/build/params_shared_vals.go +++ b/build/params_shared_vals.go @@ -28,7 +28,7 @@ const UnixfsLinksPerLevel = 1024 const AllowableClockDriftSecs = uint64(1) // TODO: This is still terrible...What's the impact of updating this before mainnet actually upgrades -const NewestNetworkVersion = network.Version13 +const NewestNetworkVersion = network.Version14 // Epochs const ForkLengthThreshold = Finality diff --git a/build/version.go b/build/version.go index 160b3562033..86743f9131e 100644 --- a/build/version.go +++ b/build/version.go @@ -37,7 +37,7 @@ func BuildTypeString() string { } // BuildVersion is the local build version -const BuildVersion = "1.13.0-rc2" +const BuildVersion = "1.13.0-rc3" func UserVersion() string { if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" { diff --git a/chain/stmgr/stmgr.go b/chain/stmgr/stmgr.go index a3f17cd41e8..67c0bdb6a91 100644 --- a/chain/stmgr/stmgr.go +++ b/chain/stmgr/stmgr.go @@ -134,9 +134,6 @@ func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, }) lastVersion = upgrade.Network } - } else { - // Otherwise, go directly to the latest version. - lastVersion = build.NewestNetworkVersion } return &StateManager{ diff --git a/cli/wallet.go b/cli/wallet.go index f0f4e11f9ec..f7ad79e7795 100644 --- a/cli/wallet.go +++ b/cli/wallet.go @@ -10,6 +10,8 @@ import ( "os" "strings" + "github.com/filecoin-project/go-state-types/network" + "github.com/filecoin-project/lotus/build" "github.com/urfave/cli/v2" @@ -634,14 +636,21 @@ var walletMarketWithdraw = &cli.Command{ return err } - var withdrawn abi.TokenAmount - if err := withdrawn.UnmarshalCBOR(bytes.NewReader(wait.Receipt.Return)); err != nil { + nv, err := api.StateNetworkVersion(ctx, wait.TipSet) + if err != nil { return err } - fmt.Printf("Successfully withdrew %s FIL\n", withdrawn) - if withdrawn != amt { - fmt.Printf("Note that this is less than the requested amount of %s FIL\n", amt) + if nv >= network.Version14 { + var withdrawn abi.TokenAmount + if err := withdrawn.UnmarshalCBOR(bytes.NewReader(wait.Receipt.Return)); err != nil { + return err + } + + fmt.Printf("Successfully withdrew %s FIL\n", withdrawn) + if withdrawn.LessThan(amt) { + fmt.Printf("Note that this is less than the requested amount of %s FIL\n", amt) + } } return nil diff --git a/cmd/lotus-miner/actor.go b/cmd/lotus-miner/actor.go index 29c5a4bf43a..b71424d8fce 100644 --- a/cmd/lotus-miner/actor.go +++ b/cmd/lotus-miner/actor.go @@ -6,6 +6,8 @@ import ( "os" "strings" + "github.com/filecoin-project/go-state-types/network" + rlepluslazy "github.com/filecoin-project/go-bitfield/rle" cbor "github.com/ipfs/go-ipld-cbor" @@ -280,6 +282,7 @@ var actorWithdrawCmd = &cli.Command{ fmt.Printf("Requested rewards withdrawal in message %s\n", smsg.Cid()) // wait for it to get mined into a block + fmt.Printf("waiting for %d epochs for confirmation..\n", uint64(cctx.Int("confidence"))) wait, err := api.StateWaitMsg(ctx, smsg.Cid(), uint64(cctx.Int("confidence"))) if err != nil { return err @@ -291,14 +294,21 @@ var actorWithdrawCmd = &cli.Command{ return err } - var withdrawn abi.TokenAmount - if err := withdrawn.UnmarshalCBOR(bytes.NewReader(wait.Receipt.Return)); err != nil { + nv, err := api.StateNetworkVersion(ctx, wait.TipSet) + if err != nil { return err } - fmt.Printf("Successfully withdrew %s FIL\n", withdrawn) - if withdrawn != amount { - fmt.Printf("Note that this is less than the requested amount of %s FIL\n", amount) + if nv >= network.Version14 { + var withdrawn abi.TokenAmount + if err := withdrawn.UnmarshalCBOR(bytes.NewReader(wait.Receipt.Return)); err != nil { + return err + } + + fmt.Printf("Successfully withdrew %s FIL\n", withdrawn) + if withdrawn.LessThan(amount) { + fmt.Printf("Note that this is less than the requested amount of %s FIL\n", amount) + } } return nil diff --git a/cmd/lotus-shed/actor.go b/cmd/lotus-shed/actor.go index fd7410c24d1..822159bb4e4 100644 --- a/cmd/lotus-shed/actor.go +++ b/cmd/lotus-shed/actor.go @@ -5,6 +5,8 @@ import ( "fmt" "os" + "github.com/filecoin-project/go-state-types/network" + "github.com/fatih/color" "github.com/urfave/cli/v2" "golang.org/x/xerrors" @@ -138,14 +140,21 @@ var actorWithdrawCmd = &cli.Command{ return err } - var withdrawn abi.TokenAmount - if err := withdrawn.UnmarshalCBOR(bytes.NewReader(wait.Receipt.Return)); err != nil { + nv, err := nodeAPI.StateNetworkVersion(ctx, wait.TipSet) + if err != nil { return err } - fmt.Printf("Successfully withdrew %s FIL\n", withdrawn) - if withdrawn != amount { - fmt.Printf("Note that this is less than the requested amount of %s FIL\n", amount) + if nv >= network.Version14 { + var withdrawn abi.TokenAmount + if err := withdrawn.UnmarshalCBOR(bytes.NewReader(wait.Receipt.Return)); err != nil { + return err + } + + fmt.Printf("Successfully withdrew %s FIL\n", withdrawn) + if withdrawn.LessThan(amount) { + fmt.Printf("Note that this is less than the requested amount of %s FIL\n", amount) + } } return nil diff --git a/documentation/en/api-v0-methods.md b/documentation/en/api-v0-methods.md index f177c600878..4d953082116 100644 --- a/documentation/en/api-v0-methods.md +++ b/documentation/en/api-v0-methods.md @@ -4698,7 +4698,7 @@ Inputs: ] ``` -Response: `13` +Response: `14` ### StateReadState StateReadState returns the indicated actor's state. diff --git a/documentation/en/api-v1-unstable-methods.md b/documentation/en/api-v1-unstable-methods.md index 397ff3c6ff9..b03f75e9d05 100644 --- a/documentation/en/api-v1-unstable-methods.md +++ b/documentation/en/api-v1-unstable-methods.md @@ -4948,7 +4948,7 @@ Inputs: ] ``` -Response: `13` +Response: `14` ### StateReadState StateReadState returns the indicated actor's state. diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index 06f4cfcce87..61422814dbc 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -7,7 +7,7 @@ USAGE: lotus-miner [global options] command [command options] [arguments...] VERSION: - 1.13.0-rc2 + 1.13.0-rc3 COMMANDS: init Initialize a lotus miner repo diff --git a/documentation/en/cli-lotus-worker.md b/documentation/en/cli-lotus-worker.md index 11278e2fbe6..a7be8f60038 100644 --- a/documentation/en/cli-lotus-worker.md +++ b/documentation/en/cli-lotus-worker.md @@ -7,7 +7,7 @@ USAGE: lotus-worker [global options] command [command options] [arguments...] VERSION: - 1.13.0-rc2 + 1.13.0-rc3 COMMANDS: run Start lotus worker diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index 11bedc39656..57b5b50caa4 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -7,7 +7,7 @@ USAGE: lotus [global options] command [command options] [arguments...] VERSION: - 1.13.0-rc2 + 1.13.0-rc3 COMMANDS: daemon Start a lotus daemon process diff --git a/extern/storage-sealing/fsm.go b/extern/storage-sealing/fsm.go index 290aba53b25..00e38694dc4 100644 --- a/extern/storage-sealing/fsm.go +++ b/extern/storage-sealing/fsm.go @@ -135,7 +135,11 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto // Sealing errors - AddPieceFailed: planOne(), + AddPieceFailed: planOne( + on(SectorRetryWaitDeals{}, WaitDeals), + apply(SectorStartPacking{}), + apply(SectorAddPiece{}), + ), SealPreCommit1Failed: planOne( on(SectorRetrySealPreCommit1{}, PreCommit1), ), @@ -400,6 +404,8 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta return m.handleFinalizeSector, processed, nil // Handled failure modes + case AddPieceFailed: + return m.handleAddPieceFailed, processed, nil case SealPreCommit1Failed: return m.handleSealPrecommit1Failed, processed, nil case SealPreCommit2Failed: diff --git a/extern/storage-sealing/fsm_events.go b/extern/storage-sealing/fsm_events.go index 3dab6d40356..650a817995e 100644 --- a/extern/storage-sealing/fsm_events.go +++ b/extern/storage-sealing/fsm_events.go @@ -98,6 +98,10 @@ type SectorAddPieceFailed struct{ error } func (evt SectorAddPieceFailed) FormatError(xerrors.Printer) (next error) { return evt.error } func (evt SectorAddPieceFailed) apply(si *SectorInfo) {} +type SectorRetryWaitDeals struct{} + +func (evt SectorRetryWaitDeals) apply(si *SectorInfo) {} + type SectorStartPacking struct{} func (evt SectorStartPacking) apply(*SectorInfo) {} diff --git a/extern/storage-sealing/input.go b/extern/storage-sealing/input.go index 361907b2753..b69cf8c19ea 100644 --- a/extern/storage-sealing/input.go +++ b/extern/storage-sealing/input.go @@ -245,9 +245,7 @@ func (m *Sealing) handleAddPiece(ctx statemachine.Context, sector SectorInfo) er } func (m *Sealing) handleAddPieceFailed(ctx statemachine.Context, sector SectorInfo) error { - log.Errorf("No recovery plan for AddPiece failing") - // todo: cleanup sector / just go retry (requires adding offset param to AddPiece in sector-storage for this to be safe) - return nil + return ctx.Send(SectorRetryWaitDeals{}) } func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, data storage.Data, deal api.PieceDealInfo) (api.SectorOffset, error) { diff --git a/extern/storage-sealing/sector_state.go b/extern/storage-sealing/sector_state.go index 34a0c6bbef8..b606de5aeb5 100644 --- a/extern/storage-sealing/sector_state.go +++ b/extern/storage-sealing/sector_state.go @@ -108,7 +108,7 @@ const ( func toStatState(st SectorState, finEarly bool) statSectorState { switch st { - case UndefinedSectorState, Empty, WaitDeals, AddPiece: + case UndefinedSectorState, Empty, WaitDeals, AddPiece, AddPieceFailed: return sstStaging case Packing, GetTicket, PreCommit1, PreCommit2, PreCommitting, PreCommitWait, SubmitPreCommitBatch, PreCommitBatchWait, WaitSeed, Committing, CommitFinalize, FinalizeSector: return sstSealing diff --git a/go.mod b/go.mod index ddbfaf0bf09..79d78ab0770 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( github.com/filecoin-project/specs-actors/v3 v3.1.1 github.com/filecoin-project/specs-actors/v4 v4.0.1 github.com/filecoin-project/specs-actors/v5 v5.0.4 - github.com/filecoin-project/specs-actors/v6 v6.0.0-20211001193936-c3afe7fa3c5c + github.com/filecoin-project/specs-actors/v6 v6.0.0 github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506 github.com/filecoin-project/test-vectors/schema v0.0.5 github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1 @@ -103,7 +103,7 @@ require ( github.com/ipld/go-car/v2 v2.0.3-0.20210811121346-c514a30114d7 github.com/ipld/go-codec-dagpb v1.3.0 github.com/ipld/go-ipld-prime v0.12.3 - github.com/ipld/go-ipld-selector-text-lite v0.0.0-20210817134355-4c190a2bb825 + github.com/ipld/go-ipld-selector-text-lite v0.0.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/libp2p/go-buffer-pool v0.0.2 github.com/libp2p/go-eventbus v0.2.1 diff --git a/go.sum b/go.sum index 6a372e2e02b..ce5884bacf1 100644 --- a/go.sum +++ b/go.sum @@ -365,8 +365,8 @@ github.com/filecoin-project/specs-actors/v4 v4.0.1/go.mod h1:TkHXf/l7Wyw4ZejyXIP github.com/filecoin-project/specs-actors/v5 v5.0.0-20210512015452-4fe3889fff57/go.mod h1:283yBMMUSDB2abcjP/hhrwTkhb9h3sfM6KGrep/ZlBI= github.com/filecoin-project/specs-actors/v5 v5.0.4 h1:OY7BdxJWlUfUFXWV/kpNBYGXNPasDIedf42T3sGx08s= github.com/filecoin-project/specs-actors/v5 v5.0.4/go.mod h1:5BAKRAMsOOlD8+qCw4UvT/lTLInCJ3JwOWZbX8Ipwq4= -github.com/filecoin-project/specs-actors/v6 v6.0.0-20211001193936-c3afe7fa3c5c h1:29m9oz0AP3TglBFC9Sii9M3skIAbhZhZr+2FyomSTTo= -github.com/filecoin-project/specs-actors/v6 v6.0.0-20211001193936-c3afe7fa3c5c/go.mod h1:V1AYfi5GkHXipx1mnVivoICZh3wtwPxDVuds+fbfQtk= +github.com/filecoin-project/specs-actors/v6 v6.0.0 h1:i+16MFE8GScWWUF0kG7x2RZ5Hqpz0CeyBHTpnijCJ6I= +github.com/filecoin-project/specs-actors/v6 v6.0.0/go.mod h1:V1AYfi5GkHXipx1mnVivoICZh3wtwPxDVuds+fbfQtk= github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506 h1:Ur/l2+6qN+lQiqjozWWc5p9UDaAMDZKTlDS98oRnlIw= github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g= github.com/filecoin-project/test-vectors/schema v0.0.5 h1:w3zHQhzM4pYxJDl21avXjOKBLF8egrvwUwjpT8TquDg= @@ -827,8 +827,8 @@ github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1 github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs= github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6/go.mod h1:3pHYooM9Ea65jewRwrb2u5uHZCNkNTe9ABsVB+SrkH0= github.com/ipld/go-ipld-prime-proto v0.1.0/go.mod h1:11zp8f3sHVgIqtb/c9Kr5ZGqpnCLF1IVTNOez9TopzE= -github.com/ipld/go-ipld-selector-text-lite v0.0.0-20210817134355-4c190a2bb825 h1:sGlmVUuWEhuJpVsErFqCHWy9XTsIy511hZWRWI/Lc4I= -github.com/ipld/go-ipld-selector-text-lite v0.0.0-20210817134355-4c190a2bb825/go.mod h1:U2CQmFb+uWzfIEF3I1arrDa5rwtj00PrpiwwCO+k1RM= +github.com/ipld/go-ipld-selector-text-lite v0.0.0 h1:MLU1YUAgd3Z+RfVCXUbvxH1RQjEe+larJ9jmlW1aMgA= +github.com/ipld/go-ipld-selector-text-lite v0.0.0/go.mod h1:U2CQmFb+uWzfIEF3I1arrDa5rwtj00PrpiwwCO+k1RM= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 h1:QG4CGBqCeuBo6aZlGAamSkxWdgWfZGeE49eUOWJPA4c= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4= github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= diff --git a/node/builder.go b/node/builder.go index 6c42aad2d22..3f2e5950331 100644 --- a/node/builder.go +++ b/node/builder.go @@ -374,6 +374,13 @@ func WithRepoType(repoType repo.RepoType) func(s *Settings) error { } } +func WithEnableLibp2pNode(enable bool) func(s *Settings) error { + return func(s *Settings) error { + s.enableLibp2pNode = enable + return nil + } +} + func WithInvokesKey(i invoke, resApi interface{}) func(s *Settings) error { return func(s *Settings) error { s.invokes[i] = fx.Populate(resApi) diff --git a/node/impl/full/chain.go b/node/impl/full/chain.go index e8d4033372d..4ffbe0e6376 100644 --- a/node/impl/full/chain.go +++ b/node/impl/full/chain.go @@ -51,6 +51,7 @@ type ChainModuleAPI interface { ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) ChainGetTipSetAfterHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) ChainReadObj(context.Context, cid.Cid) ([]byte, error) + ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*api.HeadChange, error) } var _ ChainModuleAPI = *new(api.FullNode) @@ -105,6 +106,10 @@ func (m *ChainModule) ChainGetTipSet(ctx context.Context, key types.TipSetKey) ( return m.Chain.LoadTipSet(key) } +func (m *ChainModule) ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*api.HeadChange, error) { + return m.Chain.GetPath(ctx, from, to) +} + func (m *ChainModule) ChainGetBlockMessages(ctx context.Context, msg cid.Cid) (*api.BlockMessages, error) { b, err := m.Chain.GetBlock(msg) if err != nil {