Merge branch 'master' into mg/feat/configurable-sector-expirations
This commit is contained in:
@@ -17,7 +17,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/market"
|
||||
"github.com/filecoin-project/lotus/chain/messagepool"
|
||||
"github.com/filecoin-project/lotus/chain/messagesigner"
|
||||
"github.com/filecoin-project/lotus/chain/metrics"
|
||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||
rpcstmgr "github.com/filecoin-project/lotus/chain/stmgr/rpc"
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
@@ -174,10 +173,6 @@ func ConfigFullNode(c interface{}) Option {
|
||||
),
|
||||
Override(new(dtypes.Graphsync), modules.Graphsync(cfg.Client.SimultaneousTransfers)),
|
||||
|
||||
If(cfg.Metrics.HeadNotifs,
|
||||
Override(HeadMetricsKey, metrics.SendHeadNotifs(cfg.Metrics.Nickname)),
|
||||
),
|
||||
|
||||
If(cfg.Wallet.RemoteBackend != "",
|
||||
Override(new(*remotewallet.RemoteWallet), remotewallet.SetupRemoteWallet(cfg.Wallet.RemoteBackend)),
|
||||
),
|
||||
|
||||
@@ -74,6 +74,8 @@ func DefaultFullNode() *FullNode {
|
||||
ColdStoreType: "universal",
|
||||
HotStoreType: "badger",
|
||||
MarkSetType: "map",
|
||||
|
||||
HotStoreFullGCFrequency: 20,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
+16
-24
@@ -245,12 +245,6 @@ see https://docs.filecoin.io/mine/lotus/miner-configuration/#using-filters-for-f
|
||||
|
||||
Comment: ``,
|
||||
},
|
||||
{
|
||||
Name: "Metrics",
|
||||
Type: "Metrics",
|
||||
|
||||
Comment: ``,
|
||||
},
|
||||
{
|
||||
Name: "Wallet",
|
||||
Type: "Wallet",
|
||||
@@ -324,20 +318,6 @@ Format: multiaddress`,
|
||||
Comment: ``,
|
||||
},
|
||||
},
|
||||
"Metrics": []DocField{
|
||||
{
|
||||
Name: "Nickname",
|
||||
Type: "string",
|
||||
|
||||
Comment: ``,
|
||||
},
|
||||
{
|
||||
Name: "HeadNotifs",
|
||||
Type: "bool",
|
||||
|
||||
Comment: ``,
|
||||
},
|
||||
},
|
||||
"MinerAddressConfig": []DocField{
|
||||
{
|
||||
Name: "PreCommitControl",
|
||||
@@ -693,25 +673,37 @@ submitting proofs to the chain individually`,
|
||||
Name: "ColdStoreType",
|
||||
Type: "string",
|
||||
|
||||
Comment: ``,
|
||||
Comment: `ColdStoreType specifies the type of the coldstore.
|
||||
It can be "universal" (default) or "discard" for discarding cold blocks.`,
|
||||
},
|
||||
{
|
||||
Name: "HotStoreType",
|
||||
Type: "string",
|
||||
|
||||
Comment: ``,
|
||||
Comment: `HotStoreType specifies the type of the hotstore.
|
||||
Only currently supported value is "badger".`,
|
||||
},
|
||||
{
|
||||
Name: "MarkSetType",
|
||||
Type: "string",
|
||||
|
||||
Comment: ``,
|
||||
Comment: `MarkSetType specifies the type of the markset.
|
||||
It can be "map" (default) for in memory marking or "badger" for on-disk marking.`,
|
||||
},
|
||||
{
|
||||
Name: "HotStoreMessageRetention",
|
||||
Type: "uint64",
|
||||
|
||||
Comment: ``,
|
||||
Comment: `HotStoreMessageRetention specifies the retention policy for messages, in finalities beyond
|
||||
the compaction boundary; default is 0.`,
|
||||
},
|
||||
{
|
||||
Name: "HotStoreFullGCFrequency",
|
||||
Type: "uint64",
|
||||
|
||||
Comment: `HotStoreFullGCFrequency specifies how often to perform a full (moving) GC on the hotstore.
|
||||
A value of 0 disables, while a value 1 will do full GC in every compaction.
|
||||
Default is 20 (about once a week).`,
|
||||
},
|
||||
},
|
||||
"StorageMiner": []DocField{
|
||||
|
||||
+14
-9
@@ -23,7 +23,6 @@ type Common struct {
|
||||
type FullNode struct {
|
||||
Common
|
||||
Client Client
|
||||
Metrics Metrics
|
||||
Wallet Wallet
|
||||
Fees FeeConfig
|
||||
Chainstore Chainstore
|
||||
@@ -283,20 +282,26 @@ type Chainstore struct {
|
||||
}
|
||||
|
||||
type Splitstore struct {
|
||||
// ColdStoreType specifies the type of the coldstore.
|
||||
// It can be "universal" (default) or "discard" for discarding cold blocks.
|
||||
ColdStoreType string
|
||||
HotStoreType string
|
||||
MarkSetType string
|
||||
// HotStoreType specifies the type of the hotstore.
|
||||
// Only currently supported value is "badger".
|
||||
HotStoreType string
|
||||
// MarkSetType specifies the type of the markset.
|
||||
// It can be "map" (default) for in memory marking or "badger" for on-disk marking.
|
||||
MarkSetType string
|
||||
|
||||
// HotStoreMessageRetention specifies the retention policy for messages, in finalities beyond
|
||||
// the compaction boundary; default is 0.
|
||||
HotStoreMessageRetention uint64
|
||||
// HotStoreFullGCFrequency specifies how often to perform a full (moving) GC on the hotstore.
|
||||
// A value of 0 disables, while a value 1 will do full GC in every compaction.
|
||||
// Default is 20 (about once a week).
|
||||
HotStoreFullGCFrequency uint64
|
||||
}
|
||||
|
||||
// // Full Node
|
||||
|
||||
type Metrics struct {
|
||||
Nickname string
|
||||
HeadNotifs bool
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
UseIpfs bool
|
||||
IpfsOnlineMode bool
|
||||
|
||||
@@ -83,6 +83,9 @@ type ChainAPI struct {
|
||||
// expose externally. In the future, this will be segregated into two
|
||||
// blockstores.
|
||||
ExposedBlockstore dtypes.ExposedBlockstore
|
||||
|
||||
// BaseBlockstore is the underlying blockstore
|
||||
BaseBlockstore dtypes.BaseBlockstore
|
||||
}
|
||||
|
||||
func (m *ChainModule) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, error) {
|
||||
@@ -644,3 +647,21 @@ func (a *ChainAPI) ChainExport(ctx context.Context, nroots abi.ChainEpoch, skipo
|
||||
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (a *ChainAPI) ChainCheckBlockstore(ctx context.Context) error {
|
||||
checker, ok := a.BaseBlockstore.(interface{ Check() error })
|
||||
if !ok {
|
||||
return xerrors.Errorf("underlying blockstore does not support health checks")
|
||||
}
|
||||
|
||||
return checker.Check()
|
||||
}
|
||||
|
||||
func (a *ChainAPI) ChainBlockstoreInfo(ctx context.Context) (map[string]interface{}, error) {
|
||||
info, ok := a.BaseBlockstore.(interface{ Info() map[string]interface{} })
|
||||
if !ok {
|
||||
return nil, xerrors.Errorf("underlying blockstore does not provide info")
|
||||
}
|
||||
|
||||
return info.Info(), nil
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ func SplitBlockstore(cfg *config.Chainstore) func(lc fx.Lifecycle, r repo.Locked
|
||||
MarkSetType: cfg.Splitstore.MarkSetType,
|
||||
DiscardColdBlocks: cfg.Splitstore.ColdStoreType == "discard",
|
||||
HotStoreMessageRetention: cfg.Splitstore.HotStoreMessageRetention,
|
||||
HotStoreFullGCFrequency: cfg.Splitstore.HotStoreFullGCFrequency,
|
||||
}
|
||||
ss, err := splitstore.Open(path, ds, hot, cold, cfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -72,8 +72,8 @@ func MessagePool(lc fx.Lifecycle, mpp messagepool.Provider, ds dtypes.MetadataDS
|
||||
return mp, nil
|
||||
}
|
||||
|
||||
func ChainStore(lc fx.Lifecycle, cbs dtypes.ChainBlockstore, sbs dtypes.StateBlockstore, ds dtypes.MetadataDS, basebs dtypes.BaseBlockstore, syscalls vm.SyscallBuilder, j journal.Journal) *store.ChainStore {
|
||||
chain := store.NewChainStore(cbs, sbs, ds, syscalls, j)
|
||||
func ChainStore(lc fx.Lifecycle, cbs dtypes.ChainBlockstore, sbs dtypes.StateBlockstore, ds dtypes.MetadataDS, basebs dtypes.BaseBlockstore, j journal.Journal) *store.ChainStore {
|
||||
chain := store.NewChainStore(cbs, sbs, ds, j)
|
||||
|
||||
if err := chain.Load(); err != nil {
|
||||
log.Warnf("loading chain state from disk: %s", err)
|
||||
@@ -100,14 +100,14 @@ func ChainStore(lc fx.Lifecycle, cbs dtypes.ChainBlockstore, sbs dtypes.StateBlo
|
||||
return chain
|
||||
}
|
||||
|
||||
func NetworkName(mctx helpers.MetricsCtx, lc fx.Lifecycle, cs *store.ChainStore, us stmgr.UpgradeSchedule, _ dtypes.AfterGenesisSet) (dtypes.NetworkName, error) {
|
||||
func NetworkName(mctx helpers.MetricsCtx, lc fx.Lifecycle, cs *store.ChainStore, syscalls vm.SyscallBuilder, us stmgr.UpgradeSchedule, _ dtypes.AfterGenesisSet) (dtypes.NetworkName, error) {
|
||||
if !build.Devnet {
|
||||
return "testnetnet", nil
|
||||
}
|
||||
|
||||
ctx := helpers.LifecycleCtx(mctx, lc)
|
||||
|
||||
sm, err := stmgr.NewStateManagerWithUpgradeSchedule(cs, us)
|
||||
sm, err := stmgr.NewStateManagerWithUpgradeSchedule(cs, syscalls, us)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package modules
|
||||
|
||||
import (
|
||||
"github.com/filecoin-project/lotus/chain/vm"
|
||||
"go.uber.org/fx"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
)
|
||||
|
||||
func StateManager(lc fx.Lifecycle, cs *store.ChainStore, us stmgr.UpgradeSchedule) (*stmgr.StateManager, error) {
|
||||
sm, err := stmgr.NewStateManagerWithUpgradeSchedule(cs, us)
|
||||
func StateManager(lc fx.Lifecycle, cs *store.ChainStore, sys vm.SyscallBuilder, us stmgr.UpgradeSchedule) (*stmgr.StateManager, error) {
|
||||
sm, err := stmgr.NewStateManagerWithUpgradeSchedule(cs, sys, us)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user