Merge branch 'master' into sbansal/nonce-coordination-and-consensus-for-chain-nodes
This commit is contained in:
@@ -3,6 +3,7 @@ package full
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
consensus "github.com/libp2p/go-libp2p-consensus"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"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"
|
||||
multisig2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/multisig"
|
||||
|
||||
@@ -29,7 +30,7 @@ func (a *MsigAPI) messageBuilder(ctx context.Context, from address.Address) (mul
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
av, err := actors.VersionForNetwork(nver)
|
||||
av, err := actorstypes.VersionForNetwork(nver)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
+17
-12
@@ -16,8 +16,9 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
"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"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/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/crypto"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
@@ -1185,16 +1186,20 @@ func (a *StateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr
|
||||
store := a.Chain.ActorStore(ctx)
|
||||
|
||||
var sectorWeight abi.StoragePower
|
||||
if act, err := state.GetActor(market.Address); err != nil {
|
||||
return types.EmptyInt, xerrors.Errorf("loading market actor %s: %w", maddr, err)
|
||||
} else if s, err := market.Load(store, act); err != nil {
|
||||
return types.EmptyInt, xerrors.Errorf("loading market actor state %s: %w", maddr, err)
|
||||
} else if w, vw, err := s.VerifyDealsForActivation(maddr, pci.DealIDs, ts.Height(), pci.Expiration); err != nil {
|
||||
return types.EmptyInt, xerrors.Errorf("verifying deals for activation: %w", err)
|
||||
if a.StateManager.GetNetworkVersion(ctx, ts.Height()) <= network.Version16 {
|
||||
if act, err := state.GetActor(market.Address); err != nil {
|
||||
return types.EmptyInt, xerrors.Errorf("loading market actor %s: %w", maddr, err)
|
||||
} else if s, err := market.Load(store, act); err != nil {
|
||||
return types.EmptyInt, xerrors.Errorf("loading market actor state %s: %w", maddr, err)
|
||||
} else if w, vw, err := s.VerifyDealsForActivation(maddr, pci.DealIDs, ts.Height(), pci.Expiration); err != nil {
|
||||
return types.EmptyInt, xerrors.Errorf("verifying deals for activation: %w", err)
|
||||
} else {
|
||||
// NB: not exactly accurate, but should always lead us to *over* estimate, not under
|
||||
duration := pci.Expiration - ts.Height()
|
||||
sectorWeight = builtin.QAPowerForWeight(ssize, duration, w, vw)
|
||||
}
|
||||
} else {
|
||||
// NB: not exactly accurate, but should always lead us to *over* estimate, not under
|
||||
duration := pci.Expiration - ts.Height()
|
||||
sectorWeight = builtin.QAPowerForWeight(ssize, duration, w, vw)
|
||||
sectorWeight = minertypes.QAPowerMax(ssize)
|
||||
}
|
||||
|
||||
var powerSmoothed builtin.FilterEstimate
|
||||
@@ -1536,7 +1541,7 @@ func (m *StateModule) StateNetworkVersion(ctx context.Context, tsk types.TipSetK
|
||||
}
|
||||
|
||||
func (a *StateAPI) StateActorCodeCIDs(ctx context.Context, nv network.Version) (map[string]cid.Cid, error) {
|
||||
actorVersion, err := actors.VersionForNetwork(nv)
|
||||
actorVersion, err := actorstypes.VersionForNetwork(nv)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("invalid network version %d: %w", nv, err)
|
||||
}
|
||||
@@ -1550,7 +1555,7 @@ func (a *StateAPI) StateActorCodeCIDs(ctx context.Context, nv network.Version) (
|
||||
}
|
||||
|
||||
func (a *StateAPI) StateActorManifestCID(ctx context.Context, nv network.Version) (cid.Cid, error) {
|
||||
actorVersion, err := actors.VersionForNetwork(nv)
|
||||
actorVersion, err := actorstypes.VersionForNetwork(nv)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("invalid network version")
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
builtintypes "github.com/filecoin-project/go-state-types/builtin"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
|
||||
Reference in New Issue
Block a user