From 66f5d69beb1709e774bb5d55f0ee1a6bd69a11d1 Mon Sep 17 00:00:00 2001 From: Danial Ahn Date: Thu, 10 Oct 2024 10:04:52 +0900 Subject: [PATCH 1/4] refactor(shed): improve termination-estimate CLI for delegated owner addresses - Add logic to check if the miner's owner address is delegated. - If it is delegated, the command now sends the termination state call using the worker ID. --- cmd/lotus-shed/sectors.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-shed/sectors.go b/cmd/lotus-shed/sectors.go index 6ca214cd2dc..fd49fbe35c4 100644 --- a/cmd/lotus-shed/sectors.go +++ b/cmd/lotus-shed/sectors.go @@ -124,6 +124,18 @@ var terminateSectorPenaltyEstimationCmd = &cli.Command{ return err } + ownerAddr, err := nodeApi.StateAccountKey(ctx, mi.Owner, types.EmptyTSK) + if err != nil { + ownerAddr = mi.Owner + } + + var fromAddr address.Address + if ownerAddr.Protocol() == address.Delegated { + fromAddr = mi.Worker + } else { + fromAddr = mi.Owner + } + terminationDeclarationParams := []miner2.TerminationDeclaration{} for _, sn := range cctx.Args().Slice() { @@ -159,7 +171,7 @@ var terminateSectorPenaltyEstimationCmd = &cli.Command{ } msg := &types.Message{ - From: mi.Owner, + From: fromAddr, To: maddr, Method: builtin.MethodsMiner.TerminateSectors, From 55b2af709b444c12c31c4b67ff6bedf171cf4199 Mon Sep 17 00:00:00 2001 From: Danial Ahn Date: Thu, 10 Oct 2024 11:31:45 +0900 Subject: [PATCH 2/4] docs: add CHNAGELOG.md - add detail description about the change --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ab7a81ef3d..dd45e66f993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ ## Bug Fixes - Fix a bug in the `lotus-shed indexes backfill-events` command that may result in either duplicate events being backfilled where there are existing events (such an operation *should* be idempotent) or events erroneously having duplicate `logIndex` values when queried via ETH APIs. ([filecoin-project/lotus#12567](https://github.com/filecoin-project/lotus/pull/12567)) +- Add logic to check if the miner's owner address is delegated(f4 address). If it is delegated, the `lotus-shed sectors termination-estimate` command now sends the termination state call using the worker ID. This fix resolves the issue where termination-estimate did not function correctly for miners with delegated owner addresses. ([filecoin-project/lotus#12569](https://github.com/filecoin-project/lotus/pull/12569)) + ## Deps From 109f7d4ee8c7fc42986f3fd94d00edca4a88d2c0 Mon Sep 17 00:00:00 2001 From: Danial Ahn Date: Sat, 12 Oct 2024 11:58:28 +0900 Subject: [PATCH 3/4] docs: add CHNAGELOG.md - merge master and resolve the conflicts --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fa4de71bda..e2bc468ad15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ## Bug Fixes - Fix a bug in the `lotus-shed indexes backfill-events` command that may result in either duplicate events being backfilled where there are existing events (such an operation *should* be idempotent) or events erroneously having duplicate `logIndex` values when queried via ETH APIs. ([filecoin-project/lotus#12567](https://github.com/filecoin-project/lotus/pull/12567)) - Event APIs (Eth events and actor events) should only return reverted events if client queries by specific block hash / tipset. Eth and actor event subscription APIs should always return reverted events to enable accurate observation of real-time changes. ([filecoin-project/lotus#12585](https://github.com/filecoin-project/lotus/pull/12585)) +- Add logic to check if the miner's owner address is delegated(f4 address). If it is delegated, the `lotus-shed sectors termination-estimate` command now sends the termination state call using the worker ID. This fix resolves the issue where termination-estimate did not function correctly for miners with delegated owner addresses. ([filecoin-project/lotus#12569](https://github.com/filecoin-project/lotus/pull/12569)) ## Improvements From 5b4b6cb762cc3fcc1c1757b600bd224e6f88d2d6 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Mon, 14 Oct 2024 14:10:58 +1100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2bc468ad15..47ecf7d0768 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ ## Bug Fixes - Fix a bug in the `lotus-shed indexes backfill-events` command that may result in either duplicate events being backfilled where there are existing events (such an operation *should* be idempotent) or events erroneously having duplicate `logIndex` values when queried via ETH APIs. ([filecoin-project/lotus#12567](https://github.com/filecoin-project/lotus/pull/12567)) - Event APIs (Eth events and actor events) should only return reverted events if client queries by specific block hash / tipset. Eth and actor event subscription APIs should always return reverted events to enable accurate observation of real-time changes. ([filecoin-project/lotus#12585](https://github.com/filecoin-project/lotus/pull/12585)) -- Add logic to check if the miner's owner address is delegated(f4 address). If it is delegated, the `lotus-shed sectors termination-estimate` command now sends the termination state call using the worker ID. This fix resolves the issue where termination-estimate did not function correctly for miners with delegated owner addresses. ([filecoin-project/lotus#12569](https://github.com/filecoin-project/lotus/pull/12569)) +- Add logic to check if the miner's owner address is delegated (f4 address). If it is delegated, the `lotus-shed sectors termination-estimate` command now sends the termination state call using the worker ID. This fix resolves the issue where termination-estimate did not function correctly for miners with delegated owner addresses. ([filecoin-project/lotus#12569](https://github.com/filecoin-project/lotus/pull/12569)) ## Improvements