Skip to content

Commit

Permalink
Merge pull request #11566 from filecoin-project/asr/update-miner-gst
Browse files Browse the repository at this point in the history
fix: chain: use latest go-state-types types for miner UI
  • Loading branch information
arajasek authored Jan 22, 2024
2 parents e430d33 + 61cfb51 commit 8f73f15
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 46 deletions.
2 changes: 2 additions & 0 deletions api/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/builtin/v12/miner"
"github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/exitcode"
Expand Down Expand Up @@ -145,6 +146,7 @@ func init() {
allocationId := verifreg.AllocationId(0)
addExample(allocationId)
addExample(&allocationId)
addExample(miner.SectorOnChainInfoFlags(0))
addExample(map[verifreg.AllocationId]verifreg.Allocation{})
claimId := verifreg.ClaimId(0)
addExample(claimId)
Expand Down
21 changes: 11 additions & 10 deletions api/mocks/mock_full.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions api/v0api/v0mocks/mock_full.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/openrpc/full.json.gz
Binary file not shown.
Binary file modified build/openrpc/gateway.json.gz
Binary file not shown.
3 changes: 2 additions & 1 deletion chain/actors/builtin/miner/actor.go.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types"
miner12 "github.com/filecoin-project/go-state-types/builtin/v12/miner"
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/manifest"

Expand Down Expand Up @@ -152,7 +153,7 @@ type Partition interface {
UnprovenSectors() (bitfield.BitField, error)
}

type SectorOnChainInfo = minertypes.SectorOnChainInfo
type SectorOnChainInfo = miner12.SectorOnChainInfo

func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof, configWantSynthetic bool) (abi.RegisteredSealProof, error) {
// We added support for the new proofs in network version 7, and removed support for the old
Expand Down
3 changes: 2 additions & 1 deletion chain/actors/builtin/miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
miner12 "github.com/filecoin-project/go-state-types/builtin/v12/miner"
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/dline"
Expand Down Expand Up @@ -212,7 +213,7 @@ type Partition interface {
UnprovenSectors() (bitfield.BitField, error)
}

type SectorOnChainInfo = minertypes.SectorOnChainInfo
type SectorOnChainInfo = miner12.SectorOnChainInfo

func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof, configWantSynthetic bool) (abi.RegisteredSealProof, error) {
// We added support for the new proofs in network version 7, and removed support for the old
Expand Down
6 changes: 5 additions & 1 deletion chain/actors/builtin/miner/state.go.template
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,11 @@ func fromV{{.v}}SectorOnChainInfo(v{{.v}} miner{{.v}}.SectorOnChainInfo) SectorO
ExpectedStoragePledge: v{{.v}}.ExpectedStoragePledge,
{{if (ge .v 7)}}
SectorKeyCID: v{{.v}}.SectorKeyCID,
{{end}}
{{end}}
{{if (ge .v 12)}}
PowerBaseEpoch: v{{.v}}.PowerBaseEpoch,
ReplacedDayReward: v{{.v}}.ReplacedDayReward,
{{end}}
}
return info
}
Expand Down
3 changes: 3 additions & 0 deletions chain/actors/builtin/miner/v12.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions documentation/en/api-v0-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -5875,12 +5875,12 @@ Response:
"InitialPledge": "0",
"ExpectedDayReward": "0",
"ExpectedStoragePledge": "0",
"ReplacedSectorAge": 10101,
"PowerBaseEpoch": 10101,
"ReplacedDayReward": "0",
"SectorKeyCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"SimpleQAPower": true
"Flags": 0
}
]
```
Expand Down Expand Up @@ -6355,12 +6355,12 @@ Response:
"InitialPledge": "0",
"ExpectedDayReward": "0",
"ExpectedStoragePledge": "0",
"ReplacedSectorAge": 10101,
"PowerBaseEpoch": 10101,
"ReplacedDayReward": "0",
"SectorKeyCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"SimpleQAPower": true
"Flags": 0
}
]
```
Expand Down Expand Up @@ -6760,12 +6760,12 @@ Response:
"InitialPledge": "0",
"ExpectedDayReward": "0",
"ExpectedStoragePledge": "0",
"ReplacedSectorAge": 10101,
"PowerBaseEpoch": 10101,
"ReplacedDayReward": "0",
"SectorKeyCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"SimpleQAPower": true
"Flags": 0
}
```

Expand Down
12 changes: 6 additions & 6 deletions documentation/en/api-v1-unstable-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -7473,12 +7473,12 @@ Response:
"InitialPledge": "0",
"ExpectedDayReward": "0",
"ExpectedStoragePledge": "0",
"ReplacedSectorAge": 10101,
"PowerBaseEpoch": 10101,
"ReplacedDayReward": "0",
"SectorKeyCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"SimpleQAPower": true
"Flags": 0
}
]
```
Expand Down Expand Up @@ -7981,12 +7981,12 @@ Response:
"InitialPledge": "0",
"ExpectedDayReward": "0",
"ExpectedStoragePledge": "0",
"ReplacedSectorAge": 10101,
"PowerBaseEpoch": 10101,
"ReplacedDayReward": "0",
"SectorKeyCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"SimpleQAPower": true
"Flags": 0
}
]
```
Expand Down Expand Up @@ -8340,12 +8340,12 @@ Response:
"InitialPledge": "0",
"ExpectedDayReward": "0",
"ExpectedStoragePledge": "0",
"ReplacedSectorAge": 10101,
"PowerBaseEpoch": 10101,
"ReplacedDayReward": "0",
"SectorKeyCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"SimpleQAPower": true
"Flags": 0
}
```

Expand Down
17 changes: 9 additions & 8 deletions storage/pipeline/mocks/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8f73f15

Please sign in to comment.