Skip to content

Commit 1476fbb

Browse files
ZenGround0rjan90
authored andcommitted
fix(miner): fix scary verified power miscalculation upon extension (#12720)
* Fix scary verified power calculation * Update changelog --------- Co-authored-by: zenground0 <[email protected]>
1 parent c6e0637 commit 1476fbb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Lotus changelog
22

33
# UNRELEASED
4-
- Improve eth filter performance for nodes serving many clients. ([filecoin-project/lotus#12603](https://github.com/filecoin-project/lotus/pull/12603))
54

65
# Node and Miner v1.31.0-rc1 / 2024-11-12
76

@@ -16,6 +15,7 @@ This Lotus release candidate introduces the new `ChainIndexer` subsystem, enhanc
1615
- Implement `EthGetTransactionByBlockNumberAndIndex` (`eth_getTransactionByBlockNumberAndIndex`) and `EthGetTransactionByBlockHashAndIndex` (`eth_getTransactionByBlockHashAndIndex`) methods. ([filecoin-project/lotus#12618](https://github.com/filecoin-project/lotus/pull/12618))
1716
- `lotus-shed indexes inspect-indexes` now performs a comprehensive comparison of the event index data for each message by comparing the AMT root CID from the message receipt with the root of a reconstructed AMT. Previously `inspect-indexes` simply compared event counts. Comparing AMT roots instead confirms all the event data is byte-perfect. ([filecoin-project/lotus#12570](https://github.com/filecoin-project/lotus/pull/12570))
1817
- Reduce size of embedded genesis CAR files by removing WASM actor blocks and compressing with zstd. This reduces the `lotus` binary size by approximately 10 MiB. ([filecoin-project/lotus#12439](https://github.com/filecoin-project/lotus/pull/12439))
18+
- Improve ETH-filter performance for nodes serving many clients. ([filecoin-project/lotus#12603](https://github.com/filecoin-project/lotus/pull/12603))
1919
- Implement F3 utility CLIs to list the power table for a given instance and sum the proportional power of a set of actors that participate in a given instance. ([filecoin-project/lotus#12698](https://github.com/filecoin-project/lotus/pull/12698))
2020

2121
## 🐛 Bug Fix Highlights
@@ -25,6 +25,7 @@ This Lotus release candidate introduces the new `ChainIndexer` subsystem, enhanc
2525
- Make the ordering of event output for `eth_` APIs and `GetActorEventsRaw` consistent, sorting ascending on: epoch, message index, event index and original event entry order. ([filecoin-project/lotus#12623](https://github.com/filecoin-project/lotus/pull/12623))
2626
- 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))
2727
- 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))
28+
- Correct erroneous sector QAP-calculation upon sector extension in lotus-miner cli. ([filecoin-project/lotus#12698](https://github.com/filecoin-project/lotus/pull/12720))
2829

2930
## 📝 Changelog
3031

cmd/lotus-miner/sectors.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,11 @@ var sectorsListCmd = &cli.Command{
220220
if err != nil {
221221
return err
222222
}
223+
powerBaseEpochs := make(map[abi.SectorNumber]abi.ChainEpoch, len(sset))
223224
commitedIDs := make(map[abi.SectorNumber]struct{}, len(sset))
224225
for _, info := range sset {
225226
commitedIDs[info.SectorNumber] = struct{}{}
227+
powerBaseEpochs[info.SectorNumber] = info.PowerBaseEpoch
226228
}
227229

228230
sort.Slice(list, func(i, j int) bool {
@@ -290,7 +292,8 @@ var sectorsListCmd = &cli.Command{
290292
estimate := (st.Expiration-st.Activation <= 0) || sealing.IsUpgradeState(sealing.SectorState(st.State))
291293
if !estimate {
292294
rdw := big.Add(st.DealWeight, st.VerifiedDealWeight)
293-
dw = float64(big.Div(rdw, big.NewInt(int64(st.Expiration-st.Activation))).Uint64())
295+
powerBaseEpoch := powerBaseEpochs[st.SectorID]
296+
dw = float64(big.Div(rdw, big.NewInt(int64(st.Expiration-powerBaseEpoch))).Uint64())
294297
vp = float64(big.Div(big.Mul(st.VerifiedDealWeight, big.NewInt(verifiedPowerGainMul)), big.NewInt(int64(st.Expiration-st.Activation))).Uint64())
295298
} else {
296299
for _, piece := range st.Pieces {

0 commit comments

Comments
 (0)