Skip to content

jsipfs add has defaults differing from ipfs add #50

Open
@ribasushi

Description

@ribasushi

In go-ipfs raw-leaves defaults to true when cid-version=1 is specified.
Additional the defaults for rabin are identical to rabin-262144 which translates to rabin-87381-262144-393216

However js-ipfs does otherwise, observe:

go	chunker:rabin	rl:	bafybeifgfx3nkx6lfyrzivtqmeqxuitds7t7k6t2anudptymhsfbmpsvzu
js	chunker:rabin	rl:	bafybeictpvoociikd5pm4vnqtbedccef5gohdjya6ly726csvwm6jy3xea
go	chunker:rabin	rl:--raw-leaves=true	bafybeifgfx3nkx6lfyrzivtqmeqxuitds7t7k6t2anudptymhsfbmpsvzu
js	chunker:rabin	rl:--raw-leaves=true	bafybeicos3bc7li5wahssh2qs2gsdokcjmce3wymusdm6jrmm6wvw6vf2i
go	chunker:rabin	rl:--raw-leaves=false	bafybeierguac6kvgj2plzgsqkpwkg2czmwwhcoccrkdsjgc5loucwjawje
js	chunker:rabin	rl:--raw-leaves=false	bafybeictpvoociikd5pm4vnqtbedccef5gohdjya6ly726csvwm6jy3xea
go	chunker:rabin-262144	rl:	bafybeifgfx3nkx6lfyrzivtqmeqxuitds7t7k6t2anudptymhsfbmpsvzu
js	chunker:rabin-262144	rl:	bafybeictpvoociikd5pm4vnqtbedccef5gohdjya6ly726csvwm6jy3xea
go	chunker:rabin-262144	rl:--raw-leaves=true	bafybeifgfx3nkx6lfyrzivtqmeqxuitds7t7k6t2anudptymhsfbmpsvzu
js	chunker:rabin-262144	rl:--raw-leaves=true	bafybeicos3bc7li5wahssh2qs2gsdokcjmce3wymusdm6jrmm6wvw6vf2i
go	chunker:rabin-262144	rl:--raw-leaves=false	bafybeierguac6kvgj2plzgsqkpwkg2czmwwhcoccrkdsjgc5loucwjawje
js	chunker:rabin-262144	rl:--raw-leaves=false	bafybeictpvoociikd5pm4vnqtbedccef5gohdjya6ly726csvwm6jy3xea
go	chunker:rabin-87381-262144-393216	rl:	bafybeifgfx3nkx6lfyrzivtqmeqxuitds7t7k6t2anudptymhsfbmpsvzu
js	chunker:rabin-87381-262144-393216	rl:	bafybeierguac6kvgj2plzgsqkpwkg2czmwwhcoccrkdsjgc5loucwjawje
go	chunker:rabin-87381-262144-393216	rl:--raw-leaves=true	bafybeifgfx3nkx6lfyrzivtqmeqxuitds7t7k6t2anudptymhsfbmpsvzu
js	chunker:rabin-87381-262144-393216	rl:--raw-leaves=true	bafybeifgfx3nkx6lfyrzivtqmeqxuitds7t7k6t2anudptymhsfbmpsvzu
go	chunker:rabin-87381-262144-393216	rl:--raw-leaves=false	bafybeierguac6kvgj2plzgsqkpwkg2czmwwhcoccrkdsjgc5loucwjawje
js	chunker:rabin-87381-262144-393216	rl:--raw-leaves=false	bafybeierguac6kvgj2plzgsqkpwkg2czmwwhcoccrkdsjgc5loucwjawje

Produced via:

#!/bin/bash

for ch in \
  "rabin" \
  "rabin-262144" \
  "rabin-87381-262144-393216" \
  ; do \
    for rl in \
      "" \
      "--raw-leaves=true" \
      "--raw-leaves=false"; do \
        echo -en "go\tchunker:$ch\trl:$rl\t"; dd if=/dev/zero bs=$((1024*1024)) count=16 2>/dev/null | cmd/ipfs/ipfs add -nq --cid-version=1 --chunker=$ch $rl
        echo -en "js\tchunker:$ch\trl:$rl\t"; dd if=/dev/zero bs=$((1024*1024)) count=16 2>/dev/null | jsipfs add -nq --cid-version=1 --chunker=$ch $rl
    done
done

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: Not priority right nowexp/expertHaving worked on the specific codebase is importantkind/bugA bug in existing code (including security flaws)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions