bltavares / colmeia

Attempt to make an interop layer to connect to dat on hyperswarm in Rust
24 stars 4 forks source link

Initialize content based on data #5

Closed bltavares closed 4 years ago

bltavares commented 4 years ago

Content is being initialized, but it is not consistent:

thread 'main' panicked at 'could not write data to feed: ErrorMessage { msg: "Signature verification failed" }', src\libcore\result.rs:1188:5
bltavares commented 4 years ago
<bltavares> I'm not sure if it could be because:
<bltavares> datrs/hypercore uses the new hypercore v8 logic for feed, and dat-node uses hypercore v7
<bltavares> datrs/hypercore has a bug on verification
<bltavares> colmeia is parsing the data wrong when feeding it to the feed.put method
bltavares commented 4 years ago

Now that we initialize the field correctly, we can insert data.

handshaken, sending want
Received message "62d1f3d5329db53425f496b1929c665ab03d1ef56b959fc3102568486cc15e86"
handshaken, sending want
Metadata audit: Ok(Audit { valid_blocks: 4, invalid_blocks: 0 })
Metadata len: 4
Content audit: Ok(Audit { valid_blocks: 1, invalid_blocks: 0 })
Content len: 3

The bug was found on how we initialized the content feed key. It is stored as a protobuf structure on the metadata field, and I was just parsing it as plain key bytes.