Skip to content

Commit f6d4fc7

Browse files
fix(lotus-shed): improve termination-estimate CLI for delegated owner addresses (#12569)
- 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.
1 parent 54f68cb commit f6d4fc7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
## Bug Fixes
1212
- 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))
1313
- 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))
14+
- 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))
1415

1516
## Improvements
1617

cmd/lotus-shed/sectors.go

+13-1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,18 @@ var terminateSectorPenaltyEstimationCmd = &cli.Command{
124124
return err
125125
}
126126

127+
ownerAddr, err := nodeApi.StateAccountKey(ctx, mi.Owner, types.EmptyTSK)
128+
if err != nil {
129+
ownerAddr = mi.Owner
130+
}
131+
132+
var fromAddr address.Address
133+
if ownerAddr.Protocol() == address.Delegated {
134+
fromAddr = mi.Worker
135+
} else {
136+
fromAddr = mi.Owner
137+
}
138+
127139
terminationDeclarationParams := []miner2.TerminationDeclaration{}
128140

129141
for _, sn := range cctx.Args().Slice() {
@@ -159,7 +171,7 @@ var terminateSectorPenaltyEstimationCmd = &cli.Command{
159171
}
160172

161173
msg := &types.Message{
162-
From: mi.Owner,
174+
From: fromAddr,
163175
To: maddr,
164176
Method: builtin.MethodsMiner.TerminateSectors,
165177

0 commit comments

Comments
 (0)