Merge branch 'release/v1.20.0' into jen/resolveconflict
This commit is contained in:
commit
427fbdb8a9
@ -393,11 +393,9 @@ jobs:
|
|||||||
- run: go install golang.org/x/tools/cmd/goimports
|
- run: go install golang.org/x/tools/cmd/goimports
|
||||||
- run: go install github.com/hannahhoward/cbor-gen-for
|
- run: go install github.com/hannahhoward/cbor-gen-for
|
||||||
- run: make gen
|
- run: make gen
|
||||||
- run: git --no-pager diff
|
- run: git --no-pager diff && git --no-pager diff --quiet
|
||||||
- run: git --no-pager diff --quiet
|
|
||||||
- run: make docsgen-cli
|
- run: make docsgen-cli
|
||||||
- run: git --no-pager diff
|
- run: git --no-pager diff && git --no-pager diff --quiet
|
||||||
- run: git --no-pager diff --quiet
|
|
||||||
|
|
||||||
docs-check:
|
docs-check:
|
||||||
executor: golang
|
executor: golang
|
||||||
@ -412,11 +410,7 @@ jobs:
|
|||||||
- run: zcat build/openrpc/full.json.gz | jq > ../post-openrpc-full
|
- run: zcat build/openrpc/full.json.gz | jq > ../post-openrpc-full
|
||||||
- run: zcat build/openrpc/miner.json.gz | jq > ../post-openrpc-miner
|
- run: zcat build/openrpc/miner.json.gz | jq > ../post-openrpc-miner
|
||||||
- run: zcat build/openrpc/worker.json.gz | jq > ../post-openrpc-worker
|
- run: zcat build/openrpc/worker.json.gz | jq > ../post-openrpc-worker
|
||||||
- run: git --no-pager diff
|
- run: diff ../pre-openrpc-full ../post-openrpc-full && diff ../pre-openrpc-miner ../post-openrpc-miner && diff ../pre-openrpc-worker ../post-openrpc-worker && git --no-pager diff && git --no-pager diff --quiet
|
||||||
- run: diff ../pre-openrpc-full ../post-openrpc-full
|
|
||||||
- run: diff ../pre-openrpc-miner ../post-openrpc-miner
|
|
||||||
- run: diff ../pre-openrpc-worker ../post-openrpc-worker
|
|
||||||
- run: git --no-pager diff --quiet
|
|
||||||
|
|
||||||
lint: &lint
|
lint: &lint
|
||||||
description: |
|
description: |
|
||||||
|
@ -393,11 +393,9 @@ jobs:
|
|||||||
- run: go install golang.org/x/tools/cmd/goimports
|
- run: go install golang.org/x/tools/cmd/goimports
|
||||||
- run: go install github.com/hannahhoward/cbor-gen-for
|
- run: go install github.com/hannahhoward/cbor-gen-for
|
||||||
- run: make gen
|
- run: make gen
|
||||||
- run: git --no-pager diff
|
- run: git --no-pager diff && git --no-pager diff --quiet
|
||||||
- run: git --no-pager diff --quiet
|
|
||||||
- run: make docsgen-cli
|
- run: make docsgen-cli
|
||||||
- run: git --no-pager diff
|
- run: git --no-pager diff && git --no-pager diff --quiet
|
||||||
- run: git --no-pager diff --quiet
|
|
||||||
|
|
||||||
docs-check:
|
docs-check:
|
||||||
executor: golang
|
executor: golang
|
||||||
@ -412,11 +410,7 @@ jobs:
|
|||||||
- run: zcat build/openrpc/full.json.gz | jq > ../post-openrpc-full
|
- run: zcat build/openrpc/full.json.gz | jq > ../post-openrpc-full
|
||||||
- run: zcat build/openrpc/miner.json.gz | jq > ../post-openrpc-miner
|
- run: zcat build/openrpc/miner.json.gz | jq > ../post-openrpc-miner
|
||||||
- run: zcat build/openrpc/worker.json.gz | jq > ../post-openrpc-worker
|
- run: zcat build/openrpc/worker.json.gz | jq > ../post-openrpc-worker
|
||||||
- run: git --no-pager diff
|
- run: diff ../pre-openrpc-full ../post-openrpc-full && diff ../pre-openrpc-miner ../post-openrpc-miner && diff ../pre-openrpc-worker ../post-openrpc-worker && git --no-pager diff && git --no-pager diff --quiet
|
||||||
- run: diff ../pre-openrpc-full ../post-openrpc-full
|
|
||||||
- run: diff ../pre-openrpc-miner ../post-openrpc-miner
|
|
||||||
- run: diff ../pre-openrpc-worker ../post-openrpc-worker
|
|
||||||
- run: git --no-pager diff --quiet
|
|
||||||
|
|
||||||
lint: &lint
|
lint: &lint
|
||||||
description: |
|
description: |
|
||||||
|
@ -430,6 +430,9 @@ func (c *client) sendRequestToPeer(ctx context.Context, peer peer.ID, req *Reque
|
|||||||
}
|
}
|
||||||
_ = stream.SetWriteDeadline(time.Time{}) // clear deadline // FIXME: Needs
|
_ = stream.SetWriteDeadline(time.Time{}) // clear deadline // FIXME: Needs
|
||||||
// its own API (https://github.com/libp2p/go-libp2p/core/issues/162).
|
// its own API (https://github.com/libp2p/go-libp2p/core/issues/162).
|
||||||
|
if err := stream.CloseWrite(); err != nil {
|
||||||
|
log.Warnw("CloseWrite err", "error", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Read response.
|
// Read response.
|
||||||
var res Response
|
var res Response
|
||||||
|
@ -226,16 +226,6 @@ func (sm *StateManager) callInternal(ctx context.Context, msg *types.Message, pr
|
|||||||
Data: make([]byte, 65),
|
Data: make([]byte, 65),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
// XXX: Hack to make sending from f099 (and others) "just work".
|
|
||||||
// REMOVE ME.
|
|
||||||
msgApply = &types.SignedMessage{
|
|
||||||
Message: *msg,
|
|
||||||
Signature: crypto.Signature{
|
|
||||||
Type: crypto.SigTypeSecp256k1,
|
|
||||||
Data: make([]byte, 65),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret, err = vmi.ApplyMessage(ctx, msgApply)
|
ret, err = vmi.ApplyMessage(ctx, msgApply)
|
||||||
|
@ -206,14 +206,14 @@ func (x *FvmExtern) VerifyConsensusFault(ctx context.Context, a, b, extra []byte
|
|||||||
// check blocks are properly signed by their respective miner
|
// check blocks are properly signed by their respective miner
|
||||||
// note we do not need to check extra's: it is a parent to block b
|
// note we do not need to check extra's: it is a parent to block b
|
||||||
// which itself is signed, so it was willingly included by the miner
|
// which itself is signed, so it was willingly included by the miner
|
||||||
gasA, sigErr := x.VerifyBlockSig(ctx, &blockA)
|
gasA, sigErr := x.verifyBlockSig(ctx, &blockA)
|
||||||
totalGas += gasA
|
totalGas += gasA
|
||||||
if sigErr != nil {
|
if sigErr != nil {
|
||||||
log.Info("invalid consensus fault: cannot verify first block sig: %w", sigErr)
|
log.Info("invalid consensus fault: cannot verify first block sig: %w", sigErr)
|
||||||
return ret, totalGas
|
return ret, totalGas
|
||||||
}
|
}
|
||||||
|
|
||||||
gas2, sigErr := x.VerifyBlockSig(ctx, &blockB)
|
gas2, sigErr := x.verifyBlockSig(ctx, &blockB)
|
||||||
totalGas += gas2
|
totalGas += gas2
|
||||||
if sigErr != nil {
|
if sigErr != nil {
|
||||||
log.Info("invalid consensus fault: cannot verify second block sig: %w", sigErr)
|
log.Info("invalid consensus fault: cannot verify second block sig: %w", sigErr)
|
||||||
@ -226,7 +226,7 @@ func (x *FvmExtern) VerifyConsensusFault(ctx context.Context, a, b, extra []byte
|
|||||||
return ret, totalGas
|
return ret, totalGas
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *FvmExtern) VerifyBlockSig(ctx context.Context, blk *types.BlockHeader) (int64, error) {
|
func (x *FvmExtern) verifyBlockSig(ctx context.Context, blk *types.BlockHeader) (int64, error) {
|
||||||
waddr, gasUsed, err := x.workerKeyAtLookback(ctx, blk.Miner, blk.Height)
|
waddr, gasUsed, err := x.workerKeyAtLookback(ctx, blk.Miner, blk.Height)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return gasUsed, err
|
return gasUsed, err
|
||||||
|
@ -468,7 +468,7 @@ var sealBenchCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
bo.EnvVar = make(map[string]string)
|
bo.EnvVar = make(map[string]string)
|
||||||
for _, envKey := range []string{"BELLMAN_NO_GPU", "FIL_PROOFS_MAXIMIZE_CACHING", "FIL_PROOFS_USE_GPU_COLUMN_BUILDER",
|
for _, envKey := range []string{"BELLMAN_NO_GPU", "FIL_PROOFS_USE_GPU_COLUMN_BUILDER",
|
||||||
"FIL_PROOFS_USE_GPU_TREE_BUILDER", "FIL_PROOFS_USE_MULTICORE_SDR", "BELLMAN_CUSTOM_GPU"} {
|
"FIL_PROOFS_USE_GPU_TREE_BUILDER", "FIL_PROOFS_USE_MULTICORE_SDR", "BELLMAN_CUSTOM_GPU"} {
|
||||||
envValue, found := os.LookupEnv(envKey)
|
envValue, found := os.LookupEnv(envKey)
|
||||||
if found {
|
if found {
|
||||||
|
@ -813,6 +813,10 @@ var sectorsRenewCmd = &cli.Command{
|
|||||||
Usage: "use up to this amount of FIL for one message. pass this flag to avoid message congestion.",
|
Usage: "use up to this amount of FIL for one message. pass this flag to avoid message congestion.",
|
||||||
Value: "0",
|
Value: "0",
|
||||||
},
|
},
|
||||||
|
&cli.Int64Flag{
|
||||||
|
Name: "max-sectors",
|
||||||
|
Usage: "the maximum number of sectors contained in each message message",
|
||||||
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "really-do-it",
|
Name: "really-do-it",
|
||||||
Usage: "pass this flag to really renew sectors, otherwise will only print out json representation of parameters",
|
Usage: "pass this flag to really renew sectors, otherwise will only print out json representation of parameters",
|
||||||
@ -1020,10 +1024,20 @@ var sectorsRenewCmd = &cli.Command{
|
|||||||
for l, exts := range extensions {
|
for l, exts := range extensions {
|
||||||
for newExp, numbers := range exts {
|
for newExp, numbers := range exts {
|
||||||
scount += len(numbers)
|
scount += len(numbers)
|
||||||
addrSectors, err := policy.GetAddressedSectorsMax(nv)
|
var addrSectors int
|
||||||
|
sectorsMax, err := policy.GetAddressedSectorsMax(nv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if cctx.Int("max-sectors") == 0 {
|
||||||
|
addrSectors = sectorsMax
|
||||||
|
} else {
|
||||||
|
addrSectors = cctx.Int("max-sectors")
|
||||||
|
if addrSectors > sectorsMax {
|
||||||
|
return xerrors.Errorf("the specified max-sectors exceeds the maximum limit")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
declMax, err := policy.GetDeclarationsMax(nv)
|
declMax, err := policy.GetDeclarationsMax(nv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -51,7 +51,6 @@ func main() {
|
|||||||
exportChainCmd,
|
exportChainCmd,
|
||||||
exportCarCmd,
|
exportCarCmd,
|
||||||
consensusCmd,
|
consensusCmd,
|
||||||
storageStatsCmd,
|
|
||||||
syncCmd,
|
syncCmd,
|
||||||
stateTreePruneCmd,
|
stateTreePruneCmd,
|
||||||
datastoreCmd,
|
datastoreCmd,
|
||||||
|
@ -1,199 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
corebig "math/big"
|
|
||||||
"os"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"github.com/ipfs/go-cid"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
|
||||||
filbig "github.com/filecoin-project/go-state-types/big"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
|
||||||
lcli "github.com/filecoin-project/lotus/cli"
|
|
||||||
)
|
|
||||||
|
|
||||||
// How many epochs back to look at for dealstats
|
|
||||||
var defaultEpochLookback = abi.ChainEpoch(10)
|
|
||||||
|
|
||||||
type networkTotalsOutput struct {
|
|
||||||
Epoch int64 `json:"epoch"`
|
|
||||||
Endpoint string `json:"endpoint"`
|
|
||||||
Payload networkTotals `json:"payload"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type providerMeta struct {
|
|
||||||
nonidentifiable bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// force formatting as decimal to aid human readers
|
|
||||||
type humanFloat float64
|
|
||||||
|
|
||||||
func (f humanFloat) MarshalJSON() ([]byte, error) {
|
|
||||||
// 'f' uses decimal digits without exponents.
|
|
||||||
// The bit size of 32 ensures we don't use too many decimal places.
|
|
||||||
return []byte(strconv.FormatFloat(float64(f), 'f', -1, 32)), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type Totals struct {
|
|
||||||
TotalDeals int `json:"total_num_deals"`
|
|
||||||
TotalBytes int64 `json:"total_stored_data_size"`
|
|
||||||
PrivateTotalDeals int `json:"private_total_num_deals"`
|
|
||||||
PrivateTotalBytes int64 `json:"private_total_stored_data_size"`
|
|
||||||
CapacityCarryingData humanFloat `json:"capacity_fraction_carrying_data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type networkTotals struct {
|
|
||||||
QaNetworkPower filbig.Int `json:"total_qa_power"`
|
|
||||||
RawNetworkPower filbig.Int `json:"total_raw_capacity"`
|
|
||||||
UniqueCids int `json:"total_unique_cids"`
|
|
||||||
UniqueBytes int64 `json:"total_unique_data_size"`
|
|
||||||
UniqueClients int `json:"total_unique_clients"`
|
|
||||||
UniqueProviders int `json:"total_unique_providers"`
|
|
||||||
UniquePrivateProviders int `json:"total_unique_private_providers"`
|
|
||||||
Totals
|
|
||||||
FilPlus Totals `json:"filecoin_plus_subset"`
|
|
||||||
|
|
||||||
pieces map[cid.Cid]struct{}
|
|
||||||
clients map[address.Address]struct{}
|
|
||||||
providers map[address.Address]providerMeta
|
|
||||||
}
|
|
||||||
|
|
||||||
var storageStatsCmd = &cli.Command{
|
|
||||||
Name: "storage-stats",
|
|
||||||
Usage: "Translates current lotus state into a json summary suitable for driving https://storage.filecoin.io/",
|
|
||||||
Flags: []cli.Flag{
|
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "tipset",
|
|
||||||
Usage: "Comma separated array of cids, or @height",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Action: func(cctx *cli.Context) error {
|
|
||||||
ctx := lcli.ReqContext(cctx)
|
|
||||||
|
|
||||||
api, apiCloser, err := lcli.GetFullNodeAPI(cctx)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer apiCloser()
|
|
||||||
|
|
||||||
var ts *types.TipSet
|
|
||||||
if cctx.String("tipset") == "" {
|
|
||||||
ts, err = api.ChainHead(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
ts, err = api.ChainGetTipSetByHeight(ctx, ts.Height()-defaultEpochLookback, ts.Key())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ts, err = lcli.ParseTipSetRef(ctx, api, cctx.String("tipset"))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
power, err := api.StateMinerPower(ctx, address.Address{}, ts.Key())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
netTotals := networkTotals{
|
|
||||||
QaNetworkPower: power.TotalPower.QualityAdjPower,
|
|
||||||
RawNetworkPower: power.TotalPower.RawBytePower,
|
|
||||||
pieces: make(map[cid.Cid]struct{}),
|
|
||||||
clients: make(map[address.Address]struct{}),
|
|
||||||
providers: make(map[address.Address]providerMeta),
|
|
||||||
}
|
|
||||||
|
|
||||||
deals, err := api.StateMarketDeals(ctx, ts.Key())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, dealInfo := range deals {
|
|
||||||
|
|
||||||
// Only count deals that have properly started, not past/future ones
|
|
||||||
// https://github.com/filecoin-project/specs-actors/blob/v0.9.9/actors/builtin/market/deal.go#L81-L85
|
|
||||||
// Bail on 0 as well in case SectorStartEpoch is uninitialized due to some bug
|
|
||||||
//
|
|
||||||
// Additionally if the SlashEpoch is set this means the underlying sector is
|
|
||||||
// terminated for whatever reason ( not just slashed ), and the deal record
|
|
||||||
// will soon be removed from the state entirely
|
|
||||||
if dealInfo.State.SectorStartEpoch <= 0 ||
|
|
||||||
dealInfo.State.SectorStartEpoch > ts.Height() ||
|
|
||||||
dealInfo.State.SlashEpoch > -1 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
netTotals.clients[dealInfo.Proposal.Client] = struct{}{}
|
|
||||||
|
|
||||||
if _, seen := netTotals.providers[dealInfo.Proposal.Provider]; !seen {
|
|
||||||
pm := providerMeta{}
|
|
||||||
|
|
||||||
mi, err := api.StateMinerInfo(ctx, dealInfo.Proposal.Provider, ts.Key())
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if mi.PeerId == nil || *mi.PeerId == "" {
|
|
||||||
log.Infof("private provider %s", dealInfo.Proposal.Provider)
|
|
||||||
pm.nonidentifiable = true
|
|
||||||
netTotals.UniquePrivateProviders++
|
|
||||||
}
|
|
||||||
|
|
||||||
netTotals.providers[dealInfo.Proposal.Provider] = pm
|
|
||||||
netTotals.UniqueProviders++
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, seen := netTotals.pieces[dealInfo.Proposal.PieceCID]; !seen {
|
|
||||||
netTotals.pieces[dealInfo.Proposal.PieceCID] = struct{}{}
|
|
||||||
netTotals.UniqueBytes += int64(dealInfo.Proposal.PieceSize)
|
|
||||||
netTotals.UniqueCids++
|
|
||||||
}
|
|
||||||
|
|
||||||
netTotals.TotalBytes += int64(dealInfo.Proposal.PieceSize)
|
|
||||||
netTotals.TotalDeals++
|
|
||||||
if netTotals.providers[dealInfo.Proposal.Provider].nonidentifiable {
|
|
||||||
netTotals.PrivateTotalBytes += int64(dealInfo.Proposal.PieceSize)
|
|
||||||
netTotals.PrivateTotalDeals++
|
|
||||||
}
|
|
||||||
|
|
||||||
if dealInfo.Proposal.VerifiedDeal {
|
|
||||||
netTotals.FilPlus.TotalBytes += int64(dealInfo.Proposal.PieceSize)
|
|
||||||
netTotals.FilPlus.TotalDeals++
|
|
||||||
if netTotals.providers[dealInfo.Proposal.Provider].nonidentifiable {
|
|
||||||
netTotals.FilPlus.PrivateTotalBytes += int64(dealInfo.Proposal.PieceSize)
|
|
||||||
netTotals.FilPlus.PrivateTotalDeals++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
netTotals.UniqueClients = len(netTotals.clients)
|
|
||||||
|
|
||||||
ccd, _ := new(corebig.Rat).SetFrac(
|
|
||||||
corebig.NewInt(netTotals.TotalBytes),
|
|
||||||
netTotals.RawNetworkPower.Int,
|
|
||||||
).Float64()
|
|
||||||
netTotals.CapacityCarryingData = humanFloat(ccd)
|
|
||||||
|
|
||||||
ccdfp, _ := new(corebig.Rat).SetFrac(
|
|
||||||
corebig.NewInt(netTotals.FilPlus.TotalBytes),
|
|
||||||
netTotals.RawNetworkPower.Int,
|
|
||||||
).Float64()
|
|
||||||
netTotals.FilPlus.CapacityCarryingData = humanFloat(ccdfp)
|
|
||||||
|
|
||||||
return json.NewEncoder(os.Stdout).Encode(
|
|
||||||
networkTotalsOutput{
|
|
||||||
Epoch: int64(ts.Height()),
|
|
||||||
Endpoint: "NETWORK_WIDE_TOTALS",
|
|
||||||
Payload: netTotals,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
},
|
|
||||||
}
|
|
@ -1897,6 +1897,7 @@ OPTIONS:
|
|||||||
--extension value try to extend selected sectors by this number of epochs, defaults to 540 days (default: 1555200)
|
--extension value try to extend selected sectors by this number of epochs, defaults to 540 days (default: 1555200)
|
||||||
--from value only consider sectors whose current expiration epoch is in the range of [from, to], <from> defaults to: now + 120 (1 hour) (default: 0)
|
--from value only consider sectors whose current expiration epoch is in the range of [from, to], <from> defaults to: now + 120 (1 hour) (default: 0)
|
||||||
--max-fee value use up to this amount of FIL for one message. pass this flag to avoid message congestion. (default: "0")
|
--max-fee value use up to this amount of FIL for one message. pass this flag to avoid message congestion. (default: "0")
|
||||||
|
--max-sectors value the maximum number of sectors contained in each message message (default: 0)
|
||||||
--new-expiration value try to extend selected sectors to this epoch, ignoring extension (default: 0)
|
--new-expiration value try to extend selected sectors to this epoch, ignoring extension (default: 0)
|
||||||
--only-cc only extend CC sectors (useful for making sector ready for snap upgrade) (default: false)
|
--only-cc only extend CC sectors (useful for making sector ready for snap upgrade) (default: false)
|
||||||
--really-do-it pass this flag to really renew sectors, otherwise will only print out json representation of parameters (default: false)
|
--really-do-it pass this flag to really renew sectors, otherwise will only print out json representation of parameters (default: false)
|
||||||
|
@ -259,7 +259,6 @@ func ConfigFullNode(c interface{}) Option {
|
|||||||
|
|
||||||
// Actor event filtering support
|
// Actor event filtering support
|
||||||
Override(new(events.EventAPI), From(new(modules.EventAPI))),
|
Override(new(events.EventAPI), From(new(modules.EventAPI))),
|
||||||
|
|
||||||
// in lite-mode Eth event api is provided by gateway
|
// in lite-mode Eth event api is provided by gateway
|
||||||
ApplyIf(isFullNode, Override(new(full.EthEventAPI), modules.EthEventAPI(cfg.ActorEvent))),
|
ApplyIf(isFullNode, Override(new(full.EthEventAPI), modules.EthEventAPI(cfg.ActorEvent))),
|
||||||
)
|
)
|
||||||
|
@ -158,6 +158,9 @@ func (hs *Service) SayHello(ctx context.Context, pid peer.ID) error {
|
|||||||
if err := cborutil.WriteCborRPC(s, hmsg); err != nil {
|
if err := cborutil.WriteCborRPC(s, hmsg); err != nil {
|
||||||
return xerrors.Errorf("writing rpc to peer: %w", err)
|
return xerrors.Errorf("writing rpc to peer: %w", err)
|
||||||
}
|
}
|
||||||
|
if err := s.CloseWrite(); err != nil {
|
||||||
|
log.Warnw("CloseWrite err", "error", err)
|
||||||
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer s.Close() //nolint:errcheck
|
defer s.Close() //nolint:errcheck
|
||||||
|
109
node/impl/full/dummy.go
Normal file
109
node/impl/full/dummy.go
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
package full
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/lotus/api"
|
||||||
|
"github.com/filecoin-project/lotus/chain/types/ethtypes"
|
||||||
|
)
|
||||||
|
|
||||||
|
var ErrImplementMe = errors.New("Not implemented yet")
|
||||||
|
|
||||||
|
type EthModuleDummy struct{}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error) {
|
||||||
|
return 0, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthAccounts(ctx context.Context) ([]ethtypes.EthAddress, error) {
|
||||||
|
return nil, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetBlockTransactionCountByNumber(ctx context.Context, blkNum ethtypes.EthUint64) (ethtypes.EthUint64, error) {
|
||||||
|
return 0, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetBlockTransactionCountByHash(ctx context.Context, blkHash ethtypes.EthHash) (ethtypes.EthUint64, error) {
|
||||||
|
return 0, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthHash, fullTxInfo bool) (ethtypes.EthBlock, error) {
|
||||||
|
return ethtypes.EthBlock{}, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetBlockByNumber(ctx context.Context, blkNum string, fullTxInfo bool) (ethtypes.EthBlock, error) {
|
||||||
|
return ethtypes.EthBlock{}, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error) {
|
||||||
|
return nil, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetTransactionCount(ctx context.Context, sender ethtypes.EthAddress, blkOpt string) (ethtypes.EthUint64, error) {
|
||||||
|
return 0, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*api.EthTxReceipt, error) {
|
||||||
|
return nil, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) {
|
||||||
|
return ethtypes.EthTx{}, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) {
|
||||||
|
return ethtypes.EthTx{}, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetCode(ctx context.Context, address ethtypes.EthAddress, blkOpt string) (ethtypes.EthBytes, error) {
|
||||||
|
return nil, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetStorageAt(ctx context.Context, address ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error) {
|
||||||
|
return nil, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGetBalance(ctx context.Context, address ethtypes.EthAddress, blkParam string) (ethtypes.EthBigInt, error) {
|
||||||
|
return ethtypes.EthBigIntZero, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthFeeHistory(ctx context.Context, blkCount ethtypes.EthUint64, newestBlk string, rewardPercentiles []float64) (ethtypes.EthFeeHistory, error) {
|
||||||
|
return ethtypes.EthFeeHistory{}, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthChainId(ctx context.Context) (ethtypes.EthUint64, error) {
|
||||||
|
return 0, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) NetVersion(ctx context.Context) (string, error) {
|
||||||
|
return "", ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) NetListening(ctx context.Context) (bool, error) {
|
||||||
|
return false, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthProtocolVersion(ctx context.Context) (ethtypes.EthUint64, error) {
|
||||||
|
return 0, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthGasPrice(ctx context.Context) (ethtypes.EthBigInt, error) {
|
||||||
|
return ethtypes.EthBigIntZero, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthEstimateGas(ctx context.Context, tx ethtypes.EthCall) (ethtypes.EthUint64, error) {
|
||||||
|
return 0, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthCall(ctx context.Context, tx ethtypes.EthCall, blkParam string) (ethtypes.EthBytes, error) {
|
||||||
|
return nil, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthMaxPriorityFeePerGas(ctx context.Context) (ethtypes.EthBigInt, error) {
|
||||||
|
return ethtypes.EthBigIntZero, ErrImplementMe
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *EthModuleDummy) EthSendRawTransaction(ctx context.Context, rawTx ethtypes.EthBytes) (ethtypes.EthHash, error) {
|
||||||
|
return ethtypes.EthHash{}, ErrImplementMe
|
||||||
|
}
|
@ -107,7 +107,6 @@ func FullNodeHandler(a v1api.FullNode, permissioned bool, opts ...jsonrpc.Server
|
|||||||
Next: handleImportFunc,
|
Next: handleImportFunc,
|
||||||
}
|
}
|
||||||
m.Handle("/rest/v0/import", importAH)
|
m.Handle("/rest/v0/import", importAH)
|
||||||
|
|
||||||
exportAH := &auth.Handler{
|
exportAH := &auth.Handler{
|
||||||
Verify: a.AuthVerify,
|
Verify: a.AuthVerify,
|
||||||
Next: handleExportFunc,
|
Next: handleExportFunc,
|
||||||
|
@ -36,7 +36,7 @@ parts:
|
|||||||
- libhwloc15
|
- libhwloc15
|
||||||
- ocl-icd-libopencl1
|
- ocl-icd-libopencl1
|
||||||
override-build: |
|
override-build: |
|
||||||
LDFLAGS="-z noexecstack" make lotus lotus-miner lotus-worker
|
LDFLAGS="" make lotus lotus-miner lotus-worker
|
||||||
cp lotus lotus-miner lotus-worker $SNAPCRAFT_PART_INSTALL
|
cp lotus lotus-miner lotus-worker $SNAPCRAFT_PART_INSTALL
|
||||||
cp scripts/snap-lotus-entrypoint.sh $SNAPCRAFT_PART_INSTALL
|
cp scripts/snap-lotus-entrypoint.sh $SNAPCRAFT_PART_INSTALL
|
||||||
|
|
||||||
|
@ -21,16 +21,15 @@ Please report your issues with regards to sector-storage at the [lotus issue tra
|
|||||||
Manages is the top-level piece of the storage system gluing all the other pieces
|
Manages is the top-level piece of the storage system gluing all the other pieces
|
||||||
together. It also implements scheduling logic.
|
together. It also implements scheduling logic.
|
||||||
|
|
||||||
### `package stores`
|
### `package paths`
|
||||||
|
|
||||||
This package implements the sector storage subsystem. Fundamentally the storage
|
This package implements the sector storage subsystem. Fundamentally the storage
|
||||||
is divided into `path`s, each path has it's UUID, and stores a set of sector
|
is divided into `path`s, each path has it's UUID, and stores a set of sector
|
||||||
'files'. There are currently 3 types of sector files - `unsealed`, `sealed`,
|
'files'. There are currently 5 types of sector files - `unsealed`, `sealed`, `cache`, `update` and `update-cache`.
|
||||||
and `cache`.
|
|
||||||
|
|
||||||
Paths can be shared between nodes by sharing the underlying filesystem.
|
Paths can be shared between nodes by sharing the underlying filesystem.
|
||||||
|
|
||||||
### `stores.Local`
|
### `paths.Local`
|
||||||
|
|
||||||
The Local store implements SectorProvider for paths mounted in the local
|
The Local store implements SectorProvider for paths mounted in the local
|
||||||
filesystem. Paths can be shared between nodes, and support shared filesystems
|
filesystem. Paths can be shared between nodes, and support shared filesystems
|
||||||
@ -38,12 +37,12 @@ such as NFS.
|
|||||||
|
|
||||||
stores.Local implements all native filesystem-related operations
|
stores.Local implements all native filesystem-related operations
|
||||||
|
|
||||||
### `stores.Remote`
|
### `paths.Remote`
|
||||||
|
|
||||||
The Remote store extends Local store, handles fetching sector files into a local
|
The Remote store extends Local store, handles fetching sector files into a local
|
||||||
store if needed, and handles removing sectors from non-local stores.
|
store if needed, and handles removing sectors from non-local stores.
|
||||||
|
|
||||||
### `stores.Index`
|
### `paths.Index`
|
||||||
|
|
||||||
The Index is a singleton holding metadata about storage paths, and a mapping of
|
The Index is a singleton holding metadata about storage paths, and a mapping of
|
||||||
sector files to paths
|
sector files to paths
|
||||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 74 KiB |
Loading…
Reference in New Issue
Block a user