change(docs): Update 'Design Overview' page of Zebra book (#5892)

* Updates design overview page of book with:
- a simplified graph of service dependencies in design overview
- links to notable blog posts
- removals of some out-of-date text

also corrects issue/pr refs in an rfc

* Updates service dependencies diagram

* Apply suggestions from code review

Co-authored-by: teor <teor@riseup.net>

* updates diagram and adds doc links

* uses opacity to indicate clickability instead of drop shadow

Co-authored-by: teor <teor@riseup.net>
This commit is contained in:
Arya 2023-01-10 05:10:45 -05:00 committed by GitHub
parent 598e49862e
commit 99cbffbcc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 235 additions and 4 deletions

View File

@ -14,3 +14,4 @@ command = "mdbook-mermaid"
[output.html]
additional-js = ["mermaid.min.js", "mermaid-init.js"]
additional-css = ["theme/css/custom.css"]

View File

@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Title: services Pages: 1 -->
<svg width="569pt" height="404pt"
viewBox="0.00 0.00 568.65 404.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 400)">
<title>services</title>
<!-- transaction_verifier -->
<a id="node1" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebra_consensus/transaction/index.html">
<title>transaction_verifier</title>
<ellipse fill="transparent" stroke="#000000" cx="342.6515" cy="-90" rx="86.7914" ry="18"/>
<text text-anchor="middle" x="342.6515" y="-85.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">transaction_verifier</text>
</a>
<!-- state -->
<a id="node2" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebra_state/service/index.html">
<title>state</title>
<ellipse fill="transparent" stroke="#000000" cx="284.6515" cy="-18" rx="28.9676" ry="18"/>
<text text-anchor="middle" x="284.6515" y="-13.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">state</text>
</a>
<!-- transaction_verifier&#45;&gt;state -->
<g id="edge1" class="edge">
<title>transaction_verifier&#45;&gt;state</title>
<path fill="none" stroke="#000000" d="M328.3144,-72.2022C320.9763,-63.0928 311.9383,-51.8733 303.9925,-42.0096"/>
<polygon fill="#000000" stroke="#000000" points="306.6352,-39.7109 297.6362,-34.119 301.1839,-44.1022 306.6352,-39.7109"/>
</g>
<!-- mempool -->
<a id="node3" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebrad/components/mempool/index.html">
<title>mempool</title>
<ellipse fill="transparent" stroke="#000000" cx="413.6515" cy="-234" rx="47.5332" ry="18"/>
<text text-anchor="middle" x="413.6515" y="-229.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">mempool</text>
</a>
<!-- mempool&#45;&gt;transaction_verifier -->
<g id="edge5" class="edge">
<title>mempool&#45;&gt;transaction_verifier</title>
<path fill="none" stroke="#000000" d="M404.8029,-216.0535C392.5792,-191.2618 370.4207,-146.3207 356.1305,-117.3378"/>
<polygon fill="#000000" stroke="#000000" points="359.1731,-115.594 351.6117,-108.1727 352.8948,-118.6896 359.1731,-115.594"/>
</g>
<!-- mempool&#45;&gt;state -->
<g id="edge2" class="edge">
<title>mempool&#45;&gt;state</title>
<path fill="none" stroke="#000000" d="M418.4301,-215.8051C424.5542,-191.4586 434.8355,-146.8405 438.6515,-108 440.216,-92.0767 447.906,-85.052 438.6515,-72 424.904,-52.6112 363.0269,-35.4418 322.0132,-25.9109"/>
<polygon fill="#000000" stroke="#000000" points="322.6042,-22.456 312.0775,-23.6556 321.0547,-29.2824 322.6042,-22.456"/>
</g>
<!-- peer_set -->
<a id="node9" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebra_network/peer_set/set/index.html">
<title>peer_set</title>
<ellipse fill="transparent" stroke="#000000" cx="489.6515" cy="-162" rx="43.4163" ry="18"/>
<text text-anchor="middle" x="489.6515" y="-157.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">peer_set</text>
</a>
<!-- mempool&#45;&gt;peer_set -->
<g id="edge13" class="edge">
<title>mempool&#45;&gt;peer_set</title>
<path fill="none" stroke="#000000" d="M431.6624,-216.937C441.4819,-207.6344 453.7908,-195.9733 464.5392,-185.7906"/>
<polygon fill="#000000" stroke="#000000" points="467.1796,-188.1105 472.032,-178.6921 462.3654,-183.0288 467.1796,-188.1105"/>
</g>
<!-- inbound -->
<a id="node4" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebrad/components/inbound/index.html">
<title>inbound</title>
<ellipse fill="transparent" stroke="#000000" cx="229.6515" cy="-306" rx="42.8829" ry="18"/>
<text text-anchor="middle" x="229.6515" y="-301.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">inbound</text>
</a>
<!-- inbound&#45;&gt;state -->
<g id="edge3" class="edge">
<title>inbound&#45;&gt;state</title>
<path fill="none" stroke="#000000" d="M200.246,-292.729C126.5724,-257.7262 -55.0317,-159.5675 16.6515,-72 45.118,-37.2256 178.1169,-24.3498 245.4215,-20.003"/>
<polygon fill="#000000" stroke="#000000" points="245.8664,-23.4823 255.6333,-19.3765 245.4378,-16.4955 245.8664,-23.4823"/>
</g>
<!-- inbound&#45;&gt;mempool -->
<g id="edge7" class="edge">
<title>inbound&#45;&gt;mempool</title>
<path fill="none" stroke="#000000" d="M261.2822,-293.6228C291.5824,-281.7662 337.5245,-263.7888 371.0388,-250.6745"/>
<polygon fill="#000000" stroke="#000000" points="372.5364,-253.847 380.5734,-246.9436 369.9855,-247.3283 372.5364,-253.847"/>
</g>
<!-- chain_verifier -->
<a id="node6" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebra_consensus/chain/index.html">
<title>chain_verifier</title>
<ellipse fill="transparent" stroke="#000000" cx="244.6515" cy="-234" rx="65.3859" ry="18"/>
<text text-anchor="middle" x="244.6515" y="-229.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">chain_verifier</text>
</a>
<!-- inbound&#45;&gt;chain_verifier -->
<g id="edge9" class="edge">
<title>inbound&#45;&gt;chain_verifier</title>
<path fill="none" stroke="#000000" d="M233.4366,-287.8314C235.0409,-280.131 236.9485,-270.9743 238.7314,-262.4166"/>
<polygon fill="#000000" stroke="#000000" points="242.2022,-262.9169 240.8154,-252.4133 235.3494,-261.4892 242.2022,-262.9169"/>
</g>
<!-- rpc_server -->
<a id="node5" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebra_rpc/server/index.html">
<title>rpc_server</title>
<ellipse fill="transparent" stroke="#000000" cx="364.6515" cy="-378" rx="51.565" ry="18"/>
<text text-anchor="middle" x="364.6515" y="-373.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">rpc_server</text>
</a>
<!-- rpc_server&#45;&gt;state -->
<g id="edge4" class="edge">
<title>rpc_server&#45;&gt;state</title>
<path fill="none" stroke="#000000" d="M406.6984,-367.4128C464.2897,-350.0944 560.6515,-309.7926 560.6515,-234 560.6515,-234 560.6515,-234 560.6515,-162 560.6515,-56.3112 399.6037,-28.0637 323.5492,-20.6165"/>
<polygon fill="#000000" stroke="#000000" points="323.6823,-17.1144 313.4073,-19.6979 323.0507,-24.0858 323.6823,-17.1144"/>
</g>
<!-- rpc_server&#45;&gt;mempool -->
<g id="edge8" class="edge">
<title>rpc_server&#45;&gt;mempool</title>
<path fill="none" stroke="#000000" d="M383.846,-360.9895C393.4567,-351.221 404.1854,-338.1106 409.6515,-324 417.2551,-304.3715 417.9695,-280.5065 416.9367,-262.2845"/>
<polygon fill="#000000" stroke="#000000" points="420.424,-261.9839 416.1656,-252.2825 413.4447,-262.522 420.424,-261.9839"/>
</g>
<!-- rpc_server&#45;&gt;chain_verifier -->
<g id="edge11" class="edge">
<title>rpc_server&#45;&gt;chain_verifier</title>
<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M350.1767,-360.6302C329.2082,-335.4681 290.2442,-288.7112 265.9807,-259.595"/>
<polygon fill="#000000" stroke="#000000" points="268.6447,-257.3247 259.5541,-251.8831 263.2672,-261.806 268.6447,-257.3247"/>
</g>
<!-- checkpoint_verifier -->
<a id="node7" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebra_consensus/checkpoint/index.html">
<title>checkpoint_verifier</title>
<ellipse fill="transparent" stroke="#000000" cx="112.6515" cy="-90" rx="86.7972" ry="18"/>
<text text-anchor="middle" x="112.6515" y="-85.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">checkpoint_verifier</text>
</a>
<!-- chain_verifier&#45;&gt;checkpoint_verifier -->
<g id="edge6" class="edge">
<title>chain_verifier&#45;&gt;checkpoint_verifier</title>
<path fill="none" stroke="#000000" d="M216.638,-217.5178C201.6091,-207.8136 183.4054,-194.5969 169.6515,-180 151.8569,-161.1147 136.447,-135.8982 126.1523,-116.962"/>
<polygon fill="#000000" stroke="#000000" points="129.1594,-115.1615 121.3857,-107.9628 122.9735,-118.438 129.1594,-115.1615"/>
</g>
<!-- block_verifier -->
<a id="node10" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebra_consensus/block/index.html">
<title>block_verifier</title>
<ellipse fill="transparent" stroke="#000000" cx="244.6515" cy="-162" rx="65.9697" ry="18"/>
<text text-anchor="middle" x="244.6515" y="-157.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">block_verifier</text>
</a>
<!-- chain_verifier&#45;&gt;block_verifier -->
<g id="edge17" class="edge">
<title>chain_verifier&#45;&gt;block_verifier</title>
<path fill="none" stroke="#000000" d="M244.6515,-215.8314C244.6515,-208.131 244.6515,-198.9743 244.6515,-190.4166"/>
<polygon fill="#000000" stroke="#000000" points="248.1516,-190.4132 244.6515,-180.4133 241.1516,-190.4133 248.1516,-190.4132"/>
</g>
<!-- checkpoint_verifier&#45;&gt;state -->
<g id="edge15" class="edge">
<title>checkpoint_verifier&#45;&gt;state</title>
<path fill="none" stroke="#000000" d="M151.2517,-73.8418C181.2868,-61.2689 222.5394,-44.0004 251.1856,-32.009"/>
<polygon fill="#000000" stroke="#000000" points="252.8804,-35.0939 260.7533,-28.0039 250.1774,-28.6368 252.8804,-35.0939"/>
</g>
<!-- syncer -->
<a id="node8" class="node" target="_blank" href="https://doc-internal.zebra.zfnd.org/zebrad/components/sync/index.html">
<title>syncer</title>
<ellipse fill="transparent" stroke="#000000" cx="364.6515" cy="-306" rx="36.4761" ry="18"/>
<text text-anchor="middle" x="364.6515" y="-301.8" font-family="'Opens sans', sans-serif" font-size="14.00" fill="#000000">syncer</text>
</a>
<!-- syncer&#45;&gt;chain_verifier -->
<g id="edge10" class="edge">
<title>syncer&#45;&gt;chain_verifier</title>
<path fill="none" stroke="#000000" d="M341.5143,-292.1177C324.2684,-281.7701 300.3887,-267.4423 280.6551,-255.6022"/>
<polygon fill="#000000" stroke="#000000" points="282.2946,-252.5042 271.9189,-250.3604 278.6931,-258.5067 282.2946,-252.5042"/>
</g>
<!-- syncer&#45;&gt;peer_set -->
<g id="edge12" class="edge">
<title>syncer&#45;&gt;peer_set</title>
<path fill="none" stroke="#000000" d="M396.8815,-297.7541C420.8491,-289.9376 452.4365,-275.7706 470.6515,-252 484.1116,-234.4347 488.5668,-209.5147 489.822,-190.3492"/>
<polygon fill="#000000" stroke="#000000" points="493.3293,-190.2352 490.2313,-180.1034 486.3349,-189.9557 493.3293,-190.2352"/>
</g>
<!-- block_verifier&#45;&gt;transaction_verifier -->
<g id="edge16" class="edge">
<title>block_verifier&#45;&gt;transaction_verifier</title>
<path fill="none" stroke="#000000" d="M267.8761,-144.937C280.6256,-135.57 296.6297,-123.8119 310.5571,-113.5796"/>
<polygon fill="#000000" stroke="#000000" points="312.9263,-116.1821 318.9128,-107.4407 308.7817,-110.5409 312.9263,-116.1821"/>
</g>
<!-- block_verifier&#45;&gt;state -->
<g id="edge14" class="edge">
<title>block_verifier&#45;&gt;state</title>
<path fill="none" stroke="#000000" d="M242.0259,-143.8919C240.0264,-125.3377 238.7909,-95.9031 246.6515,-72 250.2338,-61.1067 256.8185,-50.4816 263.5123,-41.5783"/>
<polygon fill="#000000" stroke="#000000" points="266.3645,-43.6155 269.8691,-33.6171 260.8943,-39.2477 266.3645,-43.6155"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,6 +1,6 @@
# Design Overview
This document sketches the future design for Zebra.
This document sketches the design for Zebra.
## Desiderata
@ -34,6 +34,46 @@ The following are general desiderata for Zebra:
lightweight applications like light wallets. Those applications
should use a light client protocol.
## Notable Blog Posts
- [A New Network Stack For Zcash](https://www.zfnd.org/blog/a-new-network-stack-for-zcash)
- [Composable Futures-based Batch Verification](https://www.zfnd.org/blog/futures-batch-verification)
- [Decoding Bitcoin Messages with Tokio Codecs](https://www.zfnd.org/blog/decoding-bitcoin-messages-with-tokio-codecs)
## Service Dependencies
Note: dotted lines are for "getblocktemplate-rpcs" feature
<div id="service-dep-diagram">
{{#include diagrams/service-dependencies.svg}}
</div>
<!--
Service dependencies diagram source:
digraph services {
transaction_verifier -> state
mempool -> state
inbound -> state
rpc_server -> state
mempool -> transaction_verifier
chain_verifier -> checkpoint_verifier
inbound -> mempool
rpc_server -> mempool
inbound -> chain_verifier
syncer -> chain_verifier
rpc_server -> chain_verifier [style=dotted]
syncer -> peer_set
mempool -> peer_set
block_verifier -> state
checkpoint_verifier -> state
block_verifier -> transaction_verifier
chain_verifier -> block_verifier
rpc_server -> inbound [style=invis] // for layout of the diagram
}
Render here: https://dreampuf.github.io/GraphvizOnline
-->
## Architecture
Unlike `zcashd`, which originated as a Bitcoin Core fork and inherited its
@ -278,7 +318,8 @@ verify blocks or transactions, and add them to the relevant state.
#### Internal Dependencies
- `zebra-chain` for data structure definitions
- `zebra-network` possibly? for definitions of network messages?
- `zebra-node-services` for shared request type definitions
- `zebra-utils` for developer and power user tools
#### Responsible for

View File

@ -1,7 +1,7 @@
- Feature Name: Pipelinable Block Syncing and Lookup
- Start Date: 2020-07-02
- Design PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/0000)
- Rust Issue: [rust-lang/rust#0000](https://github.com/rust-lang/rust/issues/0000)
- Design PR: [ZcashFoundation/zebra#583](https://github.com/ZcashFoundation/zebra/pull/583)
- Zebra Issue: [ZcashFoundation/zebra#504](https://github.com/ZcashFoundation/zebra/issues/504)
# Summary
[summary]: #summary

15
book/theme/css/custom.css Normal file
View File

@ -0,0 +1,15 @@
#service-dep-diagram {
display: block;
margin: 0px auto;
}
#service-dep-diagram a:hover {
text-decoration: none;
opacity: 0.65;
}
html.navy #service-dep-diagram,
html.ayu #service-dep-diagram,
html.coal #service-dep-diagram {
filter: invert(1);
}