Merge remote-tracking branch 'origin/testnet/3' into feat/4stage-seal
This commit is contained in:
@@ -187,7 +187,7 @@ func (a *API) ClientFindData(ctx context.Context, root cid.Cid) ([]api.QueryOffe
|
||||
MinPrice: queryResponse.PieceRetrievalPrice(),
|
||||
PaymentInterval: queryResponse.MaxPaymentInterval,
|
||||
PaymentIntervalIncrease: queryResponse.MaxPaymentIntervalIncrease,
|
||||
Miner: p.Address, // TODO: check
|
||||
Miner: queryResponse.PaymentAddress, // TODO: check
|
||||
MinerPeerID: p.ID,
|
||||
}
|
||||
}
|
||||
@@ -308,10 +308,10 @@ func (a *API) ClientRetrieve(ctx context.Context, order api.RetrievalOrder, path
|
||||
|
||||
unsubscribe := a.Retrieval.SubscribeToEvents(func(event retrievalmarket.ClientEvent, state retrievalmarket.ClientDealState) {
|
||||
if state.PayloadCID.Equals(order.Root) {
|
||||
switch event {
|
||||
case retrievalmarket.ClientEventError:
|
||||
switch state.Status {
|
||||
case retrievalmarket.DealStatusFailed, retrievalmarket.DealStatusErrored:
|
||||
retrievalResult <- xerrors.Errorf("Retrieval Error: %s", state.Message)
|
||||
case retrievalmarket.ClientEventComplete:
|
||||
case retrievalmarket.DealStatusCompleted:
|
||||
retrievalResult <- nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ func (a *StateAPI) StateMinerPower(ctx context.Context, maddr address.Address, t
|
||||
if err != nil {
|
||||
return api.MinerPower{}, err
|
||||
}
|
||||
if slashed != 0 {
|
||||
if slashed {
|
||||
mpow = types.NewInt(0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
cid "github.com/ipfs/go-cid"
|
||||
@@ -76,7 +77,7 @@ func (a *SyncAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) erro
|
||||
}
|
||||
|
||||
// TODO: anything else to do here?
|
||||
return a.PubSub.Publish("/fil/blocks", b)
|
||||
return a.PubSub.Publish(build.MessagesTopic, b)
|
||||
}
|
||||
|
||||
func (a *SyncAPI) SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) {
|
||||
|
||||
@@ -80,7 +80,7 @@ func DHTRouting(client bool) interface{} {
|
||||
dhtopts.Client(client),
|
||||
dhtopts.Datastore(dstore),
|
||||
dhtopts.Validator(validator),
|
||||
dhtopts.Protocols("/lotus/kad/1.0.0"),
|
||||
dhtopts.Protocols(build.DhtProtocolName),
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket/discovery"
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain"
|
||||
"github.com/filecoin-project/lotus/chain/blocksync"
|
||||
"github.com/filecoin-project/lotus/chain/messagepool"
|
||||
@@ -23,9 +24,6 @@ import (
|
||||
"github.com/filecoin-project/lotus/node/modules/helpers"
|
||||
)
|
||||
|
||||
const BlocksTopic = "/fil/blocks"
|
||||
const MessagesTopic = "/fil/messages"
|
||||
|
||||
func RunHello(mctx helpers.MetricsCtx, lc fx.Lifecycle, h host.Host, svc *hello.Service) {
|
||||
h.SetStreamHandler(hello.ProtocolID, svc.HandleStream)
|
||||
|
||||
@@ -53,7 +51,7 @@ func RunBlockSync(h host.Host, svc *blocksync.BlockSyncService) {
|
||||
func HandleIncomingBlocks(mctx helpers.MetricsCtx, lc fx.Lifecycle, ps *pubsub.PubSub, s *chain.Syncer, h host.Host) {
|
||||
ctx := helpers.LifecycleCtx(mctx, lc)
|
||||
|
||||
blocksub, err := ps.Subscribe(BlocksTopic)
|
||||
blocksub, err := ps.Subscribe(build.BlocksTopic)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -63,7 +61,7 @@ func HandleIncomingBlocks(mctx helpers.MetricsCtx, lc fx.Lifecycle, ps *pubsub.P
|
||||
h.ConnManager().TagPeer(p, "badblock", -1000)
|
||||
})
|
||||
|
||||
if err := ps.RegisterTopicValidator(BlocksTopic, v.Validate); err != nil {
|
||||
if err := ps.RegisterTopicValidator(build.BlocksTopic, v.Validate); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -73,7 +71,7 @@ func HandleIncomingBlocks(mctx helpers.MetricsCtx, lc fx.Lifecycle, ps *pubsub.P
|
||||
func HandleIncomingMessages(mctx helpers.MetricsCtx, lc fx.Lifecycle, ps *pubsub.PubSub, mpool *messagepool.MessagePool) {
|
||||
ctx := helpers.LifecycleCtx(mctx, lc)
|
||||
|
||||
msgsub, err := ps.Subscribe(MessagesTopic)
|
||||
msgsub, err := ps.Subscribe(build.MessagesTopic)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -89,7 +87,7 @@ func HandleIncomingMessages(mctx helpers.MetricsCtx, lc fx.Lifecycle, ps *pubsub
|
||||
return true
|
||||
}
|
||||
|
||||
if err := ps.RegisterTopicValidator(MessagesTopic, v); err != nil {
|
||||
if err := ps.RegisterTopicValidator(build.MessagesTopic, v); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user