From e28fcbc01f55a22eaacaca02938eb3ebfd1ab6da Mon Sep 17 00:00:00 2001 From: tediou5 Date: Thu, 30 Oct 2025 10:16:27 +0800 Subject: [PATCH 1/4] fix(cli): add to lotus-miner init --- cli/miner/init.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cli/miner/init.go b/cli/miner/init.go index 96ce7eb1971..cc951e045f0 100644 --- a/cli/miner/init.go +++ b/cli/miner/init.go @@ -126,6 +126,11 @@ var initCmd = &cli.Command{ Usage: "number of block confirmations to wait for", Value: buildconstants.MessageConfidence, }, + &cli.Float64Flag{ + Name: "deposit-margin-factor", + Usage: "Multiplier (>=1.0) to scale the suggested deposit for on-chain variance (e.g. 1.01 adds 1%)", + Value: 1.01, + }, }, Subcommands: []*cli.Command{ restoreCmd, @@ -739,16 +744,22 @@ func createStorageMiner(ctx context.Context, api v1api.FullNode, ssize abi.Secto return address.Undef, err } - // Calculate miner creation deposit according to FIP-0077 + depositMarginFactor := cctx.Float64("deposit-margin-factor") + if depositMarginFactor < 1 { + return address.Undef, xerrors.Errorf("deposit margin factor must be greater than 1") + } + deposit, err := api.StateMinerCreationDeposit(ctx, types.EmptyTSK) if err != nil { return address.Undef, xerrors.Errorf("getting miner creation deposit: %w", err) } + scaledDeposit := types.BigDiv(types.BigMul(deposit, types.NewInt(uint64(depositMarginFactor*100))), types.NewInt(100)) + createStorageMinerMsg := &types.Message{ To: power.Address, From: sender, - Value: deposit, + Value: scaledDeposit, Method: power.Methods.CreateMiner, Params: params, From 468ba9eab78e471c4f19715857947c6dddcb0513 Mon Sep 17 00:00:00 2001 From: tediou5 Date: Thu, 30 Oct 2025 10:22:30 +0800 Subject: [PATCH 2/4] chore: make docsgen-cli --- documentation/en/cli-lotus-miner.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index f12912a2a18..533cbf3c752 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -68,6 +68,7 @@ OPTIONS: --gas-premium value set gas premium for initialization messages in AttoFIL (default: "0") --from value select which address to send actor creation message from --confidence value number of block confirmations to wait for (default: 5) + --deposit-margin-factor value Multiplier (>=1.0) to scale the suggested deposit for on-chain variance (e.g. 1.01 adds 1%) (default: 1.01) --help, -h show help ``` From 13dcd2928d98138d976f85005670988e49266c02 Mon Sep 17 00:00:00 2001 From: tediou5 Date: Thu, 30 Oct 2025 10:37:16 +0800 Subject: [PATCH 3/4] chore: update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a274881e5f..3b1b9b76150 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - chore: update benchmark tests to use testing.B.Loop for improved performance ([filecoin-project/lotus#13385](https://github.com/filecoin-project/lotus/pull/13385)) ([filecoin-project/lotus#13396](https://github.com/filecoin-project/lotus/pull/13396)) - fix(eth): properly return vm error in all gas estimation methods ([filecoin-project/lotus#13389](https://github.com/filecoin-project/lotus/pull/13389)) - chore: all actor cmd support --actor ([filecoin-project/lotus#13391](https://github.com/filecoin-project/lotus/pull/13391)) +- feat(spcli): add a `deposit-margin-factor` option to `lotus-miner init` so the sent deposit still covers the on-chain requirement if it rises between lookup and execution # Node and Miner v1.34.1 / 2025-09-15 @@ -23,7 +24,7 @@ This is a non-critical patch release that fixes an issue with the Lotus `v1.34.0 # Node and Miner v1.34.0 / 2025-09-11 -This is a **MANDATORY Lotus v1.34.0 release**, which will deliver the Filecoin network version 27, codenamed “Golden Week” 🏮. This release candidate sets the upgrade epoch for the Mainnet network to **Epoch 5348280: 2025-09-24T23:00:00Z**. (See the [local time for other timezones](https://www.worldtimebuddy.com/?qm=1&lid=100,5128581,5368361,1816670&h=100&date=2025-9-24&sln=23-24&hf=1&c=1196).) +This is a **MANDATORY Lotus v1.34.0 release**, which will deliver the Filecoin network version 27, codenamed “Golden Week” 🏮. This release candidate sets the upgrade epoch for the Mainnet network to **Epoch 5348280: 2025-09-24T23:00:00Z**. (See the [local time for other timezones](https://www.worldtimebuddy.com/?qm=1&lid=100,5128581,5368361,1816670&h=100&date=2025-9-24&sln=23-24&hf=1&c=1196).) ## ☢️ Upgrade Warnings ☢️ - All Lotus node and Storage Provider (SP) operators must upgrade to v1.34.x before the specified date for the Mainnet network. From db5fc06fa080e1469bb2795337bcd950b416f802 Mon Sep 17 00:00:00 2001 From: tediou5 Date: Thu, 30 Oct 2025 13:47:04 +0800 Subject: [PATCH 4/4] chore: improve error message Co-authored-by: Rod Vagg --- cli/miner/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/miner/init.go b/cli/miner/init.go index cc951e045f0..79b3f333162 100644 --- a/cli/miner/init.go +++ b/cli/miner/init.go @@ -746,7 +746,7 @@ func createStorageMiner(ctx context.Context, api v1api.FullNode, ssize abi.Secto depositMarginFactor := cctx.Float64("deposit-margin-factor") if depositMarginFactor < 1 { - return address.Undef, xerrors.Errorf("deposit margin factor must be greater than 1") + return address.Undef, xerrors.Errorf("deposit margin factor must be greater than or equal to 1") } deposit, err := api.StateMinerCreationDeposit(ctx, types.EmptyTSK)