Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ orbs:
executors:
golang:
docker:
- image: cimg/go:1.23.7
- image: cimg/go:1.24.6
resource_class: 2xlarge
ubuntu:
docker:
Expand Down Expand Up @@ -271,7 +271,7 @@ jobs:
default: golang
golangci-lint-version:
type: string
default: 1.60.1
default: 2.4.0
concurrency:
type: string
default: '2'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main

env:
GO_VERSION: 1.23.7
GO_VERSION: 1.24.6

jobs:
ci-lint:
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:

- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.1
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.4.0
shell: bash

- name: Lint
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell
$(error Update Golang to version to at least 1.20.0)
endif

ALLOWED_NODE_VERSIONS := 16 18 20
ALLOWED_NODE_VERSIONS := 18 20 22 24
validate-node-version:
ifeq ($(filter $(shell node -v | cut -c2-3),$(ALLOWED_NODE_VERSIONS)),)
@echo "Unsupported Node.js version. Please install one of the following versions: $(ALLOWED_NODE_VERSIONS)"
Expand Down
3 changes: 2 additions & 1 deletion car/car_offset_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/ipld/go-car"
mh "github.com/multiformats/go-multihash"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
)

func TestCarOffsetWriterDagOrder(t *testing.T) {
Expand All @@ -46,7 +47,7 @@ func TestCarOffsetWriterDagOrder(t *testing.T) {
{Hash: aaaaBlk.Cid().Bytes(), Name: &aaaa},
},
}
rootByts, err := pbn.Marshal()
rootByts, err := proto.Marshal(pbn)
require.NoError(t, err)
rootBlk := blocks.NewBlock(rootByts)
require.NoError(t, bserv.AddBlock(ctx, rootBlk))
Expand Down
2 changes: 1 addition & 1 deletion cmd/boost/deal_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func dealCmdAction(cctx *cli.Context, isOnline bool) error {
return err
}

api, closer, err := lcli.GetGatewayAPI(cctx)
api, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("cant setup gateway connection: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/boost/deal_status_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var dealStatusCmd = &cli.Command{
return err
}

api, closer, err := lcli.GetGatewayAPI(cctx)
api, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("cant setup gateway connection: %w", err)
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/boost/direct_deal.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ var directDealAllocate = &cli.Command{
return err
}

gapi, closer, err := lcli.GetGatewayAPI(cctx)
gapi, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("can't setup gateway connection: %w", err)
}
Expand Down Expand Up @@ -381,7 +381,7 @@ var directDealGetAllocations = &cli.Command{
return err
}

gapi, closer, err := lcli.GetGatewayAPI(cctx)
gapi, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("cant setup gateway connection: %w", err)
}
Expand Down Expand Up @@ -591,7 +591,7 @@ If the client id different then claim can be extended up to maximum 5 years from
return fmt.Errorf("specified term-max %d is larger than %d maximum allowed by verified regirty actor policy", tmax, verifreg13types.MaximumVerifiedAllocationTerm)
}

gapi, closer, err := lcli.GetGatewayAPI(cctx)
gapi, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("can't setup gateway connection: %w", err)
}
Expand Down Expand Up @@ -725,7 +725,7 @@ var listClaimsCmd = &cli.Command{
return fmt.Errorf("must provide a miner ID")
}

gapi, closer, err := lcli.GetGatewayAPI(cctx)
gapi, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("can't setup gateway connection: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/boost/init_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var initCmd = &cli.Command{
return err
}

api, closer, err := lcli.GetGatewayAPI(cctx)
api, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("cant setup gateway connection: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/boost/provider_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var libp2pInfoCmd = &cli.Command{
return fmt.Errorf("setting up CLI node: %w", err)
}

api, closer, err := lcli.GetGatewayAPI(cctx)
api, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("setting up gateway connection: %w", err)
}
Expand Down Expand Up @@ -144,7 +144,7 @@ var storageAskCmd = &cli.Command{
return err
}

api, closer, err := lcli.GetGatewayAPI(cctx)
api, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("cant setup gateway connection: %w", err)
}
Expand Down Expand Up @@ -225,7 +225,7 @@ var retrievalTransportsCmd = &cli.Command{
return err
}

api, closer, err := lcli.GetGatewayAPI(cctx)
api, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("cant setup gateway connection: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/boost/retrieve_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ var retrieveCmd = &cli.Command{
selNode = selspec.Node()
}

api, closer, err := lcli.GetGatewayAPI(cctx)
api, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("setting up gateway connection: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/boost/wallet_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ var walletList = &cli.Command{
return err
}

api, closer, err := lcli.GetGatewayAPI(cctx)
api, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("cant setup gateway connection: %w", err)
}
Expand Down Expand Up @@ -271,7 +271,7 @@ var walletBalance = &cli.Command{
return err
}

