Skip to main content

Module encoded_post_feedback

Module encoded_post_feedback 

Source
Expand description

§EncodedPostFeedbackV1 — a single feedback vote

Compact 35-byte entry representing one vote on one post: post_id (32) + feedback_type (1) + salt (1) + pow (1). Entries are packed by the hundreds into an crate::protocol::posting::encoded_post_bundle_feedback bundle; the tiny fixed size is what makes that packing cheap to verify.

The PoW is computed over (post_id, feedback_type). Clients must search for a salt that produces at least crate::tools::config::CLIENT_FEEDBACK_POW_NUMERAIRE bits — this is what makes feedback Sybil-resistant: a thousand fake votes costs a thousand PoWs, not one.

EncodedPostFeedbackViewV1 is a zero-copy view over the on-wire bytes for iteration during bundle verification, avoiding the need to allocate one EncodedPostFeedbackV1 per entry just to read it.

Structs§

EncodedPostFeedbackV1
EncodedPostFeedbackViewV1
A zero-copy view into one serialised EncodedPostFeedbackV1 entry. Construction validates the slice length and version byte; all accessors are then infallible and return references into the original buffer.

Constants§

ENTRY_SIZE