Excited to share this blog post about some of the work @durumcrustulum and I have been doing at the @ZcashFoundation, designing a new network stack for Zcash:https://www.zfnd.org/blog/a-new-network-stack-for-zcash/ …
-
-
but because the existing Zcash tooling is built on top of legacy Bitcoin code, this is extremely difficult and cumbersome, so a key part of this project is re-grounding the Zcash cryptography on a modern foundation.
Prikaži ovu nit -
as a Bitcoin fork, Zcash inherited Bitcoin's networking stack, and both the protocol and its implementation leave a lot to be desired.pic.twitter.com/K9Ykcq8XzC
Prikaži ovu nit -
so instead, we define our own internal request/response protocol, and then perform per-peer translation between our protocol and the legacy Bitcoin protocol.
Prikaži ovu nit -
unlike zcashd or bitcoind, which maintain one state machine for all connections, this means that we can isolate the connection state for each peer, and the state space is much smaller and easier to reason about.
Prikaži ovu nit -
as a nice side effect, because connection state is isolated and each connection is an independent async task, we're automatically immune to the `ping` attack on Zcash, even though we chose this design before that attack was published :)
Prikaži ovu nit -
then, we provide a connection pool that load-balances outbound requests over all available peers, so that the rest of our code doesn't need to know about individual peer connections.
Prikaži ovu nit -
the size of the connection pool is dynamically determined by backpressure, growing when outbound request demand is high and shrinking to shed inbound request load.
Prikaži ovu nit -
this is all made possible by Tower (http://docs.rs/tower ), which provides a vocabulary for writing generic service-handling code, based on the ideas from
@marius's _Your Server As A Function_: https://monkey.org/~marius/funsrv.pdf …Prikaži ovu nit -
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.