Merge branch 'release/v1.15.3' into jen/mergev1153to16

This commit is contained in:
Jennifer Wang
2022-05-31 16:33:18 -04:00
91 changed files with 1423 additions and 319 deletions
+46
View File
@@ -22,6 +22,7 @@ import (
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/dline"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
@@ -478,6 +479,15 @@ func (m *StateModule) StateLookupID(ctx context.Context, addr address.Address, t
return m.StateManager.LookupID(ctx, addr, ts)
}
func (a *StateAPI) StateLookupRobustAddress(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) {
ts, err := a.Chain.GetTipSetFromKey(ctx, tsk)
if err != nil {
return address.Undef, xerrors.Errorf("loading tipset %s: %w", tsk, err)
}
return a.StateManager.LookupRobustAddress(ctx, addr, ts)
}
func (m *StateModule) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) {
ts, err := m.Chain.GetTipSetFromKey(ctx, tsk)
if err != nil {
@@ -1477,3 +1487,39 @@ func (a *StateAPI) StateGetBeaconEntry(ctx context.Context, epoch abi.ChainEpoch
return nil, ctx.Err()
}
}
func (a *StateAPI) StateGetNetworkParams(ctx context.Context) (*api.NetworkParams, error) {
networkName, err := a.StateNetworkName(ctx)
if err != nil {
return nil, err
}
return &api.NetworkParams{
NetworkName: networkName,
BlockDelaySecs: build.BlockDelaySecs,
ConsensusMinerMinPower: build.ConsensusMinerMinPower,
SupportedProofTypes: build.SupportedProofTypes,
PreCommitChallengeDelay: build.PreCommitChallengeDelay,
ForkUpgradeParams: api.ForkUpgradeParams{
UpgradeSmokeHeight: build.UpgradeSmokeHeight,
UpgradeBreezeHeight: build.UpgradeBreezeHeight,
UpgradeIgnitionHeight: build.UpgradeIgnitionHeight,
UpgradeLiftoffHeight: build.UpgradeLiftoffHeight,
UpgradeAssemblyHeight: build.UpgradeAssemblyHeight,
UpgradeRefuelHeight: build.UpgradeRefuelHeight,
UpgradeTapeHeight: build.UpgradeTapeHeight,
UpgradeKumquatHeight: build.UpgradeKumquatHeight,
BreezeGasTampingDuration: build.BreezeGasTampingDuration,
UpgradeCalicoHeight: build.UpgradeCalicoHeight,
UpgradePersianHeight: build.UpgradePersianHeight,
UpgradeOrangeHeight: build.UpgradeOrangeHeight,
UpgradeClausHeight: build.UpgradeClausHeight,
UpgradeTrustHeight: build.UpgradeTrustHeight,
UpgradeNorwegianHeight: build.UpgradeNorwegianHeight,
UpgradeTurboHeight: build.UpgradeTurboHeight,
UpgradeHyperdriveHeight: build.UpgradeHyperdriveHeight,
UpgradeChocolateHeight: build.UpgradeChocolateHeight,
UpgradeOhSnapHeight: build.UpgradeOhSnapHeight,
},
}, nil
}
+4
View File
@@ -426,6 +426,10 @@ func (sm *StorageMinerAPI) ComputeWindowPoSt(ctx context.Context, dlIdx uint64,
return sm.WdPoSt.ComputePoSt(ctx, dlIdx, ts)
}
func (sm *StorageMinerAPI) ComputeDataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData sto.Data) (abi.PieceInfo, error) {
return sm.StorageMgr.DataCid(ctx, pieceSize, pieceData)
}
func (sm *StorageMinerAPI) WorkerConnect(ctx context.Context, url string) error {
w, err := connectRemoteWorker(ctx, sm, url)
if err != nil {