Expand description
§RPC request packet encode / decode
The wire format of every outgoing and incoming RPC request. Split into a strict Tx / Rx pair so the compiler enforces the asymmetry between “I’m building a request” and “I’m parsing one”:
RpcRequestPacketTx— build a request.encodeoptionally compresses the payload, runs the PoW search (via acrate::tools::parallel_pow_generator::ParallelPowGenerator) targeting the destination server’s identity, and produces a header containing the discriminator, sponsor id, PoW timestamp, content hash, salt, and payload length.RpcRequestPacketRx— parse a request on the receive side. Extracts the header, verifies PoW against the receiving server’s own identity, rejects under-powered or stale requests (viacrate::tools::config::POW_MAX_CLOCK_DRIFT_MILLIS) before any payload work happens.
The PoW sits in the header and binds to the server’s identity, so a request valid for server A can’t be forwarded to server B and still authenticate.
Structs§
- RpcRequest
Packet Rx - The server-side view of an inbound RPC request after header parsing and PoW verification.
- RpcRequest
Packet Tx - An outbound RPC request, freshly encoded and ready to be sent over a [
crate::transport::TransportFactory]. - RpcRequest
Packet TxFlags