mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-24 03:47:45 +08:00
Merge pull request #6731 from ipfs/chore/update-bitswap
dep: update bitswap for improved performance
This commit is contained in:
commit
4752fc440d
6
go.mod
6
go.mod
@ -11,15 +11,15 @@ require (
|
||||
github.com/fatih/color v1.7.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.4.7
|
||||
github.com/go-bindata/go-bindata v3.1.2+incompatible
|
||||
github.com/gogo/protobuf v1.3.0
|
||||
github.com/gogo/protobuf v1.3.1
|
||||
github.com/hashicorp/go-multierror v1.0.0
|
||||
github.com/hashicorp/golang-lru v0.5.3
|
||||
github.com/ipfs/go-bitswap v0.1.8
|
||||
github.com/ipfs/go-bitswap v0.1.9
|
||||
github.com/ipfs/go-block-format v0.0.2
|
||||
github.com/ipfs/go-blockservice v0.1.2
|
||||
github.com/ipfs/go-cid v0.0.3
|
||||
github.com/ipfs/go-cidutil v0.0.2
|
||||
github.com/ipfs/go-datastore v0.1.0
|
||||
github.com/ipfs/go-datastore v0.1.1
|
||||
github.com/ipfs/go-detect-race v0.0.1
|
||||
github.com/ipfs/go-ds-badger v0.0.5
|
||||
github.com/ipfs/go-ds-flatfs v0.1.0
|
||||
|
||||
8
go.sum
8
go.sum
@ -87,6 +87,8 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/gogo/protobuf v1.3.0 h1:G8O7TerXerS4F6sx9OV7/nRfJdnXgHZu/S/7F2SN+UE=
|
||||
github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
|
||||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
@ -139,8 +141,8 @@ github.com/ipfs/go-bitswap v0.0.9/go.mod h1:kAPf5qgn2W2DrgAcscZ3HrM9qh4pH+X8Fkk3
|
||||
github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0=
|
||||
github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs=
|
||||
github.com/ipfs/go-bitswap v0.1.3/go.mod h1:YEQlFy0kkxops5Vy+OxWdRSEZIoS7I7KDIwoa5Chkps=
|
||||
github.com/ipfs/go-bitswap v0.1.8 h1:38X1mKXkiU6Nzw4TOSWD8eTVY5eX3slQunv3QEWfXKg=
|
||||
github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM=
|
||||
github.com/ipfs/go-bitswap v0.1.9 h1:476kVHsth+ZDriC5V9zttmEgtxcuDr8kdM6SEIn7K44=
|
||||
github.com/ipfs/go-bitswap v0.1.9/go.mod h1:1RtsyyeRe5nZgsitHPzVhBgEzaeemy8s0Arbq1FjQo8=
|
||||
github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc=
|
||||
github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE=
|
||||
github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY=
|
||||
@ -160,6 +162,8 @@ github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAK
|
||||
github.com/ipfs/go-datastore v0.0.5/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE=
|
||||
github.com/ipfs/go-datastore v0.1.0 h1:TOxI04l8CmO4zGtesENhzm4PwkFwJXY3rKiYaaMf9fI=
|
||||
github.com/ipfs/go-datastore v0.1.0/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE=
|
||||
github.com/ipfs/go-datastore v0.1.1 h1:F4k0TkTAZGLFzBOrVKDAvch6JZtuN4NHkfdcEZL50aI=
|
||||
github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw=
|
||||
github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk=
|
||||
github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps=
|
||||
github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8=
|
||||
|
||||
@ -43,16 +43,6 @@ func app() int {
|
||||
return 1
|
||||
}
|
||||
|
||||
if len(opts.PidFile) > 0 {
|
||||
data := []byte(strconv.Itoa(os.Getpid()))
|
||||
err := ioutil.WriteFile(opts.PidFile, data, 0644)
|
||||
if err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
defer os.Remove(opts.PidFile)
|
||||
}
|
||||
|
||||
maddr, err := ma.NewMultiaddr(addr)
|
||||
if err != nil {
|
||||
return 1
|
||||
@ -66,6 +56,16 @@ func app() int {
|
||||
return 1
|
||||
}
|
||||
|
||||
if len(opts.PidFile) > 0 {
|
||||
data := []byte(strconv.Itoa(os.Getpid()))
|
||||
err := ioutil.WriteFile(opts.PidFile, data, 0644)
|
||||
if err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
defer os.Remove(opts.PidFile)
|
||||
}
|
||||
|
||||
conn, err = listener.Accept()
|
||||
if err != nil {
|
||||
return 1
|
||||
@ -76,6 +76,17 @@ func app() int {
|
||||
if err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
if len(opts.PidFile) > 0 {
|
||||
data := []byte(strconv.Itoa(os.Getpid()))
|
||||
err := ioutil.WriteFile(opts.PidFile, data, 0644)
|
||||
if err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
defer os.Remove(opts.PidFile)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
defer conn.Close()
|
||||
|
||||
@ -398,30 +398,6 @@ file_size() {
|
||||
$_STAT "$1"
|
||||
}
|
||||
|
||||
directory_size() {
|
||||
local total=0
|
||||
local fsize=0
|
||||
local res=0
|
||||
find "$1" -type f | ( while read fname; do
|
||||
fsize=$(file_size "$fname")
|
||||
res=$?
|
||||
if ! test $res -eq 0; then
|
||||
if ! test -e "$fname"; then
|
||||
continue;
|
||||
fi
|
||||
echo "failed to get filesize" >&2
|
||||
return $res
|
||||
fi
|
||||
total=$(expr "$total" + "$fsize")
|
||||
res=$?
|
||||
if ! test $res -eq 0; then
|
||||
echo "filesize not a number: $fsize" >&2
|
||||
return $res
|
||||
fi
|
||||
done
|
||||
echo "$total" ) # do not remove this subshell
|
||||
}
|
||||
|
||||
test_check_peerid() {
|
||||
peeridlen=$(echo "$1" | tr -dC "[:alnum:]" | wc -c | tr -d " ") &&
|
||||
test "$peeridlen" = "46" || {
|
||||
|
||||
@ -50,8 +50,7 @@ test_expect_success "'ipfs pin rm' output looks good" '
|
||||
test_expect_success "ipfs repo gc fully reverse ipfs add (part 1)" '
|
||||
ipfs repo gc &&
|
||||
random 100000 41 >gcfile &&
|
||||
expected="$(directory_size "$IPFS_PATH/blocks")" &&
|
||||
find "$IPFS_PATH/blocks" -type f &&
|
||||
find "$IPFS_PATH/blocks" -type f | sort -u > expected_blocks &&
|
||||
hash=$(ipfs add -q gcfile) &&
|
||||
ipfs pin rm -r $hash &&
|
||||
ipfs repo gc
|
||||
@ -60,9 +59,8 @@ test_expect_success "ipfs repo gc fully reverse ipfs add (part 1)" '
|
||||
test_kill_ipfs_daemon
|
||||
|
||||
test_expect_success "ipfs repo gc fully reverse ipfs add (part 2)" '
|
||||
actual=$(directory_size "$IPFS_PATH/blocks") &&
|
||||
{ test "$actual" -eq "$expected" || test_fsh echo "$actual != $expected"; } &&
|
||||
{ test "$actual" -gt "0" || test_fsh echo "not($actual > 0)"; }
|
||||
find "$IPFS_PATH/blocks" -type f | sort -u > actual_blocks &&
|
||||
test_cmp expected_blocks actual_blocks
|
||||
'
|
||||
|
||||
test_launch_ipfs_daemon --offline
|
||||
|
||||
@ -84,7 +84,7 @@ test_expect_success 'S->C Setup(dnsaddr/addr/ipfs/peerID) client side' '
|
||||
'
|
||||
|
||||
test_expect_success 'S->C Setup(dnsaddr/addr) client side' '
|
||||
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10104 /dnsaddr/bootstrap.libp2p.io/ 2>&1 > dialer-stdouterr.log
|
||||
ipfsi 1 p2p forward /x/p2p-test /ip4/127.0.0.1/tcp/10104 /dnsaddr/cluster.ipfs.io 2>&1 > dialer-stdouterr.log
|
||||
'
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user