You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a difference in the data_root generated between generateTransactionChunks() and generateTransactionChunksAsync() when the input data is a multiple of MAX_CHUNK_SIZE. This is because chunkData() in generateTransactionChunks() has an additional zero-length chunk at the end, which in turn influences the output of generateLeaves() => buildLayers() => generateProofs(). The chunks and proofs returned remain identical as they are cleaned up before returning:
// Discard the last chunk & proof if it's zero length.constlastChunk=chunks.slice(-1)[0];if(lastChunk.maxByteRange-lastChunk.minByteRange===0){chunks.splice(chunks.length-1,1);proofs.splice(proofs.length-1,1);}
I'm not sure if this actually makes a difference in terms of the validity of the transaction, but maybe it is worth mentioning that the outputs of the two functions can sometimes be different.
There is a difference in the
data_root
generated betweengenerateTransactionChunks()
andgenerateTransactionChunksAsync()
when the input data is a multiple ofMAX_CHUNK_SIZE
. This is becausechunkData()
ingenerateTransactionChunks()
has an additional zero-length chunk at the end, which in turn influences the output ofgenerateLeaves()
=>buildLayers()
=>generateProofs()
. Thechunks
andproofs
returned remain identical as they are cleaned up before returning:I'm not sure if this actually makes a difference in terms of the validity of the transaction, but maybe it is worth mentioning that the outputs of the two functions can sometimes be different.
See the failing test here: master...elliotsayes:arweave-stream-tx:chunk-size-multiple
The text was updated successfully, but these errors were encountered: