Skip to content

Commit a78d155

Browse files
authored
Merge pull request #10799 from ipfs/release-v0.35.0
Release v0.35.0
2 parents 4649554 + 49e2690 commit a78d155

File tree

90 files changed

+4341
-976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+4341
-976
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Kubo Changelogs
22

3+
- [v0.35](docs/changelogs/v0.35.md)
34
- [v0.34](docs/changelogs/v0.34.md)
45
- [v0.33](docs/changelogs/v0.33.md)
56
- [v0.32](docs/changelogs/v0.32.md)

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ RUN mkdir -p $IPFS_PATH \
8080
&& chown ipfs:users $IPFS_PATH
8181

8282
# Create mount points for `ipfs mount` command
83-
RUN mkdir /ipfs /ipns \
84-
&& chown ipfs:users /ipfs /ipns
83+
RUN mkdir /ipfs /ipns /mfs \
84+
&& chown ipfs:users /ipfs /ipns /mfs
8585

8686
# Create the init scripts directory
8787
RUN mkdir /container-init.d \

cmd/ipfs/kubo/daemon.go

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const (
5656
initProfileOptionKwd = "init-profile"
5757
ipfsMountKwd = "mount-ipfs"
5858
ipnsMountKwd = "mount-ipns"
59+
mfsMountKwd = "mount-mfs"
5960
migrateKwd = "migrate"
6061
mountKwd = "mount"
6162
offlineKwd = "offline" // global option
@@ -173,6 +174,7 @@ Headers.
173174
cmds.BoolOption(mountKwd, "Mounts IPFS to the filesystem using FUSE (experimental)"),
174175
cmds.StringOption(ipfsMountKwd, "Path to the mountpoint for IPFS (if using --mount). Defaults to config setting."),
175176
cmds.StringOption(ipnsMountKwd, "Path to the mountpoint for IPNS (if using --mount). Defaults to config setting."),
177+
cmds.StringOption(mfsMountKwd, "Path to the mountpoint for MFS (if using --mount). Defaults to config setting."),
176178
cmds.BoolOption(unrestrictedAPIAccessKwd, "Allow RPC API access to unlisted hashes"),
177179
cmds.BoolOption(unencryptTransportKwd, "Disable transport encryption (for debugging protocols)"),
178180
cmds.BoolOption(enableGCKwd, "Enable automatic periodic repo garbage collection"),
@@ -458,6 +460,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
458460
cfg.Identity.PeerID,
459461
cfg.Addresses,
460462
cfg.Identity.PrivKey,
463+
cfg.HTTPRetrieval.Enabled.WithDefault(config.DefaultHTTPRetrievalEnabled),
461464
)
462465
default:
463466
return fmt.Errorf("unrecognized routing option: %s", routingOption)
@@ -485,6 +488,14 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
485488
// This should never happen, but better safe than sorry
486489
log.Fatal("Private network does not work with Routing.Type=auto. Update your config to Routing.Type=dht (or none, and do manual peering)")
487490
}
491+
if cfg.Provider.Strategy.WithDefault("") != "" && cfg.Reprovider.Strategy.IsDefault() {
492+
log.Fatal("Invalid config. Remove unused Provider.Strategy and set Reprovider.Strategy instead. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#reproviderstrategy")
493+
}
494+
if cfg.Experimental.StrategicProviding {
495+
log.Error("Experimental.StrategicProviding was removed. Remove it from your config and set Provider.Enabled=false to remove this message. Documentation: https://github.com/ipfs/kubo/blob/master/docs/experimental-features.md#strategic-providing")
496+
cfg.Experimental.StrategicProviding = false
497+
cfg.Provider.Enabled = config.False
498+
}
488499

489500
printLibp2pPorts(node)
490501

@@ -619,17 +630,19 @@ take effect.
619630
}()
620631

621632
if !offline {
622-
// Warn users who were victims of 'lowprofile' footgun (https://github.com/ipfs/kubo/pull/10524)
623-
if cfg.Experimental.StrategicProviding {
633+
// Warn users when provide systems are disabled
634+
if !cfg.Provider.Enabled.WithDefault(config.DefaultProviderEnabled) {
624635
fmt.Print(`
625-
⚠️ Reprovide system is disabled due to 'Experimental.StrategicProviding=true'
636+
637+
⚠️ Provide and Reprovide systems are disabled due to 'Provide.Enabled=false'
626638
⚠️ Local CIDs will not be announced to Amino DHT, making them impossible to retrieve without manual peering
627-
⚠️ If this is not intentional, call 'ipfs config profile apply announce-on'
639+
⚠️ If this is not intentional, call 'ipfs config profile apply announce-on' or set Provide.Enabled=true'
628640
629641
`)
630642
} else if cfg.Reprovider.Interval.WithDefault(config.DefaultReproviderInterval) == 0 {
631643
fmt.Print(`
632-
⚠️ Reprovider system is disabled due to 'Reprovider.Interval=0'
644+
645+
⚠️ Provide and Reprovide systems are disabled due to 'Reprovider.Interval=0'
633646
⚠️ Local CIDs will not be announced to Amino DHT, making them impossible to retrieve without manual peering
634647
⚠️ If this is not intentional, call 'ipfs config profile apply announce-on', or set 'Reprovider.Interval=22h'
635648
@@ -1052,23 +1065,58 @@ func mountFuse(req *cmds.Request, cctx *oldcmds.Context) error {
10521065
if !found {
10531066
fsdir = cfg.Mounts.IPFS
10541067
}
1068+
if err := checkFusePath("Mounts.IPFS", fsdir); err != nil {
1069+
return err
1070+
}
10551071

10561072
nsdir, found := req.Options[ipnsMountKwd].(string)
10571073
if !found {
10581074
nsdir = cfg.Mounts.IPNS
10591075
}
1076+
if err := checkFusePath("Mounts.IPNS", nsdir); err != nil {
1077+
return err
1078+
}
1079+
1080+
mfsdir, found := req.Options[mfsMountKwd].(string)
1081+
if !found {
1082+
mfsdir = cfg.Mounts.MFS
1083+
}
1084+
if err := checkFusePath("Mounts.MFS", mfsdir); err != nil {
1085+
return err
1086+
}
10601087

10611088
node, err := cctx.ConstructNode()
10621089
if err != nil {
10631090
return fmt.Errorf("mountFuse: ConstructNode() failed: %s", err)
10641091
}
10651092

1066-
err = nodeMount.Mount(node, fsdir, nsdir)
1093+
err = nodeMount.Mount(node, fsdir, nsdir, mfsdir)
10671094
if err != nil {
10681095
return err
10691096
}
10701097
fmt.Printf("IPFS mounted at: %s\n", fsdir)
10711098
fmt.Printf("IPNS mounted at: %s\n", nsdir)
1099+
fmt.Printf("MFS mounted at: %s\n", mfsdir)
1100+
return nil
1101+
}
1102+
1103+
func checkFusePath(name, path string) error {
1104+
if path == "" {
1105+
return fmt.Errorf("%s path cannot be empty", name)
1106+
}
1107+
1108+
fileInfo, err := os.Stat(path)
1109+
if err != nil {
1110+
if os.IsNotExist(err) {
1111+
return fmt.Errorf("%s path (%q) does not exist: %w", name, path, err)
1112+
}
1113+
return fmt.Errorf("error while inspecting %s path (%q): %w", name, path, err)
1114+
}
1115+
1116+
if !fileInfo.IsDir() {
1117+
return fmt.Errorf("%s path (%q) is not a directory", name, path)
1118+
}
1119+
10721120
return nil
10731121
}
10741122

config/bitswap.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package config
2+
3+
// Bitswap holds Bitswap configuration options
4+
type Bitswap struct {
5+
// Libp2pEnabled controls if the node initializes bitswap over libp2p (enabled by default)
6+
// (This can be disabled if HTTPRetrieval.Enabled is set to true)
7+
Libp2pEnabled Flag `json:",omitempty"`
8+
// ServerEnabled controls if the node responds to WANTs (depends on Libp2pEnabled, enabled by default)
9+
ServerEnabled Flag `json:",omitempty"`
10+
}
11+
12+
const (
13+
DefaultBitswapLibp2pEnabled = true
14+
DefaultBitswapServerEnabled = true
15+
)

config/config.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,18 @@ type Config struct {
3333
DNS DNS
3434
Migration Migration
3535

36-
Provider Provider
37-
Reprovider Reprovider
38-
Experimental Experiments
39-
Plugins Plugins
40-
Pinning Pinning
41-
Import Import
42-
Version Version
36+
Provider Provider
37+
Reprovider Reprovider
38+
HTTPRetrieval HTTPRetrieval
39+
Experimental Experiments
40+
Plugins Plugins
41+
Pinning Pinning
42+
Import Import
43+
Version Version
4344

4445
Internal Internal // experimental/unstable options
46+
47+
Bitswap Bitswap `json:",omitempty"`
4548
}
4649

4750
const (

config/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ func TestCheckKey(t *testing.T) {
134134
t.Fatal("Foo.Bar isn't a valid key in the config")
135135
}
136136

137-
err = CheckKey("Provider.Strategy")
137+
err = CheckKey("Reprovider.Strategy")
138138
if err != nil {
139-
t.Fatalf("%s: %s", err, "Provider.Strategy is a valid key in the config")
139+
t.Fatalf("%s: %s", err, "Reprovider.Strategy is a valid key in the config")
140140
}
141141

142142
err = CheckKey("Provider.Foo")

config/experiments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type Experiments struct {
66
ShardingEnabled bool `json:",omitempty"` // deprecated by autosharding: https://github.com/ipfs/kubo/pull/8527
77
Libp2pStreamMounting bool
88
P2pHttpProxy bool //nolint
9-
StrategicProviding bool
9+
StrategicProviding bool `json:",omitempty"` // removed, use Provider.Enabled instead
1010
OptimisticProvide bool
1111
OptimisticProvideJobsPoolSize int
1212
GatewayOverLibp2p bool `json:",omitempty"`

config/http_retrieval.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package config
2+
3+
// HTTPRetrieval is the configuration object for HTTP Retrieval settings.
4+
// Implicit defaults can be found in core/node/bitswap.go
5+
type HTTPRetrieval struct {
6+
Enabled Flag `json:",omitempty"`
7+
Allowlist []string `json:",omitempty"`
8+
Denylist []string `json:",omitempty"`
9+
NumWorkers *OptionalInteger `json:",omitempty"`
10+
MaxBlockSize *OptionalString `json:",omitempty"`
11+
TLSInsecureSkipVerify Flag `json:",omitempty"`
12+
}
13+
14+
const (
15+
DefaultHTTPRetrievalEnabled = false // opt-in for now, until we figure out https://github.com/ipfs/specs/issues/496
16+
DefaultHTTPRetrievalNumWorkers = 16
17+
DefaultHTTPRetrievalTLSInsecureSkipVerify = false // only for testing with self-signed HTTPS certs
18+
DefaultHTTPRetrievalMaxBlockSize = "2MiB" // matching bitswap: https://specs.ipfs.tech/bitswap-protocol/#block-sizes
19+
)

config/import.go

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
package config
22

3+
import (
4+
"github.com/ipfs/boxo/ipld/unixfs/importer/helpers"
5+
"github.com/ipfs/boxo/ipld/unixfs/io"
6+
)
7+
38
const (
49
DefaultCidVersion = 0
510
DefaultUnixFSRawLeaves = false
611
DefaultUnixFSChunker = "size-262144"
712
DefaultHashFunction = "sha2-256"
813

14+
DefaultUnixFSHAMTDirectorySizeThreshold = "256KiB" // https://github.com/ipfs/boxo/blob/6c5a07602aed248acc86598f30ab61923a54a83e/ipld/unixfs/io/directory.go#L26
15+
916
// DefaultBatchMaxNodes controls the maximum number of nodes in a
1017
// write-batch. The total size of the batch is limited by
1118
// BatchMaxnodes and BatchMaxSize.
@@ -14,15 +21,26 @@ const (
1421
// write-batch. The total size of the batch is limited by
1522
// BatchMaxnodes and BatchMaxSize.
1623
DefaultBatchMaxSize = 100 << 20 // 20MiB
24+
25+
)
26+
27+
var (
28+
DefaultUnixFSFileMaxLinks = int64(helpers.DefaultLinksPerBlock)
29+
DefaultUnixFSDirectoryMaxLinks = int64(0)
30+
DefaultUnixFSHAMTDirectoryMaxFanout = int64(io.DefaultShardWidth)
1731
)
1832

1933
// Import configures the default options for ingesting data. This affects commands
2034
// that ingest data, such as 'ipfs add', 'ipfs dag put, 'ipfs block put', 'ipfs files write'.
2135
type Import struct {
22-
CidVersion OptionalInteger
23-
UnixFSRawLeaves Flag
24-
UnixFSChunker OptionalString
25-
HashFunction OptionalString
26-
BatchMaxNodes OptionalInteger
27-
BatchMaxSize OptionalInteger
36+
CidVersion OptionalInteger
37+
UnixFSRawLeaves Flag
38+
UnixFSChunker OptionalString
39+
HashFunction OptionalString
40+
UnixFSFileMaxLinks OptionalInteger
41+
UnixFSDirectoryMaxLinks OptionalInteger
42+
UnixFSHAMTDirectoryMaxFanout OptionalInteger
43+
UnixFSHAMTDirectorySizeThreshold OptionalString
44+
BatchMaxNodes OptionalInteger
45+
BatchMaxSize OptionalInteger
2846
}

config/init.go

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"io"
88
"time"
99

10+
"github.com/cockroachdb/pebble/v2"
1011
"github.com/ipfs/kubo/core/coreiface/options"
1112
"github.com/libp2p/go-libp2p/core/crypto"
1213
"github.com/libp2p/go-libp2p/core/peer"
@@ -47,16 +48,11 @@ func InitWithIdentity(identity Identity) (*Config, error) {
4748
},
4849
},
4950

50-
Routing: Routing{
51-
Type: nil,
52-
Methods: nil,
53-
Routers: nil,
54-
},
55-
5651
// setup the node mount points.
5752
Mounts: Mounts{
5853
IPFS: "/ipfs",
5954
IPNS: "/ipns",
55+
MFS: "/mfs",
6056
},
6157

6258
Ipns: Ipns{
@@ -139,17 +135,37 @@ func DefaultDatastoreConfig() Datastore {
139135
}
140136

141137
func pebbleSpec() map[string]interface{} {
138+
return map[string]interface{}{
139+
"type": "pebbleds",
140+
"prefix": "pebble.datastore",
141+
"path": "pebbleds",
142+
"formatMajorVersion": int(pebble.FormatNewest),
143+
}
144+
}
145+
146+
func pebbleSpecMeasure() map[string]interface{} {
142147
return map[string]interface{}{
143148
"type": "measure",
144149
"prefix": "pebble.datastore",
145150
"child": map[string]interface{}{
146-
"type": "pebbleds",
147-
"path": "pebbleds",
151+
"formatMajorVersion": int(pebble.FormatNewest),
152+
"type": "pebbleds",
153+
"path": "pebbleds",
148154
},
149155
}
150156
}
151157

152158
func badgerSpec() map[string]interface{} {
159+
return map[string]interface{}{
160+
"type": "badgerds",
161+
"prefix": "badger.datastore",
162+
"path": "badgerds",
163+
"syncWrites": false,
164+
"truncate": true,
165+
}
166+
}
167+
168+
func badgerSpecMeasure() map[string]interface{} {
153169
return map[string]interface{}{
154170
"type": "measure",
155171
"prefix": "badger.datastore",
@@ -163,6 +179,29 @@ func badgerSpec() map[string]interface{} {
163179
}
164180

165181
func flatfsSpec() map[string]interface{} {
182+
return map[string]interface{}{
183+
"type": "mount",
184+
"mounts": []interface{}{
185+
map[string]interface{}{
186+
"mountpoint": "/blocks",
187+
"type": "flatfs",
188+
"prefix": "flatfs.datastore",
189+
"path": "blocks",
190+
"sync": false,
191+
"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
192+
},
193+
map[string]interface{}{
194+
"mountpoint": "/",
195+
"type": "levelds",
196+
"prefix": "leveldb.datastore",
197+
"path": "datastore",
198+
"compression": "none",
199+
},
200+
},
201+
}
202+
}
203+
204+
func flatfsSpecMeasure() map[string]interface{} {
166205
return map[string]interface{}{
167206
"type": "mount",
168207
"mounts": []interface{}{

config/internal.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package config
33
type Internal struct {
44
// All marked as omitempty since we are expecting to make changes to all subcomponents of Internal
55
Bitswap *InternalBitswap `json:",omitempty"`
6-
UnixFSShardingSizeThreshold *OptionalString `json:",omitempty"`
6+
UnixFSShardingSizeThreshold *OptionalString `json:",omitempty"` // moved to Import.UnixFSHAMTDirectorySizeThreshold
77
Libp2pForceReachability *OptionalString `json:",omitempty"`
88
BackupBootstrapInterval *OptionalDuration `json:",omitempty"`
99
}
@@ -14,5 +14,6 @@ type InternalBitswap struct {
1414
EngineTaskWorkerCount OptionalInteger
1515
MaxOutstandingBytesPerPeer OptionalInteger
1616
ProviderSearchDelay OptionalDuration
17+
ProviderSearchMaxResults OptionalInteger
1718
WantHaveReplaceSize OptionalInteger
1819
}

config/mounts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ package config
44
type Mounts struct {
55
IPFS string
66
IPNS string
7+
MFS string
78
FuseAllowOther bool
89
}

0 commit comments

Comments
 (0)