Closed nonsense closed 6 years ago
swarm_30403 panic: runtime error: index out of range
swarm_30403
swarm_30403 goroutine 6665 [running]:
swarm_30403 github.com/ethereum/go-ethereum/swarm/bmt.(*Hasher).writeSection(0xc4237d3430, 0xf7, 0xc427ea8380, 0x40, 0x40, 0xc4237d0001)
swarm_30403 /go/src/github.com/ethereum/go-ethereum/swarm/bmt/bmt.go:539 +0x22b
swarm_30403 created by github.com/ethereum/go-ethereum/swarm/bmt.(*Hasher).Write
swarm_30403 /go/src/github.com/ethereum/go-ethereum/swarm/bmt/bmt.go:350 +0x183
Note that in the stacktrace we see both Sum
and Write
. I don't know if this is of significance.
@zelig I think we should have RefHasher
implement SwarmHash
so that we have at least one easy to understand implementation.
Also tests on swarm/bmt
take:
ok github.com/ethereum/go-ethereum/swarm/bmt 49.107s
This seems wrong to me, considering that this is supposed to just build a binary merkle tree from a []byte.
Note: this happens when (for some reason) there are chunks on the node with size different than 4K
https://github.com/ethersphere/go-ethereum/pull/883 changed how we init the BMT hasher, so we should be able to run tests with different chunk sizes now within the same isolated cluster - obviously syncing them with nodes that run on a different size will not work.
hasher := sha3.NewKeccak256
hasherSize := hasher().Size()
segmentCount := chunk.DefaultSize / hasherSize
pool := bmt.NewTreePool(hasher, segmentCount, bmt.PoolSize)
I am closing this issue as the panic is addressed and we have both a CLI tool and validation in place.
Happens on
v0.3.1