Skip to content

Commit b1376cf

Browse files
authored
feat(api)!: expose StateGetNetworkParams in Lotus Gateway API and remove SupportedProofTypes (#12881)
* refactor(api)!: remove SupportedProofTypes from StateGetNetworkParams Breaking change: The SupportedProofTypes field has been removed from StateGetNetworkParams. This field was unreliable as it didn't match the FVM's actual supported proofs and was frequently overlooked during proof type updates * feat: expose StateGetNetworkParams in Lotus Gateway API feat: expose StateGetNetworkParams in Lotus Gateway API * chore: update changelog chore: update changelog
1 parent 7e956b5 commit b1376cf

21 files changed

+714
-524
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
1010
# UNRELEASED
1111

12+
- Exposed `StateGetNetworkParams` in the Lotus Gateway API ([filecoin-project/lotus#12881](https://github.com/filecoin-project/lotus/pull/12881))
13+
- **BREAKING**: Removed `SupportedProofTypes` from `StateGetNetworkParams` response as it was unreliable and didn't match FVM's actual supported proofs ([filecoin-project/lotus#12881](https://github.com/filecoin-project/lotus/pull/12881))
1214
- refactor(eth): attach ToFilecoinMessage converter to EthCall method for improved package/module import structure. This change also exports the converter as a public method, enhancing usability for developers utilizing Lotus as a library. ([filecoin-project/lotus#12844](https://github.com/filecoin-project/lotus/pull/12844))
1315

1416
- chore: switch to pure-go zstd decoder for snapshot imports. ([filecoin-project/lotus#12857](https://github.com/filecoin-project/lotus/pull/12857))

api/api_gateway.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ type Gateway interface {
7272
StateGetAllocations(ctx context.Context, clientAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.AllocationId]verifregtypes.Allocation, error)
7373
StateGetClaim(ctx context.Context, providerAddr address.Address, claimId verifregtypes.ClaimId, tsk types.TipSetKey) (*verifregtypes.Claim, error)
7474
StateGetClaims(ctx context.Context, providerAddr address.Address, tsk types.TipSetKey) (map[verifregtypes.ClaimId]verifregtypes.Claim, error)
75+
StateGetNetworkParams(ctx context.Context) (*NetworkParams, error)
7576
StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*ActorState, error)
7677
StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
7778
StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)

api/proxy_gen.go

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ type NetworkParams struct {
157157
NetworkName dtypes.NetworkName
158158
BlockDelaySecs uint64
159159
ConsensusMinerMinPower abi.StoragePower
160-
SupportedProofTypes []abi.RegisteredSealProof
161160
PreCommitChallengeDelay abi.ChainEpoch
162161
ForkUpgradeParams ForkUpgradeParams
163162
Eip155ChainID int

build/buildconstants/params_2k.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
9393
0: DrandQuicknet,
9494
}
9595

96-
var SupportedProofTypes = []abi.RegisteredSealProof{
97-
abi.RegisteredSealProof_StackedDrg2KiBV1,
98-
abi.RegisteredSealProof_StackedDrg8MiBV1,
99-
}
10096
var ConsensusMinerMinPower = abi.NewStoragePower(2048)
10197
var PreCommitChallengeDelay = abi.ChainEpoch(10)
10298

build/buildconstants/params_butterfly.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ const UpgradeWatermelonFix2Height = -101
7575
// This fix upgrade only ran on calibrationnet
7676
const UpgradeCalibrationDragonFixHeight = -102
7777

78-
var SupportedProofTypes = []abi.RegisteredSealProof{
79-
abi.RegisteredSealProof_StackedDrg512MiBV1,
80-
abi.RegisteredSealProof_StackedDrg32GiBV1,
81-
abi.RegisteredSealProof_StackedDrg64GiBV1,
82-
}
8378
var ConsensusMinerMinPower = abi.NewStoragePower(2 << 30)
8479
var PreCommitChallengeDelay = abi.ChainEpoch(150)
8580

build/buildconstants/params_calibnet.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ const UpgradeTeepHeight = 9999999999
113113
// ramp behavior before mainnet upgrade.
114114
var UpgradeTuktukPowerRampDurationEpochs = uint64(builtin.EpochsInDay * 3)
115115

116-
var SupportedProofTypes = []abi.RegisteredSealProof{
117-
abi.RegisteredSealProof_StackedDrg32GiBV1,
118-
abi.RegisteredSealProof_StackedDrg64GiBV1,
119-
}
120116
var ConsensusMinerMinPower = abi.NewStoragePower(32 << 30)
121117
var PreCommitChallengeDelay = abi.ChainEpoch(150)
122118

build/buildconstants/params_interop.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
7777
0: DrandQuicknet,
7878
}
7979

80-
var SupportedProofTypes = []abi.RegisteredSealProof{
81-
abi.RegisteredSealProof_StackedDrg2KiBV1,
82-
abi.RegisteredSealProof_StackedDrg8MiBV1,
83-
abi.RegisteredSealProof_StackedDrg512MiBV1,
84-
}
8580
var ConsensusMinerMinPower = abi.NewStoragePower(2048)
8681
var PreCommitChallengeDelay = abi.ChainEpoch(10)
8782

build/buildconstants/params_mainnet.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ const UpgradeWatermelonFix2Height abi.ChainEpoch = -2
130130
// This fix upgrade only ran on calibrationnet
131131
const UpgradeCalibrationDragonFixHeight abi.ChainEpoch = -3
132132

133-
var SupportedProofTypes = []abi.RegisteredSealProof{
134-
abi.RegisteredSealProof_StackedDrg32GiBV1,
135-
abi.RegisteredSealProof_StackedDrg64GiBV1,
136-
}
137133
var ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)
138134
var PreCommitChallengeDelay = abi.ChainEpoch(150)
139135
var PropagationDelaySecs = uint64(10)

build/buildconstants/params_shared_vals.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
// Consensus / Network
2121

2222
func init() {
23-
policy.SetSupportedProofTypes(SupportedProofTypes...)
2423
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
2524
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
2625
}

0 commit comments

Comments
 (0)