api, closer, err := lcli.GetGatewayAPI(cctx)
api, closer, err := lcli.GetGatewayAPIV1(cctx)
if err != nil {
return fmt.Errorf("cant setup gateway connection: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/boostd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var runCmd = &cli.Command{
}

subCh := gateway.NewEthSubHandler()
fullnodeApi, ncloser, err := lcli.GetFullNodeAPIV1(cctx, lcliutil.FullNodeWithEthSubscribtionHandler(subCh))
fullnodeApi, ncloser, err := lcli.GetFullNodeAPIV1(cctx, lcliutil.FullNodeWithEthSubscriptionHandler(subCh))
if err != nil {
return fmt.Errorf("getting full node api: %w", err)
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/booster-bitswap/bitswap/bitswap.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package bitswap

import (
"github.com/ipfs/boxo/bitswap/network"
"github.com/ipfs/boxo/bitswap/network/bsnet"
"github.com/libp2p/go-libp2p/core/protocol"
)

var Protocols = []protocol.ID{
network.ProtocolBitswap,
network.ProtocolBitswapNoVers,
network.ProtocolBitswapOneOne,
network.ProtocolBitswapOneZero,
bsnet.ProtocolBitswap,
bsnet.ProtocolBitswapNoVers,
bsnet.ProtocolBitswapOneOne,
bsnet.ProtocolBitswapOneZero,
}

var ProtocolStrings = []string{}
Expand Down
13 changes: 5 additions & 8 deletions cmd/booster-bitswap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import (
lotus_blockstore "github.com/filecoin-project/lotus/blockstore"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/ipfs/boxo/bitswap/client"
bsnetwork "github.com/ipfs/boxo/bitswap/network"
nilrouting "github.com/ipfs/boxo/routing/none"
bsnet "github.com/ipfs/boxo/bitswap/network/bsnet"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
ipldlegacy "github.com/ipfs/go-ipld-legacy"
"github.com/ipld/go-car/v2/blockstore"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-routing-helpers"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
Expand Down Expand Up @@ -96,11 +96,8 @@ var fetchCmd = &cli.Command{
}

// Create a bitswap client
nilRouter, err := nilrouting.ConstructNilRouting(ctx, nil, nil, nil)
if err != nil {
return err
}
net := bsnetwork.NewFromIpfsHost(host, nilRouter)
nullRouter := routinghelpers.Null{}
net := bsnet.NewFromIpfsHost(host)
bs, err := blockstore.OpenReadWrite(outputCarPath, []cid.Cid{rootCid}, blockstore.UseWholeCIDs(true))
if err != nil {
return fmt.Errorf("creating blockstore at %s: %w", outputCarPath, err)
Expand All @@ -110,7 +107,7 @@ var fetchCmd = &cli.Command{
defer cancel()
idbs := lotus_blockstore.WrapIDStore(bs)
brn := &blockReceiver{bs: idbs, ctx: ctx, cancel: cancel}
bsClient := client.New(ctx, net, bs, client.WithBlockReceivedNotifier(brn))
bsClient := client.New(ctx, net, nullRouter, idbs, client.WithBlockReceivedNotifier(brn))
defer bsClient.Close()
net.Start(bsClient)

Expand Down
12 changes: 4 additions & 8 deletions cmd/booster-bitswap/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import (
"time"

"github.com/filecoin-project/boost/protocolproxy"
bsnetwork "github.com/ipfs/boxo/bitswap/network"
bsnet "github.com/ipfs/boxo/bitswap/network/bsnet"
"github.com/ipfs/boxo/bitswap/server"
blockstore "github.com/ipfs/boxo/blockstore"
nilrouting "github.com/ipfs/boxo/routing/none"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
Expand Down Expand Up @@ -66,10 +65,6 @@ func (s *BitswapServer) Start(ctx context.Context, proxy *peer.AddrInfo, opts *B
}

// Start a bitswap server on the provider
nilRouter, err := nilrouting.ConstructNilRouting(s.ctx, nil, nil, nil)
if err != nil {
return err
}
bsopts := []server.Option{
server.EngineBlockstoreWorkerCount(opts.EngineBlockstoreWorkerCount),
server.EngineTaskWorkerCount(opts.EngineTaskWorkerCount),
Expand All @@ -87,7 +82,7 @@ func (s *BitswapServer) Start(ctx context.Context, proxy *peer.AddrInfo, opts *B
return fulfill
}),
}
net := bsnetwork.NewFromIpfsHost(host, nilRouter)
net := bsnet.NewFromIpfsHost(host)
s.server = server.New(s.ctx, net, s.remoteStore, bsopts...)
net.Start(s.server)

Expand All @@ -105,7 +100,8 @@ func (s *BitswapServer) Stop() error {
s.host.ConnManager().Unprotect(s.proxy.ID, protectTag)
}
s.cancel()
return s.server.Close()
s.server.Close()
return nil
}

func (s *BitswapServer) keepProxyConnectionAlive(ctx context.Context, proxy peer.AddrInfo) {
Expand Down
Loading
Loading