diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 5e283080..4e5a1dfe 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -37,6 +37,7 @@ - [Transaction anatomy](/wiki/EL/transaction.md) - [JSON-RPC](/wiki/EL/JSON-RPC.md) - [DevP2P](/wiki/EL/devp2p.md) + - [RLP Serialization](/docs/wiki/EL/RLP.md) - Consensus Layer - [Overview](/wiki/CL/overview.md) - [CL Specs](/wiki/CL/cl-specs.md) diff --git a/docs/images/el-architecture/architecture-overview.png b/docs/images/el-architecture/architecture-overview.png index e911f67d..8cc9e8c1 100644 Binary files a/docs/images/el-architecture/architecture-overview.png and b/docs/images/el-architecture/architecture-overview.png differ diff --git a/docs/images/el-architecture/data-serialization.png b/docs/images/el-architecture/data-serialization.png new file mode 100644 index 00000000..f4547f5c Binary files /dev/null and b/docs/images/el-architecture/data-serialization.png differ diff --git a/docs/images/el-architecture/excalidraw/architecture-overview.excalidraw b/docs/images/el-architecture/excalidraw/architecture-overview.excalidraw index 8576889e..61ed9b7b 100644 --- a/docs/images/el-architecture/excalidraw/architecture-overview.excalidraw +++ b/docs/images/el-architecture/excalidraw/architecture-overview.excalidraw @@ -669,8 +669,8 @@ }, { "type": "arrow", - "version": 1391, - "versionNonce": 364804069, + "version": 1549, + "versionNonce": 1969692213, "index": "aJ", "isDeleted": false, "id": "XGVWIZ6pHUIj7ulOBYe4A", @@ -680,12 +680,12 @@ "roughness": 2, "opacity": 100, "angle": 0, - "x": 162.90288831365356, - "y": -468.6856527067158, + "x": 146.13773735681042, + "y": -377.16255650365173, "strokeColor": "#1e1e1e", "backgroundColor": "#ffffff", - "width": 316.20105724273844, - "height": 302.48700480703644, + "width": 332.9662081995817, + "height": 394.01010101010064, "seed": 1103704340, "groupIds": [], "frameId": null, @@ -693,7 +693,7 @@ "type": 2 }, "boundElements": [], - "updated": 1713692542793, + "updated": 1714326038458, "link": null, "locked": false, "startBinding": { @@ -715,12 +715,12 @@ 0 ], [ - 245.98653198653224, - -37.35569167572396 + 262.7516829433754, + -128.87878787878805 ], [ - 316.20105724273844, - -302.48700480703644 + 332.9662081995817, + -394.01010101010064 ] ] }, @@ -1009,8 +1009,8 @@ }, { "type": "ellipse", - "version": 331, - "versionNonce": 229670933, + "version": 441, + "versionNonce": 1291598965, "index": "aQV", "isDeleted": false, "id": "jvMQXbQZG3ErjC616pYO3", @@ -1020,8 +1020,8 @@ "roughness": 2, "opacity": 100, "angle": 0, - "x": -186.61226320149854, - "y": -480.5665969076922, + "x": -208.27892986816528, + "y": -337.2332635743587, "strokeColor": "#1e1e1e", "backgroundColor": "#ffffff", "width": 68.68013468013469, @@ -1046,7 +1046,7 @@ "type": "arrow" } ], - "updated": 1713642890971, + "updated": 1714326038457, "link": null, "locked": false }, @@ -1184,8 +1184,8 @@ }, { "type": "arrow", - "version": 273, - "versionNonce": 956746193, + "version": 481, + "versionNonce": 1390284155, "index": "ad", "isDeleted": false, "id": "kofqDTcbmGMFtvTWA-kFY", @@ -1195,8 +1195,8 @@ "roughness": 2, "opacity": 100, "angle": 0, - "x": -183.6897042789392, - "y": -480.5665969076923, + "x": -205.35637094560593, + "y": -337.23326357435883, "strokeColor": "#1e1e1e", "backgroundColor": "#ffffff", "width": 105.2121212121212, @@ -1208,10 +1208,14 @@ "type": 2 }, "boundElements": [], - "updated": 1713649560134, + "updated": 1714326039812, "link": null, "locked": false, - "startBinding": null, + "startBinding": { + "elementId": "jvMQXbQZG3ErjC616pYO3", + "focus": 0.33727771334282786, + "gap": 12.343479248160179 + }, "endBinding": null, "lastCommittedPoint": null, "startArrowhead": null, @@ -1229,8 +1233,8 @@ }, { "type": "arrow", - "version": 421, - "versionNonce": 204205937, + "version": 629, + "versionNonce": 5547547, "index": "ae", "isDeleted": false, "id": "yTHLUCYwtFkDM98RX9Tx0", @@ -1240,8 +1244,8 @@ "roughness": 2, "opacity": 100, "angle": 0, - "x": -187.83401912683075, - "y": -419.96437705788753, + "x": -209.5006857934975, + "y": -276.63104372455405, "strokeColor": "#1e1e1e", "backgroundColor": "#ffffff", "width": 102.28956228956228, @@ -1253,10 +1257,14 @@ "type": 2 }, "boundElements": [], - "updated": 1713649560134, + "updated": 1714326039812, "link": null, "locked": false, - "startBinding": null, + "startBinding": { + "elementId": "jvMQXbQZG3ErjC616pYO3", + "focus": 0.11838961774399336, + "gap": 9.193005139639233 + }, "endBinding": null, "lastCommittedPoint": null, "startArrowhead": null, @@ -1274,8 +1282,8 @@ }, { "type": "arrow", - "version": 272, - "versionNonce": 1931052849, + "version": 480, + "versionNonce": 1085221563, "index": "af", "isDeleted": false, "id": "dtRi2_WvVx9qE1iqfIBOh", @@ -1285,8 +1293,8 @@ "roughness": 2, "opacity": 100, "angle": 0, - "x": -185.15098374021863, - "y": -446.9571692982647, + "x": -206.81765040688538, + "y": -303.62383596493123, "strokeColor": "#1e1e1e", "backgroundColor": "#ffffff", "width": 135.8989898989899, @@ -1298,10 +1306,14 @@ "type": 2 }, "boundElements": [], - "updated": 1713649560134, + "updated": 1714326039813, "link": null, "locked": false, - "startBinding": null, + "startBinding": { + "elementId": "jvMQXbQZG3ErjC616pYO3", + "focus": 0.011419036349284633, + "gap": 1 + }, "endBinding": null, "lastCommittedPoint": null, "startArrowhead": null, @@ -1454,8 +1466,8 @@ }, { "type": "text", - "version": 134, - "versionNonce": 1074350481, + "version": 168, + "versionNonce": 1013480885, "index": "aj", "isDeleted": false, "id": "Q1CZDpTaEEKNTXlFuZNKH", @@ -1465,8 +1477,8 @@ "roughness": 2, "opacity": 100, "angle": 0, - "x": -536.0085232545501, - "y": -694.029319370415, + "x": -522.6751899212168, + "y": -830.6959860370816, "strokeColor": "#1e1e1e", "backgroundColor": "#ffffff", "width": 365.6000061035156, @@ -1476,7 +1488,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1713649560134, + "updated": 1714325608229, "link": null, "locked": false, "fontSize": 32.95238095238093, @@ -1488,42 +1500,6 @@ "originalText": "Gossips with \nother exceution lauer \nclients over p2p", "lineHeight": 1.25 }, - { - "type": "text", - "version": 143, - "versionNonce": 425859387, - "index": "al", - "isDeleted": false, - "id": "TdgNuphR5Reg09dqFbC-V", - "fillStyle": "hachure", - "strokeWidth": 4, - "strokeStyle": "dashed", - "roughness": 2, - "opacity": 100, - "angle": 0, - "x": -531.722808968836, - "y": -833.3150336561295, - "strokeColor": "#1e1e1e", - "backgroundColor": "transparent", - "width": 304.0333251953125, - "height": 56.42857142857142, - "seed": 851946144, - "groupIds": [], - "frameId": null, - "roundness": null, - "boundElements": [], - "updated": 1713642487815, - "link": null, - "locked": false, - "fontSize": 45.14285714285714, - "fontFamily": 1, - "text": "Network: UDP", - "textAlign": "left", - "verticalAlign": "top", - "containerId": null, - "originalText": "Network: UDP", - "lineHeight": 1.25 - }, { "type": "rectangle", "version": 161, @@ -1929,8 +1905,8 @@ }, { "type": "rectangle", - "version": 498, - "versionNonce": 2125109937, + "version": 557, + "versionNonce": 721928725, "index": "b02", "isDeleted": false, "id": "ZuasuskvUFGU2ZdFZUvPC", @@ -1940,8 +1916,8 @@ "roughness": 2, "opacity": 100, "angle": 0, - "x": -149.34963693887175, - "y": -517.8292231703184, + "x": -157.682970272205, + "y": -376.1625565036517, "strokeColor": "#1e1e1e", "backgroundColor": "#ffffff", "width": 311.2525252525253, @@ -1974,14 +1950,14 @@ "type": "arrow" } ], - "updated": 1713650533114, + "updated": 1714326038457, "link": null, "locked": false }, { "type": "text", - "version": 661, - "versionNonce": 691517193, + "version": 720, + "versionNonce": 491829109, "index": "b03", "isDeleted": false, "id": "p_sKc-oXirXqR4NES8oii", @@ -1991,8 +1967,8 @@ "roughness": 2, "opacity": 100, "angle": 0, - "x": -42.498375838488016, - "y": -460.83932418041945, + "x": -50.831709171821274, + "y": -319.1726575137527, "strokeColor": "#1e1e1e", "backgroundColor": "#ffffff", "width": 97.55000305175781, @@ -2002,7 +1978,7 @@ "frameId": null, "roundness": null, "boundElements": [], - "updated": 1713645774423, + "updated": 1714326038457, "link": null, "locked": false, "fontSize": 29.22558922558922, @@ -2144,8 +2120,8 @@ }, { "type": "arrow", - "version": 433, - "versionNonce": 35907423, + "version": 591, + "versionNonce": 1856165109, "index": "b0R", "isDeleted": false, "id": "gO_ZMZNq0JV7moXCYXxDJ", @@ -2155,11 +2131,11 @@ "roughness": 2, "opacity": 100, "angle": 0, - "x": 162.90288831365353, - "y": -399.0099355450733, + "x": 154.56955498032028, + "y": -270.5291135781252, "strokeColor": "#1e1e1e", "backgroundColor": "transparent", - "width": 708.6588318811038, + "width": 716.992165214437, "height": 245.33346080458358, "seed": 1375156071, "groupIds": [], @@ -2168,7 +2144,7 @@ "type": 2 }, "boundElements": [], - "updated": 1713650756993, + "updated": 1714326038458, "link": null, "locked": false, "startBinding": { @@ -2190,12 +2166,12 @@ 0 ], [ - 462.2314455746533, - -80.94795525391294 + 470.5647789079866, + -209.42877722086104 ], [ - 708.6588318811038, - 164.38550555067064 + 716.992165214437, + 35.904683583722544 ] ] }, @@ -2651,6 +2627,686 @@ "containerId": null, "originalText": "Payload Validation & Insertion\nPipeline", "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 887, + "versionNonce": 810118805, + "index": "b1EG", + "isDeleted": false, + "id": "kJJXsoaK9sX0k2hPaWZv4", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 100, + "angle": 0, + "x": -52.98895085019234, + "y": -598.9944091704378, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffffff", + "width": 447.3636363636364, + "height": 567.7340067340069, + "seed": 2051138293, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "type": "text", + "id": "Idbz_UHlTbbQ8v6rIwdES" + } + ], + "updated": 1714326693225, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 1057, + "versionNonce": 1453904885, + "index": "b1EV", + "isDeleted": false, + "id": "Idbz_UHlTbbQ8v6rIwdES", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 100, + "angle": 0, + "x": 100.76786427986804, + "y": -337.6274058034344, + "strokeColor": "#1e1e1e", + "backgroundColor": "#ffffff", + "width": 139.85000610351562, + "height": 45, + "seed": 1179892821, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1714326693225, + "link": null, + "locked": false, + "fontSize": 36, + "fontFamily": 1, + "text": "DevP2P", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "kJJXsoaK9sX0k2hPaWZv4", + "originalText": "DevP2P", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 332, + "versionNonce": 558698581, + "index": "b1F", + "isDeleted": false, + "id": "cIKoR1G9S613GqXd_iddk", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": -43.825128014765426, + "y": -577.0499828094416, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 415.55555555555554, + "height": 228.88888888888877, + "seed": 1503881653, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [], + "updated": 1714326126200, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 163, + "versionNonce": 839551867, + "index": "b1J", + "isDeleted": false, + "id": "Xzfwj1pJ_WfU_dJNjm-cb", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": -16.60290579254348, + "y": -564.272205031664, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 125.69999694824219, + "height": 27.965599010749017, + "seed": 894855957, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1714326126200, + "link": null, + "locked": false, + "fontSize": 22.372479208599213, + "fontFamily": 1, + "text": "Transaport", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Transaport", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 168, + "versionNonce": 844250549, + "index": "b1K", + "isDeleted": false, + "id": "uyMgKnE_vbVXzg2tkWAei", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": -11.602905792543368, + "y": -511.494427253886, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 348.888888888889, + "height": 129.99999999999994, + "seed": 434258037, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [], + "updated": 1714326126200, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 120, + "versionNonce": 21062683, + "index": "b1L", + "isDeleted": false, + "id": "0aBjUVYof9x5Z-Tl8uyv9", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 12.285983096345603, + "y": -497.6055383649972, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 50, + "height": 25, + "seed": 487352789, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1714326126200, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 1, + "text": "RLPx", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "RLPx", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 168, + "versionNonce": 957005589, + "index": "b1M", + "isDeleted": false, + "id": "U7Qa_ObzWsWuSktEytoR7", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 90.61931642967886, + "y": -470.383316142775, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 98.88888888888893, + "height": 62.222222222222285, + "seed": 2146068277, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [], + "updated": 1714326126201, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 111, + "versionNonce": 1096034491, + "index": "b1N", + "isDeleted": false, + "id": "J8AVpiu1S8fHQMwJY1nkx", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 119.50820531856778, + "y": -452.04998280944153, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 42.18333435058594, + "height": 25, + "seed": 1155643541, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1714326126201, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 1, + "text": "TCP", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "TCP", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 162, + "versionNonce": 1273762933, + "index": "b1O", + "isDeleted": false, + "id": "LD692x2fJR-knVy5i5PQ4", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 217.28598309634583, + "y": -473.71664947610816, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 78.8888888888888, + "height": 67.7777777777777, + "seed": 94887413, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "type": "text", + "id": "6L4K3NIkPF7-fWXr7jmnd" + } + ], + "updated": 1714326126201, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 107, + "versionNonce": 420684277, + "index": "b1P", + "isDeleted": false, + "id": "6L4K3NIkPF7-fWXr7jmnd", + "fillStyle": "hachure", + "strokeWidth": 4, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 244.67209414387855, + "y": -452.32776058721936, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 24.116666793823242, + "height": 25, + "seed": 155342677, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1714325858561, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 1, + "text": "IP", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "LD692x2fJR-knVy5i5PQ4", + "originalText": "IP", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 443, + "versionNonce": 1206212955, + "index": "b1Q", + "isDeleted": false, + "id": "kFUXF3EEaP_EYfePbjPq4", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": -38.408461348098854, + "y": -282.8833161427747, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 415.55555555555554, + "height": 228.88888888888877, + "seed": 436642997, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [], + "updated": 1714326126201, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 297, + "versionNonce": 1525957621, + "index": "b1R", + "isDeleted": false, + "id": "XYTcO10n00Tn821PEUe0x", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": -11.18623912587691, + "y": -270.1055383649971, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 102.1500015258789, + "height": 27.965599010749017, + "seed": 463095317, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1714326544482, + "link": null, + "locked": false, + "fontSize": 22.372479208599213, + "fontFamily": 1, + "text": "Discovery", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Discovery", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 493, + "versionNonce": 576760283, + "index": "b1S", + "isDeleted": false, + "id": "wHq0o5OPIYgSCam3Ud3ox", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": -6.186239125876796, + "y": -217.32776058721902, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 348.888888888889, + "height": 129.99999999999994, + "seed": 1626520437, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [], + "updated": 1714326667492, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 451, + "versionNonce": 817608021, + "index": "b1T", + "isDeleted": false, + "id": "GHkR-NTc9kCpHyJ4KRGEu", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 17.702649763012232, + "y": -203.43887169833033, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 38.83333206176758, + "height": 25, + "seed": 1112900821, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1714326667492, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 1, + "text": "Wire", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Wire", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 473, + "versionNonce": 302298747, + "index": "b1U", + "isDeleted": false, + "id": "kJ26GQukJfY9NLrg-Cwxl", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 96.03598309634549, + "y": -176.21664947610816, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 98.88888888888893, + "height": 62.222222222222285, + "seed": 1935155765, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [], + "updated": 1714326667492, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 439, + "versionNonce": 111428277, + "index": "b1V", + "isDeleted": false, + "id": "kJjfJZvH9KuDUgkKFa1dW", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 124.9248719852344, + "y": -157.88331614277456, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 43.099998474121094, + "height": 25, + "seed": 417338261, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1714326667492, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 1, + "text": "UDP", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "UDP", + "lineHeight": 1.25 + }, + { + "type": "rectangle", + "version": 485, + "versionNonce": 1455304475, + "index": "b1W", + "isDeleted": false, + "id": "KdhTH7IKq0qbRAlPOTcfO", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 222.70264976301235, + "y": -179.5499828094412, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 78.8888888888888, + "height": 67.7777777777777, + "seed": 522377461, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "type": "text", + "id": "sQ50L5Av6ekng3OZcrKFU" + } + ], + "updated": 1714326667492, + "link": null, + "locked": false + }, + { + "type": "text", + "version": 543, + "versionNonce": 517219349, + "index": "b1X", + "isDeleted": false, + "id": "sQ50L5Av6ekng3OZcrKFU", + "fillStyle": "hachure", + "strokeWidth": 4, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "angle": 0, + "x": 250.08876081054512, + "y": -158.16109392055233, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 24.116666793823242, + "height": 25, + "seed": 1336275541, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1714326667492, + "link": null, + "locked": false, + "fontSize": 20, + "fontFamily": 1, + "text": "IP", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "KdhTH7IKq0qbRAlPOTcfO", + "originalText": "IP", + "lineHeight": 1.25 + }, + { + "id": "g1ZfPJFDYRULh-a-l4zq8", + "type": "rectangle", + "x": 206.58221759223278, + "y": -272.46228821834586, + "width": 75.47350817609556, + "height": 44.56582689299915, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b1b", + "roundness": { + "type": 3 + }, + "seed": 921396315, + "version": 149, + "versionNonce": 728245083, + "isDeleted": false, + "boundElements": [ + { + "type": "text", + "id": "i8arnc2i2DpaUEvL_S7kb" + } + ], + "updated": 1714326722526, + "link": null, + "locked": false + }, + { + "id": "i8arnc2i2DpaUEvL_S7kb", + "type": "text", + "x": 223.9939709173411, + "y": -262.67937477184626, + "width": 40.650001525878906, + "height": 25, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 0, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b1c", + "roundness": null, + "seed": 682137653, + "version": 110, + "versionNonce": 1323368443, + "isDeleted": false, + "boundElements": null, + "updated": 1714326722526, + "link": null, + "locked": false, + "text": "DNS", + "fontSize": 20, + "fontFamily": 1, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "g1ZfPJFDYRULh-a-l4zq8", + "originalText": "DNS", + "lineHeight": 1.25 } ], "appState": { diff --git a/docs/wiki/EL/RLP.md b/docs/wiki/EL/RLP.md new file mode 100644 index 00000000..88ab5f79 --- /dev/null +++ b/docs/wiki/EL/RLP.md @@ -0,0 +1,194 @@ +# Recursive-Length Prefix (RLP) Serialization + +Recursive Length Prefix (RLP) is a core serialization protocol used within the execution layer for encoding and parsing data. It is designed to serialize data and produce a structure readable by all client software. It is used for everything from transaction data to the entire state of the blockchain. This wiki page explores the internals of RLP, its encoding/decoding rules, tools available and its role in Ethereum's functionality. + +## Data Serialization in Ethereum + +Data serialization is the process of converting data structures or objects into a byte stream for storage, transmission, or later reconstruction. In distributed systems like Ethereum, serialization is crucial for transmitting data across network nodes reliably and efficiently. Clients written in different languages need to be able to process data the same way. Data communicated to other nodes or exported by the client need to have a standard format. While there are common serialization formats like JSON, XML or Protobuf, Ethereum uses its own protocols for its simplicity and effectiveness in encoding nested arrays of bytes. + +> Ethereum actually utilizes 2 formats: RLP and Simple Serialize (SSZ) which is more modern standard used by consensus layer. + +## How RLP Algorithm works + +**RLP encoding algorithm** + +Here is a flow chart describing how RLP encoding algorithm works. + +_Note that in some RLP tools, some clients may add additional conditional cases to the flow. These additional cases are not part of the standard specification but they are useful for the clients for the correct data serialization, e.g. geth client node communicating with a Nethermind client node._ + +```mermaid +flowchart TD + A[Start: Input] --> B{Is Input null, empty string, or false?} + B -->|Yes| C[Encode as Single Byte 0x80] + B -->|No| D{Is it a Single Byte and < 0x80?} + D -->|Yes| E[Directly Encode the Byte] + D -->|No| F{Is it a String or List?} + F -->|String| G{String Length <= 55} + G -->|Yes| H[Encode with Length + 0x80] + G -->|No| I[Encode Length with 0xB7 + Length Bytes] + F -->|List| J{Total Encoded Items Length <= 55} + J -->|Yes| K[Encode with Total Length + 0xC0] + J -->|No| L[Encode Total Length with 0xF7 + Length Bytes] + H --> M[Output Encoded Data] + I --> M + K --> M + L --> M + E --> M + C --> M +``` + +_Figure: RLP Encoding Flow_ + +**RLP decoding algorithm** + +Here is a flow chart describing how RLP decoding algorithm works. + +```mermaid +flowchart TD + A[Start: Encoded Input] --> B{Check First Byte} + B -->|0x00 to 0x7F| C[Direct Byte Output] + B -->|0x80| D[Decode as Empty String/Null/False] + B -->|0x81 to 0xB7| E[Short String] + E --> F[Subtract 0x80 from First Byte to get Length] + F --> G[Output Next 'Length' Bytes as String] + B -->|0xB8 to 0xBF| H[Long String] + H --> I[Subtract 0xB7 from First Byte to get Length Bytes Count] + I --> J[Read Next 'Length Bytes Count' to Determine String Length] + J --> K[Output Next 'String Length' Bytes as String] + B -->|0xC0 to 0xF7| L[Short List] + L --> M[Subtract 0xC0 from First Byte to get Total Encoded Length] + M --> N[Decode Each Element in the Next 'Total Encoded Length' Bytes Recursively] + B -->|0xF8 to 0xFF| O[Long List] + O --> P[Subtract 0xF7 from First Byte to get Length Bytes Count] + P --> Q[Read Next 'Length Bytes Count' to Determine List Total Length] + Q --> R[Decode Each Element in the Next 'List Total Length' Bytes Recursively] + C --> S[Output Decoded Data] + D --> S + G --> S + K --> S + N --> S + R --> S +``` + +_Figure: RLP Decoding Flow_ + + +## RLP Encoding Rules + +Understanding how RLP encoding is derived requires a grasp of the specific rules applied based on the type and size of the data. Let's explore these rules using an example to demonstrate how different types of data are encoded. + +If you are not familiar with converting the strings to hex, you may refer to this [ASCII chart](https://www.asciitable.com/). + +### Detailed Explanation of RLP Encoding Rules with Example + +Recursive Length Prefix (RLP) is a fundamental data serialization technique used in Ethereum to encode structured data into a sequence of bytes. Understanding how RLP encoding is derived requires a grasp of the specific rules applied based on the type and size of the data. Let's explore these rules step-by-step using an example to demonstrate how different types of data are encoded. + +**Single Byte Encoding** + - **Condition**: If the input is a single byte and its value is between `0x00` and `0x7F` (inclusive). + - **Encoding**: The byte is encoded directly, unchanged. + - **Example**: Encoding the byte `0x2a` directly yields `0x2a`. + +**Single Byte String Encoding** + - **Condition**: If the input is a single byte string. + - **Encoding**: The byte is encoded directly, unchanged. + - **Example**: Encoding the byte `0x74` directly yields `0x74`. + - +**Short String Encoding (1-55 bytes)** + - **Condition**: If the string (or byte array) length is between 1 and 55 bytes. + - **Encoding**: The output is the length of the string plus `0x80`, followed by the string itself. + - **Example**: Encoding the string "dog" (`0x64, 0x6f, 0x67`) results in `0x83, 0x64, 0x6f, 0x67`. Here, `0x83` is `0x80 + 3` (the length of "dog"). + +**Long String Encoding (over 55 bytes)** + - **Condition**: If the string length exceeds 55 bytes. + - **Encoding**: The length of the string is encoded as a byte array in big-endian format, prefixed by `0xb7` plus the length of this length array. + - **Example**: For a string of length 56, the length `0x38` is encoded, preceded by `0xb8` (`0xb7 + 1`). The resulting encoding starts with `0xb8, 0x38`, followed by the string's bytes. + +**Short List Encoding (total payload 1-55 bytes)** + - **Condition**: If the total encoded payload of the list's items is between 1 and 55 bytes. + - **Encoding**: The list is prefixed with `0xc0` plus the total length of the encoded items. + - **Example**: For a list `["cat", "dog"]`, each item is first encoded to `0x83, 0x63, 0x61, 0x74` and `0x83, 0x64, 0x6f, 0x67`. The total length is 8, so the prefix is `0xc8` (`0xc0` + 8 = `0xc8`). The entire encoding is `0xc8, 0x83, 0x63, 0x61, 0x74, 0x83, 0x64, 0x6f, 0x67`. + +**Long List Encoding (total payload over 55 bytes)** + - **Condition**: If the total encoded payload of the list's items exceeds 55 bytes. + - **Encoding**: Similar to long strings, the length of the payload is encoded in big-endian format, prefixed by `0xf7` plus the length of this length array. + - **Example**: For a list `["apple", "bread", ...]` exceeding 55 bytes, suppose the payload length is 57. The length `0x39` is encoded, preceded by `0xf8` (`0xf7 + 1`), followed by the encoded list items. + +**Null, Empty String, Empty List and False** + - Rule for Empty string, Null and False: Encoded as a single byte `0x80`. + - Rule for Empty List: Encoded as `0xc0`. + - Examples: + - Encoding an empty string or a null value or false, (` `, `null`, `false`), result in `0x80`. + - Encoding an empty list, `[]`, results in `0xc0`. + +## RLP Decoding Rules + +The RLP decoding process is based on the structure and specifics of the encoded data: + +**Determine Data Type**: + - The first byte (prefix) of the encoded data determines the type and length of the data that follows. This byte is critical in guiding the decoding process. +**Decoding Single Bytes**: + - If the prefix byte is in the range `0x00` to `0x7F`, the byte itself represents the decoded data. This case is straightforward as the byte is encoded directly. +**Decoding Strings and Lists**: + - The complexity in decoding arises with strings and lists, which have varying lengths and may contain nested structures. +**Short Strings (0x80 to 0xB7)**: + - If the prefix byte is between `0x80` and `0xB7`, it indicates a string whose length can be directly determined by subtracting `0x80` from the prefix. The following bytes equal the length are the string. +**Long Strings (0xB8 to 0xBF)**: + - For longer strings, if the prefix byte is between `0xB8` and `0xBF`, the number of length bytes is determined by subtracting `0xB7` from the prefix. The subsequent bytes represent the length of the string, and the bytes following represent the string itself. +**Short Lists (0xC0 to 0xF7)**: + - Similar to short strings, a prefix between `0xC0` and `0xF7` indicates a list. The length of the list's encoded data can be determined by subtracting `0xC0` from the prefix. The bytes that follow must then be decoded recursively as individual RLP encoded items. +**Long Lists (0xF8 to 0xFF)**: + - For longer lists, a prefix between `0xF8` and `0xFF` indicates that the next few bytes (determined by subtracting `0xF7` from the prefix) will tell the length of the list's encoded data. The data following these length bytes is then recursively decoded into RLP items. + +**Examples of RLP Decoding of `[0xc8, 0x83, 0x63, 0x61, 0x74, 0x83, 0x64, 0x6f, 0x67]`** + +- **Identify the Prefix** + - The sequence starts with the byte `0xc8`. In RLP, a list's length prefix starts at `0xc0`. The difference between `0xc8` and `0xc0` gives us the length of the list content. + - `0xc8 - 0xc0 = 8` + - This tells us that the next 8 bytes are part of the list. +- **Decode the List Content** + - The list content in this example is `[0x83, 0x63, 0x61, 0x74, 0x83, 0x64, 0x6f, 0x67]`. + - We will decode this content byte by byte to extract the individual items. +- **Decode the First Item** + - The first byte of the list content is `0x83`. In RLP, for strings where the length is between 1 and 55 bytes, the length prefix starts at `0x80`. Thus: + - `0x83 - 0x80 = 3` + - This tells us that the first string has a length of `3` bytes. + - The next three bytes are `0x63, 0x61, 0x74`, which correspond to the ASCII values for "cat". + - We have now decoded the first item: "cat". +- **Decode the Second Item** + - After decoding the first item, the next byte in the sequence is another `0x83`. + - Following the same rule as before: + - `0x83 - 0x80 = 3` + - This indicates the next string also has a length of 3 bytes. + - The following three bytes are `0x64, 0x6f, 0x67`, corresponding to "dog". + - We have now decoded the second item: "dog". +- The decoded output is `["cat", "dog"]`. + +## The Need for RLP in Ethereum + +> RLP is intended to be a highly minimalistic serialization format; its sole purpose is to store nested arrays of bytes. Unlike protobuf, BSON and other existing solutions, RLP does not attempt to define any specific data types such as booleans, floats, doubles or even integers; instead, it simply exists to store structure, in the form of nested arrays, and leaves it up to the protocol to determine the meaning of the arrays. +> -- Ethereum's design rationale + +RLP was created with Ethereum and is tailored to meet its specific needs: +- Minimalistic Design: It focuses purely on storing structure without imposing data type definitions. +- Consistency: It guarantees byte-perfect consistency across different implementations, crucial for the deterministic nature required in blockchain operations. + +## RLP Tools + +There are many libraries available for RLP implementations in Ethereum. Here are few tools: +- [Geth RLP](https://github.com/ethereum/go-ethereum/tree/master/rlp) +- [RLP Dump](https://github.com/ethereum/go-ethereum/tree/master/cmd/rlpdump) +- [RLP for Node.js and the browser.](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/rlp) +- [Python RLP serialization library.](https://github.com/ethereum/pyrlp) +- [RLP for Rust](https://docs.rs/ethereum-rlp/latest/rlp/) +- [Nethermind RLP Serialization](https://github.com/NethermindEth/nethermind/tree/master/src/Nethermind/Nethermind.Serialization.Rlp) + +## Resources +- [Ethereum Yellow Paper](https://ethereum.github.io/yellowpaper/paper.pdf) +- [Ethereum RLP documentation](https://ethereum.org/vi/developers/docs/data-structures-and-encoding/rlp/) +- [A Comprehensive Guide to RLP Encoding in Ethereum by Mark Odayan](https://medium.com/@markodayansa/a-comprehensive-guide-to-rlp-encoding-in-ethereum-6bd75c126de0) +- [Ethereum's RLP serialization in Elixir](https://www.badykov.com/elixir/rlp/) +- [Ethereum Under The Hood Part 3 (RLP Decoding)](https://medium.com/coinmonks/ethereum-under-the-hood-part-3-rlp-decoding-df236dc13e58) +- [Ethereum's Recursive Length Prefix in ACL2](https://arxiv.org/abs/2009.13769) + + + diff --git a/docs/wiki/EL/el-architecture.md b/docs/wiki/EL/el-architecture.md index 3f4c4cc1..77b4a366 100644 --- a/docs/wiki/EL/el-architecture.md +++ b/docs/wiki/EL/el-architecture.md @@ -178,23 +178,21 @@ In Ethereum two primary types of transaction pools are recognized: ### EVM -TODO Link to wiki page +[Wiki - EVM](/wiki/EL/evm.md) ### DevP2P -TODO Link to wiki page +[Wiki - DevP2P](/wiki/EL/devp2p.md) ### Data structures Blockchain and state data processed by execution client need to be stored in the disk. These are necessary to validate new blocks, verify history and to serve peers in the network. Client stores historical data, also called the ancient database, which include previous blocks. Another database of trie structure contains the current state and small number of recent states. In practice, clients keep various databases for different data categories. Each client can implement a different backend to handle this data, e.g. leveldb, pebble, mdbx. -More details in the page on [EL data structures](./data-structures.md). +More details in the page on [EL data structures](/wiki/EL/data-structures.md). -TODO Link to wiki page +#### RLP -### RLP - -TODO Link to wiki page +[Wiki - RLP](/wiki/EL/RLP.md) ### StateDB diff --git a/wordlist.txt b/wordlist.txt index a8afbcf4..6c4d0335 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -3,6 +3,7 @@ aantop ABI accelerometer ACD +ACL addons Aleth allowfullscreen @@ -55,10 +56,12 @@ BLS Bogotá Boneh bool +booleans bootup borderless BPE broadcasted +BSON Buterin Buterin's bypassability @@ -103,8 +106,8 @@ Cryptopedia cryptosystem cybersecurity Cypherpunks -Daemen D'Amato +Daemen Dankrad danksharding Danno @@ -191,9 +194,9 @@ ethresear ethresearch ethroadmap EVM +EVM's evmlab EVMONE -EVM's excalidraw exchangeTransitionConfigurationV Explainer @@ -332,6 +335,7 @@ Merkleize MEV mevboost Michaël +minimalistic Mitigations mload MMPTs @@ -348,6 +352,7 @@ MUL Murr MVE mvepbs +n't Nagu namespace namespaces @@ -364,8 +369,8 @@ NIST's Noam NOXX NSS -n't Occhipinti +Odayan OFAC Offchain offsites @@ -425,6 +430,7 @@ privateKey probabilistically programmability proto +protobuf prover Prover's Provers @@ -593,3 +599,6 @@ zkEVMs ZKSNARK ZKSNARKs Zksync +Hotz +linearizer +tinygrad \ No newline at end of file