Skip to content

Commit

Permalink
correct the blocksize calculation for link blocks
Browse files Browse the repository at this point in the history
update hash for bigfile
  • Loading branch information
whyrusleeping committed May 6, 2015
1 parent 5463331 commit 95f0153
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion importer/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var BlockSizeLimit = 1048576 // 1 MB
// rough estimates on expected sizes
var roughDataBlockSize = chunk.DefaultBlockSize
var roughLinkBlockSize = 1 << 13 // 8KB
var roughLinkSize = 258 + 8 + 5 // sha256 multihash + size + no name + protobuf framing
var roughLinkSize = 34 + 8 + 5 // sha256 multihash + size + no name + protobuf framing

// DefaultLinksPerBlock governs how the importer decides how many links there
// will be per block. This calculation is based on expected distributions of:
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0040-add-and-cat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ test_expect_success EXPENSIVE "ipfs add bigfile succeeds" '
'

test_expect_success EXPENSIVE "ipfs add bigfile output looks good" '
HASH="QmSVxWkYfbJ3cowQUUgF4iF4CQd92vubxw7bs2aZAVRUD9" &&
HASH="QmU9SWAPPmNEKZB8umYMmjYvN7VyHqABNvdA6GUi4MMEz3" &&
echo "added $HASH mountdir/bigfile" >expected &&
test_cmp expected actual
'
Expand Down

0 comments on commit 95f0153

Please sign in to comment.