Comments (5)
Good morning. I've implemented feed.audit()
over here.
However thanks to Rust's borrow checker I'm having trouble writing a test for the "bad data" scenario: it wisely prevents me from altering storage while the Feed has ownership of it.
Any idea of how to insert bad data here?
from hypercore.
@chronoslynx oh that's awesome! -- a PR would be super welcome, even if there isn't any test data included yet! Apologies for not replying sooner; I was on vacation for the past few weeks.
I'm not quite sure how to edit the bad data yet, haha. Perhaps if we re-initialize the feed from disk we can get it into a bad state? Perhaps we can workshop this a bit in the PR?
Thanks so much for putting in the work; that's amazing! :D
from hypercore.
Hey, no need to apologize. Vacation is important!
Inserting bad data will be... weird. Does it write the data immediately to disk (if you're using disk-backed storage)? If so (and we can get the filename), we can open a second handle to it and stomp the data.
I'll need to read into your storage implementation to see
from hypercore.
Inserting bad data will be... weird. Does it write the data immediately to disk (if you're using disk-backed storage)? If so (and we can get the filename), we can open a second handle to it and stomp the data.
Yeah, that's what I was thinking! -- It's very possible that might surface some other fun issues, but that'll be good to verify!
We implement fsync()
on Drop
in random-access-storage
, so that should probably work!
from hypercore.
fsync
is also called after every write, and the disk is consulted on every read which leads to this being simpler than I expected.
It's brittle, however. If the disk implementation every changes the name of the data
file, then this test will break
from hypercore.
Related Issues (20)
- Change stack from `failure` to `std::error::Error` HOT 2
- Feed.put with data yields weird results HOT 3
- Dynamic dispatch for storage? HOT 5
- Plan 0.12 release HOT 7
- Building latest version fails HOT 4
- Running benchmarks fails HOT 2
- Read key pair from disk HOT 3
- 🙋 Android bindings HOT 16
- Upgrade sha2 to 0.8.x HOT 1
- Possible issue with signing data.
- Cannot declare a satisfiable feed reference HOT 2
- refactor binary interface types from `usize` to their specific sizes HOT 2
- Remove Feed Builder in favor of Feed simple create function HOT 7
- update random-access-* HOT 2
- README is incorrect about what the sample code prints HOT 1
- Dependabot can't resolve your Rust dependency files
- How do I read an existing hypercore on disk? HOT 3
- Networking: NOISE handshake and transport encryption HOT 7
- Async API on hypercore HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hypercore.