From d0340bdb1dad8d550d0d591648930dad1672fac4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:00:23 +0000 Subject: [PATCH 01/12] chore(deps): bump systeminformation from 5.22.9 to 5.23.8 (#7327) Bumps [systeminformation](https://github.com/sebhildebrandt/systeminformation) from 5.22.9 to 5.23.8. - [Changelog](https://github.com/sebhildebrandt/systeminformation/blob/master/CHANGELOG.md) - [Commits](https://github.com/sebhildebrandt/systeminformation/compare/v5.22.9...v5.23.8) --- updated-dependencies: - dependency-name: systeminformation dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 121 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 86 insertions(+), 35 deletions(-) diff --git a/yarn.lock b/yarn.lock index f59b3d08245..60ff9034fd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2702,14 +2702,14 @@ integrity sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ== "@puppeteer/browsers@1.4.6", "@puppeteer/browsers@^1.6.0", "@puppeteer/browsers@^2.1.0": - version "2.3.0" - resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.3.0.tgz#791ea7d80450fea24eb19fb1d70c367ad4e08cae" - integrity sha512-ioXoq9gPxkss4MYhD+SFaU9p1IHFUX0ILAWFPyjGaBdjLsYAlZw6j1iLA0N/m12uVHLFDfSYNF7EQccjinIMDA== + version "2.6.1" + resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.6.1.tgz#d75aec5010cae377c5e4742bf5e4f62a79c21315" + integrity sha512-aBSREisdsGH890S2rQqK82qmQYU3uFpSH8wcZWHgHzl3LfzsxAKbLNiAG9mO8v1Y0UICBeClICxPJvyr0rcuxg== dependencies: - debug "^4.3.5" + debug "^4.4.0" extract-zip "^2.0.1" progress "^2.0.3" - proxy-agent "^6.4.0" + proxy-agent "^6.5.0" semver "^7.6.3" tar-fs "^3.0.6" unbzip2-stream "^1.4.3" @@ -3762,6 +3762,11 @@ agent-base@^7.0.2, agent-base@^7.1.0: dependencies: debug "^4.3.4" +agent-base@^7.1.2: + version "7.1.3" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.3.tgz#29435eb821bc4194633a5b89e5bc4703bafc25a1" + integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== + agentkeepalive@^4.1.3, agentkeepalive@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.1.tgz#a7975cbb9f83b367f06c90cc51ff28fe7d499717" @@ -5404,6 +5409,13 @@ debug@^4.3.5: dependencies: ms "2.1.2" +debug@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== + dependencies: + ms "^2.1.3" + decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -7199,7 +7211,7 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -https-proxy-agent@^7.0.2, https-proxy-agent@^7.0.3, https-proxy-agent@^7.0.4: +https-proxy-agent@^7.0.2, https-proxy-agent@^7.0.4: version "7.0.5" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz#9e8b5013873299e11fab6fd548405da2d6c602b2" integrity sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw== @@ -7207,6 +7219,14 @@ https-proxy-agent@^7.0.2, https-proxy-agent@^7.0.3, https-proxy-agent@^7.0.4: agent-base "^7.0.2" debug "4" +https-proxy-agent@^7.0.6: + version "7.0.6" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9" + integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw== + dependencies: + agent-base "^7.1.2" + debug "4" + human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -7413,6 +7433,14 @@ internal-slot@^1.0.5: has "^1.0.3" side-channel "^1.0.4" +ip-address@^9.0.5: + version "9.0.5" + resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a" + integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g== + dependencies: + jsbn "1.1.0" + sprintf-js "^1.1.3" + ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz" @@ -8047,6 +8075,11 @@ js-yaml@^3.10.0: argparse "^1.0.7" esprima "^4.0.0" +jsbn@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" + integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A== + jsdom@^23.0.1: version "23.0.1" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-23.0.1.tgz#ede7ff76e89ca035b11178d200710d8982ebfee0" @@ -9172,7 +9205,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.0.0, ms@^2.1.1: +ms@2.1.3, ms@^2.0.0, ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -9249,11 +9282,16 @@ n12@0.4.0: resolved "https://registry.yarnpkg.com/n12/-/n12-0.4.0.tgz#363058560b435e6857b5e039ed5eab08c5122e5e" integrity sha512-p/hj4zQ8d3pbbFLQuN1K9honUxiDDhueOWyFLw/XgBv+wZCE44bcLH4CIcsolOceJQduh4Jf7m/LfaTxyGmGtQ== -nan@^2.16.0, nan@^2.17.0, nan@^2.19.0: +nan@^2.16.0, nan@^2.17.0: version "2.20.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.20.0.tgz#08c5ea813dd54ed16e5bd6505bf42af4f7838ca3" integrity sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw== +nan@^2.19.0: + version "2.22.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.22.0.tgz#31bc433fc33213c97bad36404bb68063de604de3" + integrity sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw== + nanoid@3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" @@ -9971,21 +10009,21 @@ p-waterfall@2.1.1: dependencies: p-reduce "^2.0.0" -pac-proxy-agent@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz#6b9ddc002ec3ff0ba5fdf4a8a21d363bcc612d75" - integrity sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A== +pac-proxy-agent@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-7.1.0.tgz#da7c3b5c4cccc6655aaafb701ae140fb23f15df2" + integrity sha512-Z5FnLVVZSnX7WjBg0mhDtydeRZ1xMcATZThjySQUHqr+0ksP8kqaw23fNKkaaN/Z8gwLUs/W7xdl0I75eP2Xyw== dependencies: "@tootallnate/quickjs-emscripten" "^0.23.0" - agent-base "^7.0.2" + agent-base "^7.1.2" debug "^4.3.4" get-uri "^6.0.1" http-proxy-agent "^7.0.0" - https-proxy-agent "^7.0.2" - pac-resolver "^7.0.0" - socks-proxy-agent "^8.0.2" + https-proxy-agent "^7.0.6" + pac-resolver "^7.0.1" + socks-proxy-agent "^8.0.5" -pac-resolver@^7.0.0: +pac-resolver@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-7.0.1.tgz#54675558ea368b64d210fd9c92a640b5f3b8abb6" integrity sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg== @@ -10418,19 +10456,19 @@ proxy-addr@^2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" -proxy-agent@^6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-6.4.0.tgz#b4e2dd51dee2b377748aef8d45604c2d7608652d" - integrity sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ== +proxy-agent@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-6.5.0.tgz#9e49acba8e4ee234aacb539f89ed9c23d02f232d" + integrity sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A== dependencies: - agent-base "^7.0.2" + agent-base "^7.1.2" debug "^4.3.4" http-proxy-agent "^7.0.1" - https-proxy-agent "^7.0.3" + https-proxy-agent "^7.0.6" lru-cache "^7.14.1" - pac-proxy-agent "^7.0.1" + pac-proxy-agent "^7.1.0" proxy-from-env "^1.1.0" - socks-proxy-agent "^8.0.2" + socks-proxy-agent "^8.0.5" proxy-from-env@^1.1.0: version "1.1.0" @@ -11317,16 +11355,16 @@ socks-proxy-agent@^7.0.0: debug "^4.3.3" socks "^2.6.2" -socks-proxy-agent@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz#5acbd7be7baf18c46a3f293a840109a430a640ad" - integrity sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g== +socks-proxy-agent@^8.0.5: + version "8.0.5" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz#b9cdb4e7e998509d7659d689ce7697ac21645bee" + integrity sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw== dependencies: - agent-base "^7.0.2" + agent-base "^7.1.2" debug "^4.3.4" - socks "^2.7.1" + socks "^2.8.3" -socks@^2.6.2, socks@^2.7.1: +socks@^2.6.2: version "2.7.1" resolved "https://registry.yarnpkg.com/socks/-/socks-2.7.1.tgz#d8e651247178fde79c0663043e07240196857d55" integrity sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ== @@ -11334,6 +11372,14 @@ socks@^2.6.2, socks@^2.7.1: ip "^2.0.0" smart-buffer "^4.2.0" +socks@^2.8.3: + version "2.8.3" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.8.3.tgz#1ebd0f09c52ba95a09750afe3f3f9f724a800cb5" + integrity sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw== + dependencies: + ip-address "^9.0.5" + smart-buffer "^4.2.0" + sonic-boom@^3.7.0: version "3.8.0" resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-3.8.0.tgz#e442c5c23165df897d77c3c14ef3ca40dec66a66" @@ -11426,6 +11472,11 @@ sprintf-js@^1.1.2: resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz" integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug== +sprintf-js@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a" + integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA== + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" @@ -11782,9 +11833,9 @@ symbol-tree@^3.2.4: integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== systeminformation@^5.22.9: - version "5.22.9" - resolved "https://registry.yarnpkg.com/systeminformation/-/systeminformation-5.22.9.tgz#68700a895a48cbf96e2cd6a34c5027d1fe58f053" - integrity sha512-qUWJhQ9JSBhdjzNUQywpvc0icxUAjMY3sZqUoS0GOtaJV9Ijq8s9zEP8Gaqmymn1dOefcICyPXK1L3kgKxlUpg== + version "5.23.8" + resolved "https://registry.yarnpkg.com/systeminformation/-/systeminformation-5.23.8.tgz#b8efa73b36221cbcb432e3fe83dc1878a43f986a" + integrity sha512-Osd24mNKe6jr/YoXLLK3k8TMdzaxDffhpCxgkfgBHcapykIkd50HXThM3TCEuHO2pPuCsSx2ms/SunqhU5MmsQ== tar-fs@^3.0.4, tar-fs@^3.0.6: version "3.0.6" From 5916e00224eb8b4d6392e1d088c8f6231d00f79f Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 23 Dec 2024 10:26:05 +0000 Subject: [PATCH 02/12] chore: fix import head late (> 4 sec) rate panel (#7323) --- dashboards/lodestar_summary.json | 89 +++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 30 deletions(-) diff --git a/dashboards/lodestar_summary.json b/dashboards/lodestar_summary.json index 87eaed30bd3..a3bfbd61f38 100644 --- a/dashboards/lodestar_summary.json +++ b/dashboards/lodestar_summary.json @@ -104,6 +104,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -351,10 +352,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -368,7 +371,6 @@ } ], "title": "Peer Count", - "transformations": [], "type": "stat" }, { @@ -401,10 +403,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -450,10 +454,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -499,10 +505,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -552,10 +560,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "value" + "textMode": "value", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -603,10 +613,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "value" + "textMode": "value", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -654,10 +666,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -724,10 +738,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "value" + "textMode": "value", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -776,10 +792,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "name" + "textMode": "name", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -832,10 +850,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "name" + "textMode": "name", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -852,7 +872,6 @@ } ], "title": "Lodestar version", - "transformations": [], "type": "stat" }, { @@ -888,10 +907,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "name" + "textMode": "name", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -920,6 +941,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1014,6 +1036,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1057,7 +1080,6 @@ "y": 9 }, "id": 196, - "links": [], "options": { "graph": {}, "legend": { @@ -1123,6 +1145,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1218,6 +1241,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "GWei", @@ -1324,9 +1348,11 @@ "fields": "", "values": false }, - "textMode": "value_and_name" + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true }, - "pluginVersion": "10.1.1", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -1355,6 +1381,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1509,6 +1536,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1570,7 +1598,7 @@ "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", - "expr": "rate(lodestar_gossip_block_elapsed_time_till_processed_count[$rate_interval])\n- on(instance)\nrate(lodestar_gossip_block_elapsed_time_till_processed_bucket{le=\"4\"}[$rate_interval])", + "expr": "rate(lodestar_gossip_block_elapsed_time_till_processed_count[$rate_interval])\n- on(instance)\nrate(lodestar_gossip_block_elapsed_time_till_processed_bucket{le=\"4.0\"}[$rate_interval])", "legendFormat": "__auto", "range": true, "refId": "A" @@ -1590,6 +1618,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -1670,6 +1699,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -2818,8 +2848,7 @@ ], "refresh": "10s", "revision": 1, - "schemaVersion": 38, - "style": "dark", + "schemaVersion": 39, "tags": [ "lodestar" ], From ad8c10e7d9fd3b66c2e49133fcb2b2a5f7846c6d Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Thu, 2 Jan 2025 09:16:35 +0000 Subject: [PATCH 03/12] chore: use stable firefox release in browser tests (#7318) * chore: use stable firefox release in browser tests * Update browser version for driver --------- Co-authored-by: Nazar Hussain --- .github/workflows/test.yml | 4 ++-- vitest.base.browser.config.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 47e17c56f04..4e4aa33a4d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -176,9 +176,9 @@ jobs: with: node: ${{ matrix.node }} - name: Install Chrome browser - run: npx @puppeteer/browsers install chromedriver@latest --path /tmp + run: npx @puppeteer/browsers install chromedriver@stable --path /tmp - name: Install Firefox browser - run: npx @puppeteer/browsers install firefox@latest --path /tmp + run: npx @puppeteer/browsers install firefox@stable --path /tmp - name: Browser tests run: | export DISPLAY=':99.0' diff --git a/vitest.base.browser.config.ts b/vitest.base.browser.config.ts index d5430b66236..8f0f8ef0f46 100644 --- a/vitest.base.browser.config.ts +++ b/vitest.base.browser.config.ts @@ -51,7 +51,7 @@ export default defineConfig({ screenshotFailures: false, providerOptions: { capabilities: { - browserVersion: "latest", + browserVersion: "stable", }, }, }, From 94dfa017a0c0f3359355c3121724d4c1380f0a6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:37:18 +0000 Subject: [PATCH 04/12] chore(deps): bump http-proxy-middleware from 2.0.6 to 2.0.7 in /docs (#7200) Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7. - [Release notes](https://github.com/chimurai/http-proxy-middleware/releases) - [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md) - [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7) --- updated-dependencies: - dependency-name: http-proxy-middleware dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/yarn.lock b/docs/yarn.lock index 80cd3a321a5..16ac9277b49 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -5407,9 +5407,9 @@ http-parser-js@>=0.5.1: integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q== http-proxy-middleware@^2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f" - integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw== + version "2.0.7" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" + integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== dependencies: "@types/http-proxy" "^1.17.8" http-proxy "^1.18.1" From 690ee6af6184ff1eff8477d2db2aaf87d4946ade Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 6 Jan 2025 21:12:09 +0000 Subject: [PATCH 05/12] feat: increase default gas limit to 36M (#7304) --- .../validator-management/proposer-config.md | 4 ++-- packages/api/test/unit/keymanager/testData.ts | 2 +- .../test/sim/electra-interop.test.ts | 2 +- .../e2e/propserConfigfromKeymanager.test.ts | 4 ++-- .../unit/validator/parseProposerConfig.test.ts | 4 ++-- .../validator/proposerConfigs/invalidData.yaml | 16 ++++++++-------- .../validator/proposerConfigs/validData.yaml | 18 +++++++++--------- .../validator/src/services/validatorStore.ts | 2 +- .../validator/test/unit/validatorStore.test.ts | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/pages/run/validator-management/proposer-config.md b/docs/pages/run/validator-management/proposer-config.md index 444789a9f8b..38769ebc187 100644 --- a/docs/pages/run/validator-management/proposer-config.md +++ b/docs/pages/run/validator-management/proposer-config.md @@ -15,7 +15,7 @@ proposer_config: strict_fee_recipient_check: false fee_recipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" builder: - gas_limit: "30000000" + gas_limit: "36000000" selection: "executionalways" boost_factor: "0" "0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d": @@ -29,7 +29,7 @@ default_config: strict_fee_recipient_check: true fee_recipient: "0xcccccccccccccccccccccccccccccccccccccccc" builder: - gas_limit: "30000000" + gas_limit: "36000000" selection: "default" boost_factor: "90" ``` diff --git a/packages/api/test/unit/keymanager/testData.ts b/packages/api/test/unit/keymanager/testData.ts index 6b17611d1e0..f954eea7aae 100644 --- a/packages/api/test/unit/keymanager/testData.ts +++ b/packages/api/test/unit/keymanager/testData.ts @@ -12,7 +12,7 @@ import {GenericServerTestCases} from "../../utils/genericServerTest.js"; const pubkeyRand = "0x84105a985058fc8740a48bf1ede9d223ef09e8c6b1735ba0a55cf4a9ff2ff92376b778798365e488dab07a652eb04576"; const ethaddressRand = "0xabcf8e0d4e9587369b2301d0790347320302cc09"; const graffitiRandUtf8 = "636861696e736166652f6c6f64657374"; -const gasLimitRand = 30_000_000; +const gasLimitRand = 36_000_000; const builderBoostFactorRand = BigInt(100); export const testData: GenericServerTestCases = { diff --git a/packages/beacon-node/test/sim/electra-interop.test.ts b/packages/beacon-node/test/sim/electra-interop.test.ts index 148f210f7f6..c46f5179e07 100644 --- a/packages/beacon-node/test/sim/electra-interop.test.ts +++ b/packages/beacon-node/test/sim/electra-interop.test.ts @@ -158,7 +158,7 @@ describe("executionEngine / ExecutionEngineHttp", () => { 256 ), prevRandao: dataToBytes("0x0000000000000000000000000000000000000000000000000000000000000000", 32), - gasLimit: 30000000, + gasLimit: 36000000, gasUsed: 84714, timestamp: 16, extraData: dataToBytes("0x", 0), diff --git a/packages/cli/test/e2e/propserConfigfromKeymanager.test.ts b/packages/cli/test/e2e/propserConfigfromKeymanager.test.ts index 26bf3e618c2..e30d65178c7 100644 --- a/packages/cli/test/e2e/propserConfigfromKeymanager.test.ts +++ b/packages/cli/test/e2e/propserConfigfromKeymanager.test.ts @@ -16,13 +16,13 @@ describe("import keystores from api, test DefaultProposerConfig", () => { const defaultOptions = { suggestedFeeRecipient: "0x0000000000000000000000000000000000000000", - gasLimit: 30_000_000, + gasLimit: 36_000_000, graffiti: "aaaa", }; const updatedOptions = { suggestedFeeRecipient: "0xcccccccccccccccccccccccccccccccccccccccc", - gasLimit: 35_000_000, + gasLimit: 40_000_000, graffiti: "bbbb", }; diff --git a/packages/cli/test/unit/validator/parseProposerConfig.test.ts b/packages/cli/test/unit/validator/parseProposerConfig.test.ts index f10d5d7cc08..42138dbe7d2 100644 --- a/packages/cli/test/unit/validator/parseProposerConfig.test.ts +++ b/packages/cli/test/unit/validator/parseProposerConfig.test.ts @@ -14,7 +14,7 @@ const testValue = { strictFeeRecipientCheck: true, feeRecipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", builder: { - gasLimit: 30000000, + gasLimit: 36000000, selection: undefined, boostFactor: undefined, }, @@ -35,7 +35,7 @@ const testValue = { strictFeeRecipientCheck: true, feeRecipient: "0xcccccccccccccccccccccccccccccccccccccccc", builder: { - gasLimit: 30000000, + gasLimit: 36000000, selection: routes.validator.BuilderSelection.MaxProfit, boostFactor: BigInt(50), }, diff --git a/packages/cli/test/unit/validator/proposerConfigs/invalidData.yaml b/packages/cli/test/unit/validator/proposerConfigs/invalidData.yaml index 361a8aee0a6..63dca6d46ea 100644 --- a/packages/cli/test/unit/validator/proposerConfigs/invalidData.yaml +++ b/packages/cli/test/unit/validator/proposerConfigs/invalidData.yaml @@ -1,20 +1,20 @@ proposer_config: - '0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c': + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c": graffiti: 123 strict_fee_recipient_check: "true" - fee_recipient: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + fee_recipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" builder: enabled: true - gas_limit: "30000000" - '0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d': - fee_recipient: '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + gas_limit: "36000000" + "0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d": + fee_recipient: "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" builder: enabled: "true" gas_limit: "35000000" default_config: - graffiti: 'default graffiti' + graffiti: "default graffiti" strict_fee_recipient_check: true - fee_recipient: '0xcccccccccccccccccccccccccccccccccccccccc' + fee_recipient: "0xcccccccccccccccccccccccccccccccccccccccc" builder: enabled: true - gas_limit: "30000000" + gas_limit: "36000000" diff --git a/packages/cli/test/unit/validator/proposerConfigs/validData.yaml b/packages/cli/test/unit/validator/proposerConfigs/validData.yaml index 71dabb9d900..9532ed4ce00 100644 --- a/packages/cli/test/unit/validator/proposerConfigs/validData.yaml +++ b/packages/cli/test/unit/validator/proposerConfigs/validData.yaml @@ -1,21 +1,21 @@ proposer_config: - '0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c': - graffiti: 'graffiti' + "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c": + graffiti: "graffiti" strict_fee_recipient_check: true - fee_recipient: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + fee_recipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" builder: - gas_limit: "30000000" - '0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d': - fee_recipient: '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' + gas_limit: "36000000" + "0xa4855c83d868f772a579133d9f23818008417b743e8447e235d8eb78b1d8f8a9f63f98c551beb7de254400f89592314d": + fee_recipient: "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" builder: gas_limit: "35000000" selection: "builderalways" boost_factor: "18446744073709551616" default_config: - graffiti: 'default graffiti' + graffiti: "default graffiti" strict_fee_recipient_check: "true" - fee_recipient: '0xcccccccccccccccccccccccccccccccccccccccc' + fee_recipient: "0xcccccccccccccccccccccccccccccccccccccccc" builder: - gas_limit: "30000000" + gas_limit: "36000000" selection: "maxprofit" boost_factor: "50" diff --git a/packages/validator/src/services/validatorStore.ts b/packages/validator/src/services/validatorStore.ts index e80c0b291ef..7e052fbd73f 100644 --- a/packages/validator/src/services/validatorStore.ts +++ b/packages/validator/src/services/validatorStore.ts @@ -131,7 +131,7 @@ type ValidatorData = ProposerConfig & { export const defaultOptions = { suggestedFeeRecipient: "0x0000000000000000000000000000000000000000", - defaultGasLimit: 30_000_000, + defaultGasLimit: 36_000_000, builderSelection: routes.validator.BuilderSelection.ExecutionOnly, builderAliasSelection: routes.validator.BuilderSelection.Default, builderBoostFactor: BigInt(100), diff --git a/packages/validator/test/unit/validatorStore.test.ts b/packages/validator/test/unit/validatorStore.test.ts index d32acf41647..aa89f392725 100644 --- a/packages/validator/test/unit/validatorStore.test.ts +++ b/packages/validator/test/unit/validatorStore.test.ts @@ -26,7 +26,7 @@ describe("ValidatorStore", () => { strictFeeRecipientCheck: true, feeRecipient: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", builder: { - gasLimit: 30000000, + gasLimit: 36000000, selection: routes.validator.BuilderSelection.ExecutionOnly, }, }, From d41fb55ea4553494551da6808cb11dffeb7794a9 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 7 Jan 2025 13:26:54 +0000 Subject: [PATCH 06/12] chore: add extra new lines to giraffe banner (#7334) --- packages/beacon-node/src/chain/blocks/utils/giraffeBanner.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/beacon-node/src/chain/blocks/utils/giraffeBanner.ts b/packages/beacon-node/src/chain/blocks/utils/giraffeBanner.ts index d3987831a06..857e07438da 100644 --- a/packages/beacon-node/src/chain/blocks/utils/giraffeBanner.ts +++ b/packages/beacon-node/src/chain/blocks/utils/giraffeBanner.ts @@ -1,4 +1,5 @@ export const ELECTRA_GIRAFFE_BANNER = String.raw` + 2048 :--: :-@==+-: @@ -24,4 +25,5 @@ export const ELECTRA_GIRAFFE_BANNER = String.raw` *: :- =- :- --: =: ::*-: :::: :-: + `; From c9bb826a84aa5408d51c75bc7d47e2937c59ce1e Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 7 Jan 2025 15:13:44 +0000 Subject: [PATCH 07/12] chore: fix beacon proposer cache unit tests (#7335) * chore: fix beacon proposer cache unit tests * Assign values to named constants --- .../unit/chain/beaconProposerCache.test.ts | 45 +++++++++++++++++++ .../test/unit/chain/beaconProposerCache.ts | 37 --------------- 2 files changed, 45 insertions(+), 37 deletions(-) create mode 100644 packages/beacon-node/test/unit/chain/beaconProposerCache.test.ts delete mode 100644 packages/beacon-node/test/unit/chain/beaconProposerCache.ts diff --git a/packages/beacon-node/test/unit/chain/beaconProposerCache.test.ts b/packages/beacon-node/test/unit/chain/beaconProposerCache.test.ts new file mode 100644 index 00000000000..e8f0e410c3f --- /dev/null +++ b/packages/beacon-node/test/unit/chain/beaconProposerCache.test.ts @@ -0,0 +1,45 @@ +import {beforeEach, describe, expect, it} from "vitest"; +import {BeaconProposerCache} from "../../../src/chain/beaconProposerCache.js"; + +describe("BeaconProposerCache", () => { + const suggestedFeeRecipient = "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; + const feeRecipient1 = "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; + const feeRecipient2 = "0xcccccccccccccccccccccccccccccccccccccccc"; + + const validatorIndex1 = 23; + const validatorIndex2 = 43; + const unknownValidatorIndex = 32; + + let cache: BeaconProposerCache; + + beforeEach(() => { + // max 2 items + cache = new BeaconProposerCache({suggestedFeeRecipient}); + cache.add(1, {validatorIndex: validatorIndex1, feeRecipient: feeRecipient1}); + cache.add(3, {validatorIndex: validatorIndex2, feeRecipient: feeRecipient2}); + }); + + it("get default", () => { + expect(cache.getOrDefault(unknownValidatorIndex)).toBe(suggestedFeeRecipient); + }); + + it("get what has been set", () => { + expect(cache.get(validatorIndex1)).toBe(feeRecipient1); + }); + + it("override and get latest", () => { + const newFeeRecipient = "0xdddddddddddddddddddddddddddddddddddddddd"; + cache.add(5, {validatorIndex: validatorIndex1, feeRecipient: newFeeRecipient}); + expect(cache.get(validatorIndex1)).toBe(newFeeRecipient); + }); + + it("prune", () => { + cache.prune(4); + + // Default for what has been pruned + expect(cache.getOrDefault(validatorIndex1)).toBe(suggestedFeeRecipient); + + // Original for what hasn't been pruned + expect(cache.get(validatorIndex2)).toBe(feeRecipient2); + }); +}); diff --git a/packages/beacon-node/test/unit/chain/beaconProposerCache.ts b/packages/beacon-node/test/unit/chain/beaconProposerCache.ts deleted file mode 100644 index 96178d50873..00000000000 --- a/packages/beacon-node/test/unit/chain/beaconProposerCache.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {beforeEach, describe, expect, it} from "vitest"; -import {BeaconProposerCache} from "../../../src/chain/beaconProposerCache.js"; - -const suggestedFeeRecipient = "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; -describe("BeaconProposerCache", () => { - let cache: BeaconProposerCache; - - beforeEach(() => { - // max 2 items - cache = new BeaconProposerCache({suggestedFeeRecipient}); - cache.add(1, {validatorIndex: 23, feeRecipient: "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}); - cache.add(3, {validatorIndex: 43, feeRecipient: "0xcccccccccccccccccccccccccccccccccccccccc"}); - }); - - it("get default", () => { - expect(cache.get(32)).toBe("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - }); - - it("get what has been set", () => { - expect(cache.get(23)).toBe("0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); - }); - - it("override and get latest", () => { - cache.add(5, {validatorIndex: 23, feeRecipient: "0xdddddddddddddddddddddddddddddddddddddddd"}); - expect(cache.get(23)).toBe("0xdddddddddddddddddddddddddddddddddddddddd"); - }); - - it("prune", () => { - cache.prune(4); - - // Default for what has been pruned - expect(cache.get(23)).toBe("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); - - // Original for what hasn't been pruned - expect(cache.get(43)).toBe("0xcccccccccccccccccccccccccccccccccccccccc"); - }); -}); From cb1c695a77c56a7e9979212d1039eb401b76a97e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:40:12 +0000 Subject: [PATCH 08/12] chore(deps): bump nanoid from 3.3.7 to 3.3.8 in /docs (#7292) Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8) --- updated-dependencies: - dependency-name: nanoid dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/yarn.lock b/docs/yarn.lock index 16ac9277b49..894df90208f 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -7089,9 +7089,9 @@ multicast-dns@^7.2.5: thunky "^1.0.2" nanoid@^3.3.7: - version "3.3.7" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" - integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== + version "3.3.8" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" + integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== negotiator@0.6.3: version "0.6.3" From 877b1ae68dbfea2175dff24ceabc001234b2daa4 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Wed, 8 Jan 2025 17:44:12 +0000 Subject: [PATCH 09/12] refactor: use `SubnetID` type from CL spec instead of `number` (#7298) * refactor: use `SubnetID` type from CL spec instead of `number` * Consistently use SubnetID for sync committee --- .../src/api/impl/validator/utils.ts | 4 ++-- .../src/chain/errors/blobSidecarError.ts | 4 ++-- .../chain/opPools/syncCommitteeMessagePool.ts | 11 ++++----- .../opPools/syncContributionAndProofPool.ts | 7 +++--- .../chain/seenCache/seenAttestationData.ts | 4 ++-- .../src/chain/seenCache/seenCommittee.ts | 2 +- .../src/chain/validation/attestation.ts | 11 +++++---- .../src/chain/validation/blobSidecar.ts | 6 ++--- .../src/chain/validation/syncCommittee.ts | 8 +++---- .../src/metrics/validatorMonitor.ts | 4 ++-- .../beacon-node/src/network/core/metrics.ts | 13 +++++----- .../src/network/gossip/gossipsub.ts | 3 ++- .../src/network/gossip/interface.ts | 7 +++--- .../beacon-node/src/network/gossip/metrics.ts | 5 ++-- packages/beacon-node/src/network/interface.ts | 7 +++--- packages/beacon-node/src/network/network.ts | 7 +++--- .../beacon-node/src/network/peers/discover.ts | 3 ++- .../network/peers/utils/prioritizePeers.ts | 8 +++---- .../src/network/peers/utils/subnetMap.ts | 24 +++++++++---------- .../network/processor/aggregatorTracker.ts | 10 ++++---- .../src/network/processor/gossipHandlers.ts | 4 ++-- .../src/network/subnets/attnetsService.ts | 7 +++--- .../src/network/subnets/interface.ts | 6 ++--- .../attestation/validateAttestation.test.ts | 4 ++-- .../network/subnets/attnetsService.test.ts | 15 ++++++------ packages/beacon-node/test/utils/network.ts | 5 ++-- .../test/utils/validationData/attestation.ts | 4 ++-- .../state-transition/src/cache/epochCache.ts | 3 ++- packages/types/src/primitive/types.ts | 1 + 29 files changed, 102 insertions(+), 95 deletions(-) diff --git a/packages/beacon-node/src/api/impl/validator/utils.ts b/packages/beacon-node/src/api/impl/validator/utils.ts index b8e5aa525f2..f7d69ec9784 100644 --- a/packages/beacon-node/src/api/impl/validator/utils.ts +++ b/packages/beacon-node/src/api/impl/validator/utils.ts @@ -1,7 +1,7 @@ import {routes} from "@lodestar/api"; import {ATTESTATION_SUBNET_COUNT} from "@lodestar/params"; import {BeaconStateAllForks, computeSlotsSinceEpochStart} from "@lodestar/state-transition"; -import {BLSPubkey, CommitteeIndex, ProducedBlockSource, Slot, ValidatorIndex} from "@lodestar/types"; +import {BLSPubkey, CommitteeIndex, ProducedBlockSource, Slot, SubnetID, ValidatorIndex} from "@lodestar/types"; import {MAX_BUILDER_BOOST_FACTOR} from "@lodestar/validator"; import {BlockSelectionResult, BuilderBlockSelectionReason, EngineBlockSelectionReason} from "./index.js"; @@ -9,7 +9,7 @@ export function computeSubnetForCommitteesAtSlot( slot: Slot, committeesAtSlot: number, committeeIndex: CommitteeIndex -): number { +): SubnetID { const slotsSinceEpochStart = computeSlotsSinceEpochStart(slot); const committeesSinceEpochStart = committeesAtSlot * slotsSinceEpochStart; return (committeesSinceEpochStart + committeeIndex) % ATTESTATION_SUBNET_COUNT; diff --git a/packages/beacon-node/src/chain/errors/blobSidecarError.ts b/packages/beacon-node/src/chain/errors/blobSidecarError.ts index 216ad9206db..bf7628b2788 100644 --- a/packages/beacon-node/src/chain/errors/blobSidecarError.ts +++ b/packages/beacon-node/src/chain/errors/blobSidecarError.ts @@ -1,4 +1,4 @@ -import {RootHex, Slot, ValidatorIndex} from "@lodestar/types"; +import {RootHex, Slot, SubnetID, ValidatorIndex} from "@lodestar/types"; import {GossipActionError} from "./gossipValidation.js"; export enum BlobSidecarErrorCode { @@ -28,7 +28,7 @@ export enum BlobSidecarErrorCode { export type BlobSidecarErrorType = | {code: BlobSidecarErrorCode.INDEX_TOO_LARGE; blobIdx: number; maxBlobsPerBlock: number} - | {code: BlobSidecarErrorCode.INVALID_INDEX; blobIdx: number; subnet: number} + | {code: BlobSidecarErrorCode.INVALID_INDEX; blobIdx: number; subnet: SubnetID} | {code: BlobSidecarErrorCode.INVALID_KZG; blobIdx: number} | {code: BlobSidecarErrorCode.INVALID_KZG_TXS} | {code: BlobSidecarErrorCode.INCORRECT_SLOT; blockSlot: Slot; blobSlot: Slot; blobIdx: number} diff --git a/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts b/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts index 6551ee62549..cd56b309c2f 100644 --- a/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts +++ b/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts @@ -1,7 +1,7 @@ import {Signature, aggregateSignatures} from "@chainsafe/blst"; import {BitArray} from "@chainsafe/ssz"; import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; -import {Root, Slot, SubcommitteeIndex, altair} from "@lodestar/types"; +import {Root, Slot, SubcommitteeIndex, SubnetID, altair} from "@lodestar/types"; import {MapDef, toRootHex} from "@lodestar/utils"; import {IClock} from "../../util/clock.js"; import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js"; @@ -26,7 +26,6 @@ type ContributionFast = Omit> - >(() => new MapDef>(() => new Map())); + MapDef> + >(() => new MapDef>(() => new Map())); private lowestPermissibleSlot = 0; constructor( @@ -62,7 +61,7 @@ export class SyncCommitteeMessagePool { } // TODO: indexInSubcommittee: number should be indicesInSyncCommittee - add(subnet: Subnet, signature: altair.SyncCommitteeMessage, indexInSubcommittee: number): InsertOutcome { + add(subnet: SubnetID, signature: altair.SyncCommitteeMessage, indexInSubcommittee: number): InsertOutcome { const {slot, beaconBlockRoot} = signature; const rootHex = toRootHex(beaconBlockRoot); const lowestPermissibleSlot = this.lowestPermissibleSlot; @@ -146,7 +145,7 @@ function aggregateSignatureInto( * Format `signature` into an efficient `contribution` to add more signatures in with aggregateSignatureInto() */ function signatureToAggregate( - subnet: number, + subnet: SubnetID, signature: altair.SyncCommitteeMessage, indexInSubcommittee: number ): ContributionFast { diff --git a/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts b/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts index 0f25032e1d7..b38b6c1d117 100644 --- a/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts +++ b/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts @@ -2,7 +2,7 @@ import {Signature, aggregateSignatures} from "@chainsafe/blst"; import {BitArray} from "@chainsafe/ssz"; import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition"; -import {Root, Slot, altair, ssz} from "@lodestar/types"; +import {Root, Slot, SubnetID, altair, ssz} from "@lodestar/types"; import {MapDef, toRootHex} from "@lodestar/utils"; import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js"; import {pruneBySlot, signatureFromBytesNoCheck} from "./utils.js"; @@ -33,7 +33,6 @@ export type SyncContributionFast = { /** Hex string of `contribution.beaconBlockRoot` */ type BlockRootHex = string; -type Subnet = number; /** * Cache SyncCommitteeContribution and seen ContributionAndProof. @@ -43,8 +42,8 @@ type Subnet = number; export class SyncContributionAndProofPool { private readonly bestContributionBySubnetRootBySlot = new MapDef< Slot, - MapDef> - >(() => new MapDef>(() => new Map())); + MapDef> + >(() => new MapDef>(() => new Map())); private lowestPermissibleSlot = 0; diff --git a/packages/beacon-node/src/chain/seenCache/seenAttestationData.ts b/packages/beacon-node/src/chain/seenCache/seenAttestationData.ts index 8e0dfcb3bd9..8c5df69e783 100644 --- a/packages/beacon-node/src/chain/seenCache/seenAttestationData.ts +++ b/packages/beacon-node/src/chain/seenCache/seenAttestationData.ts @@ -1,5 +1,5 @@ import {BitArray} from "@chainsafe/ssz"; -import {CommitteeIndex, RootHex, Slot, phase0} from "@lodestar/types"; +import {CommitteeIndex, RootHex, Slot, SubnetID, phase0} from "@lodestar/types"; import {MapDef} from "@lodestar/utils"; import {Metrics} from "../../metrics/metrics.js"; import {InsertOutcome} from "../opPools/types.js"; @@ -23,7 +23,7 @@ export type AttestationDataCacheEntry = { // caching this for 3 slots take 600 instances max, this is nothing compared to attestations processed per slot // for example in a mainnet node subscribing to all subnets, attestations are processed up to 20k per slot attestationData: phase0.AttestationData; - subnet: number; + subnet: SubnetID; }; export enum RejectReason { diff --git a/packages/beacon-node/src/chain/seenCache/seenCommittee.ts b/packages/beacon-node/src/chain/seenCache/seenCommittee.ts index 9d7e930c94d..44411eaf211 100644 --- a/packages/beacon-node/src/chain/seenCache/seenCommittee.ts +++ b/packages/beacon-node/src/chain/seenCache/seenCommittee.ts @@ -38,6 +38,6 @@ export class SeenSyncCommitteeMessages { } } -function seenCacheKey(subnet: number, validatorIndex: ValidatorIndex): ValidatorSubnetKey { +function seenCacheKey(subnet: SubcommitteeIndex, validatorIndex: ValidatorIndex): ValidatorSubnetKey { return `${subnet}-${validatorIndex}`; } diff --git a/packages/beacon-node/src/chain/validation/attestation.ts b/packages/beacon-node/src/chain/validation/attestation.ts index e49a3f79450..05f3faeaebd 100644 --- a/packages/beacon-node/src/chain/validation/attestation.ts +++ b/packages/beacon-node/src/chain/validation/attestation.ts @@ -27,6 +27,7 @@ import { Root, RootHex, Slot, + SubnetID, electra, isElectraAttestation, phase0, @@ -58,7 +59,7 @@ export type BatchResult = { export type AttestationValidationResult = { attestation: Attestation; indexedAttestation: IndexedAttestation; - subnet: number; + subnet: SubnetID; attDataRootHex: RootHex; committeeIndex: CommitteeIndex; }; @@ -93,7 +94,7 @@ export async function validateGossipAttestationsSameAttData( fork: ForkName, chain: IBeaconChain, attestationOrBytesArr: GossipAttestation[], - subnet: number, + subnet: SubnetID, // for unit test, consumers do not need to pass this step0ValidationFn = validateAttestationNoSignatureCheck ): Promise { @@ -232,7 +233,7 @@ async function validateAttestationNoSignatureCheck( chain: IBeaconChain, attestationOrBytes: AttestationOrBytes, /** Optional, to allow verifying attestations through API with unknown subnet */ - subnet: number | null + subnet: SubnetID | null ): Promise { // Do checks in this order: // - do early checks (w/o indexed attestation) @@ -342,7 +343,7 @@ async function validateAttestationNoSignatureCheck( let committeeValidatorIndices: Uint32Array; let getSigningRoot: () => Uint8Array; - let expectedSubnet: number; + let expectedSubnet: SubnetID; if (attestationOrCache.cache) { committeeValidatorIndices = attestationOrCache.cache.committeeValidatorIndices; const signingRoot = attestationOrCache.cache.signingRoot; @@ -762,7 +763,7 @@ export function getCommitteeIndices( /** * Compute the correct subnet for a slot/committee index */ -export function computeSubnetForSlot(shuffling: EpochShuffling, slot: number, committeeIndex: number): number { +export function computeSubnetForSlot(shuffling: EpochShuffling, slot: number, committeeIndex: number): SubnetID { const slotsSinceEpochStart = slot % SLOTS_PER_EPOCH; const committeesSinceEpochStart = shuffling.committeesPerSlot * slotsSinceEpochStart; return (committeesSinceEpochStart + committeeIndex) % ATTESTATION_SUBNET_COUNT; diff --git a/packages/beacon-node/src/chain/validation/blobSidecar.ts b/packages/beacon-node/src/chain/validation/blobSidecar.ts index b79db77e393..228bf9f788f 100644 --- a/packages/beacon-node/src/chain/validation/blobSidecar.ts +++ b/packages/beacon-node/src/chain/validation/blobSidecar.ts @@ -1,7 +1,7 @@ import {ChainConfig} from "@lodestar/config"; import {KZG_COMMITMENT_INCLUSION_PROOF_DEPTH, KZG_COMMITMENT_SUBTREE_INDEX0} from "@lodestar/params"; import {computeStartSlotAtEpoch, getBlockHeaderProposerSignatureSet} from "@lodestar/state-transition"; -import {BlobIndex, Root, Slot, deneb, ssz} from "@lodestar/types"; +import {BlobIndex, Root, Slot, SubnetID, deneb, ssz} from "@lodestar/types"; import {toRootHex, verifyMerkleBranch} from "@lodestar/utils"; import {byteArrayEquals} from "../../util/bytes.js"; @@ -14,7 +14,7 @@ import {RegenCaller} from "../regen/index.js"; export async function validateGossipBlobSidecar( chain: IBeaconChain, blobSidecar: deneb.BlobSidecar, - subnet: number + subnet: SubnetID ): Promise { const blobSlot = blobSidecar.signedBlockHeader.message.slot; @@ -236,6 +236,6 @@ function validateInclusionProof(blobSidecar: deneb.BlobSidecar): boolean { ); } -function computeSubnetForBlobSidecar(blobIndex: BlobIndex, config: ChainConfig): number { +function computeSubnetForBlobSidecar(blobIndex: BlobIndex, config: ChainConfig): SubnetID { return blobIndex % config.BLOB_SIDECAR_SUBNET_COUNT; } diff --git a/packages/beacon-node/src/chain/validation/syncCommittee.ts b/packages/beacon-node/src/chain/validation/syncCommittee.ts index c563bf7cf6b..fb4b7741b4f 100644 --- a/packages/beacon-node/src/chain/validation/syncCommittee.ts +++ b/packages/beacon-node/src/chain/validation/syncCommittee.ts @@ -1,6 +1,6 @@ import {SYNC_COMMITTEE_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; import {CachedBeaconStateAllForks} from "@lodestar/state-transition"; -import {altair} from "@lodestar/types"; +import {SubnetID, altair} from "@lodestar/types"; import {toRootHex} from "@lodestar/utils"; import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js"; import {IBeaconChain} from "../interface.js"; @@ -14,7 +14,7 @@ type IndexInSubcommittee = number; export async function validateGossipSyncCommittee( chain: IBeaconChain, syncCommittee: altair.SyncCommitteeMessage, - subnet: number + subnet: SubnetID ): Promise<{indexInSubcommittee: IndexInSubcommittee}> { const {slot, validatorIndex, beaconBlockRoot} = syncCommittee; const messageRoot = toRootHex(beaconBlockRoot); @@ -103,7 +103,7 @@ async function validateSyncCommitteeSigOnly( export function validateGossipSyncCommitteeExceptSig( chain: IBeaconChain, headState: CachedBeaconStateAllForks, - subnet: number, + subnet: SubnetID, data: Pick ): IndexInSubcommittee { const {slot, validatorIndex} = data; @@ -144,7 +144,7 @@ export function validateGossipSyncCommitteeExceptSig( */ function getIndexInSubcommittee( headState: CachedBeaconStateAllForks, - subnet: number, + subnet: SubnetID, data: Pick ): IndexInSubcommittee | null { const syncCommittee = headState.epochCtx.getIndexedSyncCommittee(data.slot); diff --git a/packages/beacon-node/src/metrics/validatorMonitor.ts b/packages/beacon-node/src/metrics/validatorMonitor.ts index 401d58af57f..1c9a093656c 100644 --- a/packages/beacon-node/src/metrics/validatorMonitor.ts +++ b/packages/beacon-node/src/metrics/validatorMonitor.ts @@ -10,7 +10,7 @@ import { parseAttesterFlags, parseParticipationFlags, } from "@lodestar/state-transition"; -import {BeaconBlock, RootHex, altair, deneb} from "@lodestar/types"; +import {BeaconBlock, RootHex, SubnetID, altair, deneb} from "@lodestar/types"; import {Epoch, Slot, ValidatorIndex} from "@lodestar/types"; import {IndexedAttestation, SignedAggregateAndProof} from "@lodestar/types"; import {LogData, LogHandler, LogLevel, Logger, MapDef, MapDefMax, toRootHex} from "@lodestar/utils"; @@ -52,7 +52,7 @@ export type ValidatorMonitor = { onPoolSubmitUnaggregatedAttestation( seenTimestampSec: number, indexedAttestation: IndexedAttestation, - subnet: number, + subnet: SubnetID, sentPeers: number ): void; onPoolSubmitAggregatedAttestation( diff --git a/packages/beacon-node/src/network/core/metrics.ts b/packages/beacon-node/src/network/core/metrics.ts index 7d0ef47d84a..0c9155893ce 100644 --- a/packages/beacon-node/src/network/core/metrics.ts +++ b/packages/beacon-node/src/network/core/metrics.ts @@ -1,3 +1,4 @@ +import {SubnetID} from "@lodestar/types"; import {RegistryMetricCreator} from "../../metrics/utils/registryMetricCreator.js"; import {SubnetType} from "../metadata.js"; import {DiscoveredPeerStatus} from "../peers/discover.js"; @@ -194,14 +195,14 @@ export function createNetworkCoreMetrics(register: RegistryMetricCreator) { name: "lodestar_attnets_service_committee_subscriptions_total", help: "Count of committee subscriptions", }), - subscriptionsCommitteeMeshPeers: register.histogram<{subnet: number}>({ + subscriptionsCommitteeMeshPeers: register.histogram<{subnet: SubnetID}>({ name: "lodestar_attnets_service_committee_subscriptions_mesh_peers", help: "Histogram of mesh peers per committee subscription", labelNames: ["subnet"], // Dlow = 6, D = 8, DHi = 12 plus 2 more buckets buckets: [0, 4, 6, 8, 12], }), - subscriptionsCommitteeTimeToStableMesh: register.histogram<{subnet: number}>({ + subscriptionsCommitteeTimeToStableMesh: register.histogram<{subnet: SubnetID}>({ name: "lodestar_attnets_service_committee_subscriptions_time_to_stable_mesh_seconds", help: "Histogram of time until committee subscription is considered healthy (>= 6 mesh peers)", labelNames: ["subnet"], @@ -216,12 +217,12 @@ export function createNetworkCoreMetrics(register: RegistryMetricCreator) { name: "lodestar_attnets_service_long_lived_subscriptions_total", help: "Count of long lived subscriptions", }), - subscribeSubnets: register.gauge<{subnet: number; src: SubnetSource}>({ + subscribeSubnets: register.gauge<{subnet: SubnetID; src: SubnetSource}>({ name: "lodestar_attnets_service_subscribe_subnets_total", help: "Count of subscribe_subnets calls", labelNames: ["subnet", "src"], }), - unsubscribeSubnets: register.gauge<{subnet: number; src: SubnetSource}>({ + unsubscribeSubnets: register.gauge<{subnet: SubnetID; src: SubnetSource}>({ name: "lodestar_attnets_service_unsubscribe_subnets_total", help: "Count of unsubscribe_subnets calls", labelNames: ["subnet", "src"], @@ -237,12 +238,12 @@ export function createNetworkCoreMetrics(register: RegistryMetricCreator) { name: "lodestar_syncnets_service_committee_subscriptions_total", help: "Count of syncnet committee subscriptions", }), - subscribeSubnets: register.gauge<{subnet: number}>({ + subscribeSubnets: register.gauge<{subnet: SubnetID}>({ name: "lodestar_syncnets_service_subscribe_subnets_total", help: "Count of syncnet subscribe_subnets calls", labelNames: ["subnet"], }), - unsubscribeSubnets: register.gauge<{subnet: number}>({ + unsubscribeSubnets: register.gauge<{subnet: SubnetID}>({ name: "lodestar_syncnets_service_unsubscribe_subnets_total", help: "Count of syncnet unsubscribe_subnets calls", labelNames: ["subnet"], diff --git a/packages/beacon-node/src/network/gossip/gossipsub.ts b/packages/beacon-node/src/network/gossip/gossipsub.ts index 9f2b47e21c6..236cc40a8d0 100644 --- a/packages/beacon-node/src/network/gossip/gossipsub.ts +++ b/packages/beacon-node/src/network/gossip/gossipsub.ts @@ -4,6 +4,7 @@ import {PeerScoreParams} from "@chainsafe/libp2p-gossipsub/score"; import {SignaturePolicy, TopicStr} from "@chainsafe/libp2p-gossipsub/types"; import {BeaconConfig} from "@lodestar/config"; import {ATTESTATION_SUBNET_COUNT, ForkName, SLOTS_PER_EPOCH, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {SubnetID} from "@lodestar/types"; import {Logger, Map2d, Map2dArr} from "@lodestar/utils"; import {GOSSIP_MAX_SIZE, GOSSIP_MAX_SIZE_BELLATRIX} from "../../constants/network.js"; @@ -319,7 +320,7 @@ export class Eth2Gossipsub extends GossipSub { * Left pad subnets to two characters. Assumes ATTESTATION_SUBNET_COUNT < 99 * Otherwise grafana sorts the mesh peers chart as: [1,11,12,13,...] */ -function attSubnetLabel(subnet: number): string { +function attSubnetLabel(subnet: SubnetID): string { if (subnet > 9) return String(subnet); return `0${subnet}`; diff --git a/packages/beacon-node/src/network/gossip/interface.ts b/packages/beacon-node/src/network/gossip/interface.ts index be7293524ce..1a91a5bc659 100644 --- a/packages/beacon-node/src/network/gossip/interface.ts +++ b/packages/beacon-node/src/network/gossip/interface.ts @@ -9,6 +9,7 @@ import { SignedAggregateAndProof, SignedBeaconBlock, Slot, + SubnetID, altair, capella, deneb, @@ -54,16 +55,16 @@ export interface IGossipTopic { export type GossipTopicTypeMap = { [GossipType.beacon_block]: {type: GossipType.beacon_block}; - [GossipType.blob_sidecar]: {type: GossipType.blob_sidecar; subnet: number}; + [GossipType.blob_sidecar]: {type: GossipType.blob_sidecar; subnet: SubnetID}; [GossipType.beacon_aggregate_and_proof]: {type: GossipType.beacon_aggregate_and_proof}; - [GossipType.beacon_attestation]: {type: GossipType.beacon_attestation; subnet: number}; + [GossipType.beacon_attestation]: {type: GossipType.beacon_attestation; subnet: SubnetID}; [GossipType.voluntary_exit]: {type: GossipType.voluntary_exit}; [GossipType.proposer_slashing]: {type: GossipType.proposer_slashing}; [GossipType.attester_slashing]: {type: GossipType.attester_slashing}; [GossipType.sync_committee_contribution_and_proof]: { type: GossipType.sync_committee_contribution_and_proof; }; - [GossipType.sync_committee]: {type: GossipType.sync_committee; subnet: number}; + [GossipType.sync_committee]: {type: GossipType.sync_committee; subnet: SubnetID}; [GossipType.light_client_finality_update]: {type: GossipType.light_client_finality_update}; [GossipType.light_client_optimistic_update]: {type: GossipType.light_client_optimistic_update}; [GossipType.bls_to_execution_change]: {type: GossipType.bls_to_execution_change}; diff --git a/packages/beacon-node/src/network/gossip/metrics.ts b/packages/beacon-node/src/network/gossip/metrics.ts index 5ca5d22154c..3e11615b44b 100644 --- a/packages/beacon-node/src/network/gossip/metrics.ts +++ b/packages/beacon-node/src/network/gossip/metrics.ts @@ -1,4 +1,5 @@ import {ForkName} from "@lodestar/params"; +import {SubnetID} from "@lodestar/types"; import {RegistryMetricCreator} from "../../metrics/index.js"; import {GossipType} from "./interface.js"; @@ -33,7 +34,7 @@ export function createEth2GossipsubMetrics(register: RegistryMetricCreator) { help: "Number of connected mesh peers per beacon attestation subnet", labelNames: ["subnet", "fork"], }), - peersBySyncCommitteeSubnet: register.gauge<{subnet: number; fork: ForkName}>({ + peersBySyncCommitteeSubnet: register.gauge<{subnet: SubnetID; fork: ForkName}>({ name: "lodestar_gossip_mesh_peers_by_sync_committee_subnet_count", help: "Number of connected mesh peers per sync committee subnet", labelNames: ["subnet", "fork"], @@ -50,7 +51,7 @@ export function createEth2GossipsubMetrics(register: RegistryMetricCreator) { help: "Number of connected topic peers per beacon attestation subnet", labelNames: ["subnet", "fork"], }), - peersBySyncCommitteeSubnet: register.gauge<{subnet: number; fork: ForkName}>({ + peersBySyncCommitteeSubnet: register.gauge<{subnet: SubnetID; fork: ForkName}>({ name: "lodestar_gossip_topic_peers_by_sync_committee_subnet_count", help: "Number of connected topic peers per sync committee subnet", labelNames: ["subnet", "fork"], diff --git a/packages/beacon-node/src/network/interface.ts b/packages/beacon-node/src/network/interface.ts index edcf3587842..87cf535d9d9 100644 --- a/packages/beacon-node/src/network/interface.ts +++ b/packages/beacon-node/src/network/interface.ts @@ -21,6 +21,7 @@ import { SignedBeaconBlock, Slot, SlotRootHex, + SubnetID, WithBytes, altair, capella, @@ -54,7 +55,7 @@ export interface INetwork extends INetworkCorePublic { getConnectedPeerCount(): number; isSubscribedToGossipCoreTopics(): boolean; reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): void; - shouldAggregate(subnet: number, slot: Slot): boolean; + shouldAggregate(subnet: SubnetID, slot: Slot): boolean; reStatusPeers(peers: PeerIdStr[]): Promise; searchUnknownSlotRoot(slotRoot: SlotRootHex, peer?: PeerIdStr): void; // ReqResp @@ -73,12 +74,12 @@ export interface INetwork extends INetworkCorePublic { publishBeaconBlock(signedBlock: SignedBeaconBlock): Promise; publishBlobSidecar(blobSidecar: deneb.BlobSidecar): Promise; publishBeaconAggregateAndProof(aggregateAndProof: SignedAggregateAndProof): Promise; - publishBeaconAttestation(attestation: phase0.Attestation, subnet: number): Promise; + publishBeaconAttestation(attestation: phase0.Attestation, subnet: SubnetID): Promise; publishVoluntaryExit(voluntaryExit: phase0.SignedVoluntaryExit): Promise; publishBlsToExecutionChange(blsToExecutionChange: capella.SignedBLSToExecutionChange): Promise; publishProposerSlashing(proposerSlashing: phase0.ProposerSlashing): Promise; publishAttesterSlashing(attesterSlashing: phase0.AttesterSlashing): Promise; - publishSyncCommitteeSignature(signature: altair.SyncCommitteeMessage, subnet: number): Promise; + publishSyncCommitteeSignature(signature: altair.SyncCommitteeMessage, subnet: SubnetID): Promise; publishContributionAndProof(contributionAndProof: altair.SignedContributionAndProof): Promise; publishLightClientFinalityUpdate(update: LightClientFinalityUpdate): Promise; publishLightClientOptimisticUpdate(update: LightClientOptimisticUpdate): Promise; diff --git a/packages/beacon-node/src/network/network.ts b/packages/beacon-node/src/network/network.ts index d8370fc22b5..93e5af0265b 100644 --- a/packages/beacon-node/src/network/network.ts +++ b/packages/beacon-node/src/network/network.ts @@ -16,6 +16,7 @@ import { SignedAggregateAndProof, SignedBeaconBlock, SlotRootHex, + SubnetID, WithBytes, altair, capella, @@ -296,7 +297,7 @@ export class Network implements INetwork { return this.subscribedToCoreTopics; } - shouldAggregate(subnet: number, slot: number): boolean { + shouldAggregate(subnet: SubnetID, slot: number): boolean { return this.aggregatorTracker.shouldAggregate(subnet, slot); } @@ -328,7 +329,7 @@ export class Network implements INetwork { ); } - async publishBeaconAttestation(attestation: phase0.Attestation, subnet: number): Promise { + async publishBeaconAttestation(attestation: phase0.Attestation, subnet: SubnetID): Promise { const fork = this.config.getForkName(attestation.data.slot); return this.publishGossip( {type: GossipType.beacon_attestation, fork, subnet}, @@ -379,7 +380,7 @@ export class Network implements INetwork { ); } - async publishSyncCommitteeSignature(signature: altair.SyncCommitteeMessage, subnet: number): Promise { + async publishSyncCommitteeSignature(signature: altair.SyncCommitteeMessage, subnet: SubnetID): Promise { const fork = this.config.getForkName(signature.slot); return this.publishGossip({type: GossipType.sync_committee, fork, subnet}, signature, { ignoreDuplicatePublishError: true, diff --git a/packages/beacon-node/src/network/peers/discover.ts b/packages/beacon-node/src/network/peers/discover.ts index e658fd6378b..55fef17bbb2 100644 --- a/packages/beacon-node/src/network/peers/discover.ts +++ b/packages/beacon-node/src/network/peers/discover.ts @@ -3,6 +3,7 @@ import type {PeerId, PeerInfo} from "@libp2p/interface"; import {BeaconConfig} from "@lodestar/config"; import {LoggerNode} from "@lodestar/logger/node"; import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {SubnetID} from "@lodestar/types"; import {pruneSetToMax, sleep} from "@lodestar/utils"; import {Multiaddr} from "@multiformats/multiaddr"; import {NetworkCoreMetrics} from "../core/metrics.js"; @@ -65,7 +66,7 @@ type SubnetRequestInfo = { }; export type SubnetDiscvQueryMs = { - subnet: number; + subnet: SubnetID; type: SubnetType; toUnixMs: UnixMs; maxPeersToDiscover: number; diff --git a/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts b/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts index 545d8a6ca8b..9aa95e8af64 100644 --- a/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts +++ b/packages/beacon-node/src/network/peers/utils/prioritizePeers.ts @@ -1,7 +1,7 @@ import {BitArray} from "@chainsafe/ssz"; import {Direction, PeerId} from "@libp2p/interface"; import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; -import {altair, phase0} from "@lodestar/types"; +import {SubnetID, altair, phase0} from "@lodestar/types"; import {MapDef} from "@lodestar/utils"; import {shuffle} from "../../../util/shuffle.js"; import {sortBy} from "../../../util/sortBy.js"; @@ -38,7 +38,7 @@ const OUTBOUND_PEERS_RATIO = 0.1; const attnetsZero = BitArray.fromBitLen(ATTESTATION_SUBNET_COUNT); const syncnetsZero = BitArray.fromBitLen(SYNC_COMMITTEE_SUBNET_COUNT); -type SubnetDiscvQuery = {subnet: number; toSlot: number; maxPeersToDiscover: number}; +type SubnetDiscvQuery = {subnet: SubnetID; toSlot: number; maxPeersToDiscover: number}; type PeerInfo = { id: PeerId; @@ -412,8 +412,8 @@ export function sortPeersToPrune(connectedPeers: PeerInfo[], dutiesByPeer: Map

TARGET_SUBNET_PEERS, return null if peers are not grouped * to any subnets. */ -function findMaxPeersSubnet(subnetToPeers: Map, targetSubnetPeers: number): number | null { - let maxPeersSubnet: number | null = null; +function findMaxPeersSubnet(subnetToPeers: Map, targetSubnetPeers: number): SubnetID | null { + let maxPeersSubnet: SubnetID | null = null; let maxPeerCountPerSubnet = -1; for (const [subnet, peers] of subnetToPeers) { diff --git a/packages/beacon-node/src/network/peers/utils/subnetMap.ts b/packages/beacon-node/src/network/peers/utils/subnetMap.ts index 97985b3d8da..a815bafc4cb 100644 --- a/packages/beacon-node/src/network/peers/utils/subnetMap.ts +++ b/packages/beacon-node/src/network/peers/utils/subnetMap.ts @@ -1,7 +1,7 @@ -import {Slot} from "@lodestar/types"; +import {Slot, SubnetID} from "@lodestar/types"; export type RequestedSubnet = { - subnet: number; + subnet: SubnetID; /** * Slot after which the network will stop maintaining a min number of peers * connected to `subnetId`RequestedSubnet @@ -14,13 +14,13 @@ export type RequestedSubnet = { */ export class SubnetMap { /** Map of subnets and the slot until they are needed */ - private subnets = new Map(); + private subnets = new Map(); get size(): number { return this.subnets.size; } - has(subnet: number): boolean { + has(subnet: SubnetID): boolean { return this.subnets.has(subnet); } @@ -35,18 +35,18 @@ export class SubnetMap { /** * Get last active slot of a subnet. */ - getToSlot(subnet: number): number | undefined { + getToSlot(subnet: SubnetID): Slot | undefined { return this.subnets.get(subnet); } - isActiveAtSlot(subnet: number, slot: Slot): boolean { + isActiveAtSlot(subnet: SubnetID, slot: Slot): boolean { const toSlot = this.subnets.get(subnet); return toSlot !== undefined && toSlot >= slot; // ACTIVE: >= } /** Return subnetIds with a `toSlot` equal greater than `currentSlot` */ - getActive(currentSlot: Slot): number[] { - const subnetIds: number[] = []; + getActive(currentSlot: Slot): SubnetID[] { + const subnetIds: SubnetID[] = []; for (const [subnet, toSlot] of this.subnets.entries()) { if (toSlot >= currentSlot) { subnetIds.push(subnet); @@ -67,8 +67,8 @@ export class SubnetMap { } /** Return subnetIds with a `toSlot` less than `currentSlot`. Also deletes expired entries */ - getExpired(currentSlot: Slot): number[] { - const subnetIds: number[] = []; + getExpired(currentSlot: Slot): SubnetID[] { + const subnetIds: SubnetID[] = []; for (const [subnet, toSlot] of this.subnets.entries()) { if (toSlot < currentSlot) { subnetIds.push(subnet); @@ -78,11 +78,11 @@ export class SubnetMap { return subnetIds; } - getAll(): number[] { + getAll(): SubnetID[] { return Array.from(this.subnets.keys()); } - delete(subnet: number): void { + delete(subnet: SubnetID): void { this.subnets.delete(subnet); } } diff --git a/packages/beacon-node/src/network/processor/aggregatorTracker.ts b/packages/beacon-node/src/network/processor/aggregatorTracker.ts index 634e809ae61..0cd9d3e843b 100644 --- a/packages/beacon-node/src/network/processor/aggregatorTracker.ts +++ b/packages/beacon-node/src/network/processor/aggregatorTracker.ts @@ -1,9 +1,7 @@ import {SLOTS_PER_EPOCH} from "@lodestar/params"; -import {Slot} from "@lodestar/types"; +import {Slot, SubnetID} from "@lodestar/types"; import {MapDef, pruneSetToMax} from "@lodestar/utils"; -type SubnetId = number; - // Subscriptions are submitted max two epochs in advance const MAX_SLOTS_CACHED = SLOTS_PER_EPOCH * 2; @@ -12,17 +10,17 @@ const MAX_SLOTS_CACHED = SLOTS_PER_EPOCH * 2; * to only then insert attestations into the op pool */ export class AggregatorTracker { - private subnetAggregatorsBySlot = new MapDef>(() => new Set()); + private subnetAggregatorsBySlot = new MapDef>(() => new Set()); get maxSlotsCached(): number { return MAX_SLOTS_CACHED; } - addAggregator(subnet: SubnetId, slot: Slot): void { + addAggregator(subnet: SubnetID, slot: Slot): void { this.subnetAggregatorsBySlot.getOrDefault(slot).add(subnet); } - shouldAggregate(subnet: SubnetId, slot: Slot): boolean { + shouldAggregate(subnet: SubnetID, slot: Slot): boolean { return this.subnetAggregatorsBySlot.get(slot)?.has(subnet) === true; } diff --git a/packages/beacon-node/src/network/processor/gossipHandlers.ts b/packages/beacon-node/src/network/processor/gossipHandlers.ts index 3fb7b06e700..7ef32ffc32b 100644 --- a/packages/beacon-node/src/network/processor/gossipHandlers.ts +++ b/packages/beacon-node/src/network/processor/gossipHandlers.ts @@ -2,7 +2,7 @@ import {routes} from "@lodestar/api"; import {BeaconConfig, ChainForkConfig} from "@lodestar/config"; import {ForkName, ForkSeq} from "@lodestar/params"; import {computeTimeAtSlot} from "@lodestar/state-transition"; -import {Root, SignedBeaconBlock, Slot, UintNum64, deneb, ssz, sszTypesFor} from "@lodestar/types"; +import {Root, SignedBeaconBlock, Slot, SubnetID, UintNum64, deneb, ssz, sszTypesFor} from "@lodestar/types"; import {LogLevel, Logger, prettyBytes, toRootHex} from "@lodestar/utils"; import { BlobSidecarValidation, @@ -179,7 +179,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand async function validateBeaconBlob( blobSidecar: deneb.BlobSidecar, blobBytes: Uint8Array, - subnet: number, + subnet: SubnetID, peerIdStr: string, seenTimestampSec: number ): Promise { diff --git a/packages/beacon-node/src/network/subnets/attnetsService.ts b/packages/beacon-node/src/network/subnets/attnetsService.ts index ed2f94bd56d..5652460b5ab 100644 --- a/packages/beacon-node/src/network/subnets/attnetsService.ts +++ b/packages/beacon-node/src/network/subnets/attnetsService.ts @@ -5,7 +5,7 @@ import { ForkName, SLOTS_PER_EPOCH, } from "@lodestar/params"; -import {Epoch, Slot, ssz} from "@lodestar/types"; +import {Epoch, Slot, SubnetID, ssz} from "@lodestar/types"; import {Logger, MapDef} from "@lodestar/utils"; import {ClockEvent, IClock} from "../../util/clock.js"; import {NetworkCoreMetrics} from "../core/metrics.js"; @@ -25,9 +25,8 @@ export enum SubnetSource { longLived = "long_lived", } -type Subnet = number; // map of subnet to time to form stable mesh as seconds, null if not yet formed -type AggregatorDutyInfo = Map; +type AggregatorDutyInfo = Map; /** * This value means node is not able to form stable mesh. @@ -126,7 +125,7 @@ export class AttnetsService implements IAttnetsService { /** * Check if a subscription is still active before handling a gossip object */ - shouldProcess(subnet: number, slot: Slot): boolean { + shouldProcess(subnet: SubnetID, slot: Slot): boolean { if (!this.aggregatorSlotSubnet.has(slot)) { return false; } diff --git a/packages/beacon-node/src/network/subnets/interface.ts b/packages/beacon-node/src/network/subnets/interface.ts index e3b1e251381..fe9f1e6172c 100644 --- a/packages/beacon-node/src/network/subnets/interface.ts +++ b/packages/beacon-node/src/network/subnets/interface.ts @@ -1,12 +1,12 @@ import {ForkName} from "@lodestar/params"; -import {Bytes32, Slot, ValidatorIndex} from "@lodestar/types"; +import {Bytes32, Slot, SubnetID, ValidatorIndex} from "@lodestar/types"; import {GossipTopic} from "../gossip/interface.js"; import {RequestedSubnet} from "../peers/utils/index.js"; /** Generic CommitteeSubscription for both beacon attnets subs and syncnets subs */ export type CommitteeSubscription = { validatorIndex: ValidatorIndex; - subnet: number; + subnet: SubnetID; slot: Slot; isAggregator: boolean; }; @@ -20,7 +20,7 @@ export type SubnetsService = { }; export interface IAttnetsService extends SubnetsService { - shouldProcess(subnet: number, slot: Slot): boolean; + shouldProcess(subnet: SubnetID, slot: Slot): boolean; } export type RandBetweenFn = (min: number, max: number) => number; diff --git a/packages/beacon-node/test/unit/chain/validation/attestation/validateAttestation.test.ts b/packages/beacon-node/test/unit/chain/validation/attestation/validateAttestation.test.ts index 1ffbf769611..228f705355a 100644 --- a/packages/beacon-node/test/unit/chain/validation/attestation/validateAttestation.test.ts +++ b/packages/beacon-node/test/unit/chain/validation/attestation/validateAttestation.test.ts @@ -1,6 +1,6 @@ import {BitArray} from "@chainsafe/ssz"; import {ForkName, SLOTS_PER_EPOCH} from "@lodestar/params"; -import {ssz} from "@lodestar/types"; +import {SubnetID, ssz} from "@lodestar/types"; import {LodestarError} from "@lodestar/utils"; import {describe, expect, it} from "vitest"; import {generateTestCachedBeaconStateOnlyValidators} from "../../../../../../state-transition/test/perf/util.js"; @@ -309,7 +309,7 @@ describe("validateAttestation", () => { async function expectGossipError( chain: IBeaconChain, attestationOrBytes: GossipAttestation, - subnet: number, + subnet: SubnetID, errorCode: string ): Promise { const fork = chain.config.getForkName(stateSlot); diff --git a/packages/beacon-node/test/unit/network/subnets/attnetsService.test.ts b/packages/beacon-node/test/unit/network/subnets/attnetsService.test.ts index 5e7149f4d7f..f679532bb09 100644 --- a/packages/beacon-node/test/unit/network/subnets/attnetsService.test.ts +++ b/packages/beacon-node/test/unit/network/subnets/attnetsService.test.ts @@ -8,6 +8,7 @@ import { } from "@lodestar/params"; import {ZERO_HASH} from "@lodestar/state-transition"; import {getCurrentSlot} from "@lodestar/state-transition"; +import {SubnetID} from "@lodestar/types"; import {bigIntToBytes} from "@lodestar/utils"; import {MockedObject, afterEach, beforeEach, describe, expect, it, vi} from "vitest"; import {Eth2Gossipsub} from "../../../../src/network/gossip/gossipsub.js"; @@ -77,8 +78,8 @@ describe("AttnetsService", () => { expect(gossipStub.subscribeTopic).toBeCalledWith(expect.objectContaining({fork: ForkName.phase0})); expect(gossipStub.subscribeTopic).not.toBeCalledWith({fork: ForkName.altair}); expect(gossipStub.subscribeTopic).toBeCalledTimes(2); - const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: number}).subnet; - const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: number}).subnet; + const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: SubnetID}).subnet; + const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: SubnetID}).subnet; expect(gossipStub.subscribeTopic).toBeCalledTimes(SUBNETS_PER_NODE); vi.advanceTimersByTime(config.SECONDS_PER_SLOT * SLOTS_PER_EPOCH * (ALTAIR_FORK_EPOCH - 2) * 1000); service.subscribeSubnetsToNextFork(ForkName.altair); @@ -105,8 +106,8 @@ describe("AttnetsService", () => { it("should not subscribe to new short lived subnet if not aggregator", () => { expect(gossipStub.subscribeTopic).toBeCalledTimes(SUBNETS_PER_NODE); - const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: number}).subnet; - const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: number}).subnet; + const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: SubnetID}).subnet; + const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: SubnetID}).subnet; // should subscribe to new short lived subnet const newSubnet = 63; expect(newSubnet).not.toBe(firstSubnet); @@ -124,8 +125,8 @@ describe("AttnetsService", () => { it("should subscribe to new short lived subnet if aggregator", () => { expect(gossipStub.subscribeTopic).toBeCalledTimes(SUBNETS_PER_NODE); - const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: number}).subnet; - const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: number}).subnet; + const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: SubnetID}).subnet; + const secondSubnet = (gossipStub.subscribeTopic.mock.calls[1][0] as unknown as {subnet: SubnetID}).subnet; // should subscribe to new short lived subnet const newSubnet = 63; expect(newSubnet).not.toBe(firstSubnet); @@ -149,7 +150,7 @@ describe("AttnetsService", () => { it("should not subscribe to existing short lived subnet if aggregator", () => { expect(gossipStub.subscribeTopic).toBeCalledTimes(SUBNETS_PER_NODE); - const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: number}).subnet; + const firstSubnet = (gossipStub.subscribeTopic.mock.calls[0][0] as unknown as {subnet: SubnetID}).subnet; // should not subscribe to existing short lived subnet const subscription: CommitteeSubscription = { validatorIndex: 2023, diff --git a/packages/beacon-node/test/utils/network.ts b/packages/beacon-node/test/utils/network.ts index 56c831b269f..d64249d3a13 100644 --- a/packages/beacon-node/test/utils/network.ts +++ b/packages/beacon-node/test/utils/network.ts @@ -2,6 +2,7 @@ import {BitArray} from "@chainsafe/ssz"; import {PeerId} from "@libp2p/interface"; import {createSecp256k1PeerId} from "@libp2p/peer-id-factory"; import {ATTESTATION_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; +import {SubnetID} from "@lodestar/types"; import {INetwork, Network, NetworkEvent} from "../../src/network/index.js"; import {Libp2p} from "../../src/network/interface.js"; import {createNodeJsLibp2p} from "../../src/network/libp2p/index.js"; @@ -55,7 +56,7 @@ export function onPeerDisconnect(network: Network): Promise { /** * Generate valid filled attnets BitVector */ -export function getAttnets(subnetIds: number[] = []): BitArray { +export function getAttnets(subnetIds: SubnetID[] = []): BitArray { const attnets = BitArray.fromBitLen(ATTESTATION_SUBNET_COUNT); for (const subnetId of subnetIds) { attnets.set(subnetId, true); @@ -66,7 +67,7 @@ export function getAttnets(subnetIds: number[] = []): BitArray { /** * Generate valid filled syncnets BitVector */ -export function getSyncnets(subnetIds: number[] = []): BitArray { +export function getSyncnets(subnetIds: SubnetID[] = []): BitArray { const syncnets = BitArray.fromBitLen(SYNC_COMMITTEE_SUBNET_COUNT); for (const subnetId of subnetIds) { syncnets.set(subnetId, true); diff --git a/packages/beacon-node/test/utils/validationData/attestation.ts b/packages/beacon-node/test/utils/validationData/attestation.ts index 40dccbd77f1..e8f0fca632e 100644 --- a/packages/beacon-node/test/utils/validationData/attestation.ts +++ b/packages/beacon-node/test/utils/validationData/attestation.ts @@ -2,7 +2,7 @@ import {BitArray, toHexString} from "@chainsafe/ssz"; import {DataAvailabilityStatus, ExecutionStatus, IForkChoice, ProtoBlock} from "@lodestar/fork-choice"; import {DOMAIN_BEACON_ATTESTER} from "@lodestar/params"; import {computeEpochAtSlot, computeSigningRoot, computeStartSlotAtEpoch} from "@lodestar/state-transition"; -import {Slot, phase0, ssz} from "@lodestar/types"; +import {Slot, SubnetID, phase0, ssz} from "@lodestar/types"; import { generateTestCachedBeaconStateOnlyValidators, getSecretKeyFromIndexCached, @@ -37,7 +37,7 @@ export type AttestationValidDataOpts = { export function getAttestationValidData(opts: AttestationValidDataOpts): { chain: IBeaconChain; attestation: phase0.Attestation; - subnet: number; + subnet: SubnetID; validatorIndex: number; } { const currentSlot = opts.currentSlot ?? 100; diff --git a/packages/state-transition/src/cache/epochCache.ts b/packages/state-transition/src/cache/epochCache.ts index af9e79bc831..4714d616920 100644 --- a/packages/state-transition/src/cache/epochCache.ts +++ b/packages/state-transition/src/cache/epochCache.ts @@ -20,6 +20,7 @@ import { IndexedAttestation, RootHex, Slot, + SubnetID, SyncPeriod, ValidatorIndex, electra, @@ -798,7 +799,7 @@ export class EpochCache { /** * Compute the correct subnet for a slot/committee index */ - computeSubnetForSlot(slot: number, committeeIndex: number): number { + computeSubnetForSlot(slot: number, committeeIndex: number): SubnetID { const slotsSinceEpochStart = slot % SLOTS_PER_EPOCH; const committeesPerSlot = this.getCommitteeCountPerSlot(computeEpochAtSlot(slot)); const committeesSinceEpochStart = committeesPerSlot * slotsSinceEpochStart; diff --git a/packages/types/src/primitive/types.ts b/packages/types/src/primitive/types.ts index 53422cc9b99..d0eef619840 100644 --- a/packages/types/src/primitive/types.ts +++ b/packages/types/src/primitive/types.ts @@ -30,6 +30,7 @@ export type SubcommitteeIndex = UintNum64; export type ValidatorIndex = UintNum64; export type WithdrawalIndex = UintNum64; export type BlobIndex = UintNum64; +export type SubnetID = UintNum64; export type Gwei = UintBn64; export type Wei = UintBn256; export type Root = Bytes32; From 18a0d681dbcc51fb2ac9456f31e91f4e31a18300 Mon Sep 17 00:00:00 2001 From: Cayman Date: Wed, 8 Jan 2025 13:49:37 -0500 Subject: [PATCH 10/12] refactor: update snappy frame decompress (#7333) * refactor: update snappy frame decompress * chore: fix lint errors * chore: separate code paths for ChunkTypes --- .../sszSnappy/snappyFrames/common.ts | 29 +++++++++ .../sszSnappy/snappyFrames/compress.ts | 35 +---------- .../sszSnappy/snappyFrames/uncompress.ts | 59 ++++++++++++++----- .../sszSnappy/snappyFrames/uncompress.test.ts | 40 +++++++++++++ 4 files changed, 115 insertions(+), 48 deletions(-) diff --git a/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/common.ts b/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/common.ts index 1077bcdcd4f..9d22b4c45a0 100644 --- a/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/common.ts +++ b/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/common.ts @@ -1,9 +1,38 @@ +import crc32c from "@chainsafe/fast-crc32c"; + export enum ChunkType { IDENTIFIER = 0xff, COMPRESSED = 0x00, UNCOMPRESSED = 0x01, PADDING = 0xfe, + SKIPPABLE = 0x80, } export const IDENTIFIER = Buffer.from([0x73, 0x4e, 0x61, 0x50, 0x70, 0x59]); export const IDENTIFIER_FRAME = Buffer.from([0xff, 0x06, 0x00, 0x00, 0x73, 0x4e, 0x61, 0x50, 0x70, 0x59]); + +/** + * As per the snappy framing format for streams, the size of any uncompressed chunk can be + * no longer than 65536 bytes. + * + * From: https://github.com/google/snappy/blob/main/framing_format.txt#L90:L92 + */ +export const UNCOMPRESSED_CHUNK_SIZE = 65536; + +export function crc(value: Uint8Array): Buffer { + // this function doesn't actually need a buffer + // see https://github.com/napi-rs/node-rs/blob/main/packages/crc32/index.d.ts + const x = crc32c.calculate(value as Buffer); + const result = Buffer.allocUnsafe?.(4) ?? Buffer.alloc(4); + + // As defined in section 3 of https://github.com/google/snappy/blob/master/framing_format.txt + // And other implementations for reference: + // Go: https://github.com/golang/snappy/blob/2e65f85255dbc3072edf28d6b5b8efc472979f5a/snappy.go#L97 + // Python: https://github.com/andrix/python-snappy/blob/602e9c10d743f71bef0bac5e4c4dffa17340d7b3/snappy/snappy.py#L70 + // Mask the right hand to (32 - 17) = 15 bits -> 0x7fff, to keep correct 32 bit values. + // Shift the left hand with >>> for correct 32 bit intermediate result. + // Then final >>> 0 for 32 bits output + result.writeUInt32LE((((x >>> 15) | ((x & 0x7fff) << 17)) + 0xa282ead8) >>> 0, 0); + + return result; +} diff --git a/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/compress.ts b/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/compress.ts index 98ae4053e90..8bcc3cca3ea 100644 --- a/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/compress.ts +++ b/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/compress.ts @@ -1,33 +1,8 @@ -import crc32c from "@chainsafe/fast-crc32c"; import snappy from "snappy"; -import {ChunkType, IDENTIFIER_FRAME} from "./common.js"; +import {ChunkType, IDENTIFIER_FRAME, UNCOMPRESSED_CHUNK_SIZE, crc} from "./common.js"; // The logic in this file is largely copied (in simplified form) from https://github.com/ChainSafe/node-snappy-stream/ -/** - * As per the snappy framing format for streams, the size of any uncompressed chunk can be - * no longer than 65536 bytes. - * - * From: https://github.com/google/snappy/blob/main/framing_format.txt#L90:L92 - */ -const UNCOMPRESSED_CHUNK_SIZE = 65536; - -function checksum(value: Buffer): Buffer { - const x = crc32c.calculate(value); - const result = Buffer.allocUnsafe?.(4) ?? Buffer.alloc(4); - - // As defined in section 3 of https://github.com/google/snappy/blob/master/framing_format.txt - // And other implementations for reference: - // Go: https://github.com/golang/snappy/blob/2e65f85255dbc3072edf28d6b5b8efc472979f5a/snappy.go#L97 - // Python: https://github.com/andrix/python-snappy/blob/602e9c10d743f71bef0bac5e4c4dffa17340d7b3/snappy/snappy.py#L70 - // Mask the right hand to (32 - 17) = 15 bits -> 0x7fff, to keep correct 32 bit values. - // Shift the left hand with >>> for correct 32 bit intermediate result. - // Then final >>> 0 for 32 bits output - result.writeUInt32LE((((x >>> 15) | ((x & 0x7fff) << 17)) + 0xa282ead8) >>> 0, 0); - - return result; -} - export async function* encodeSnappy(bytes: Buffer): AsyncGenerator { yield IDENTIFIER_FRAME; @@ -36,17 +11,13 @@ export async function* encodeSnappy(bytes: Buffer): AsyncGenerator { const compressed = snappy.compressSync(chunk); if (compressed.length < chunk.length) { const size = compressed.length + 4; - yield Buffer.concat([ - Buffer.from([ChunkType.COMPRESSED, size, size >> 8, size >> 16]), - checksum(chunk), - compressed, - ]); + yield Buffer.concat([Buffer.from([ChunkType.COMPRESSED, size, size >> 8, size >> 16]), crc(chunk), compressed]); } else { const size = chunk.length + 4; yield Buffer.concat([ // Buffer.from([ChunkType.UNCOMPRESSED, size, size >> 8, size >> 16]), - checksum(chunk), + crc(chunk), chunk, ]); } diff --git a/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/uncompress.ts b/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/uncompress.ts index 8530bc7aeb8..5ecb4a40aac 100644 --- a/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/uncompress.ts +++ b/packages/reqresp/src/encodingStrategies/sszSnappy/snappyFrames/uncompress.ts @@ -1,6 +1,6 @@ import {uncompress} from "snappyjs"; import {Uint8ArrayList} from "uint8arraylist"; -import {ChunkType, IDENTIFIER} from "./common.js"; +import {ChunkType, IDENTIFIER, UNCOMPRESSED_CHUNK_SIZE, crc} from "./common.js"; export class SnappyFramesUncompress { private buffer = new Uint8ArrayList(); @@ -21,32 +21,55 @@ export class SnappyFramesUncompress { if (this.buffer.length < 4) break; const type = getChunkType(this.buffer.get(0)); + + if (!this.state.foundIdentifier && type !== ChunkType.IDENTIFIER) { + throw "malformed input: must begin with an identifier"; + } + const frameSize = getFrameSize(this.buffer, 1); if (this.buffer.length - 4 < frameSize) { break; } - const data = this.buffer.subarray(4, 4 + frameSize); + const frame = this.buffer.subarray(4, 4 + frameSize); this.buffer.consume(4 + frameSize); - if (!this.state.foundIdentifier && type !== ChunkType.IDENTIFIER) { - throw "malformed input: must begin with an identifier"; - } + switch (type) { + case ChunkType.IDENTIFIER: { + if (!Buffer.prototype.equals.call(frame, IDENTIFIER)) { + throw "malformed input: bad identifier"; + } + this.state.foundIdentifier = true; + continue; + } + case ChunkType.PADDING: + case ChunkType.SKIPPABLE: + continue; + case ChunkType.COMPRESSED: { + const checksum = frame.subarray(0, 4); + const data = frame.subarray(4); - if (type === ChunkType.IDENTIFIER) { - if (!Buffer.prototype.equals.call(data, IDENTIFIER)) { - throw "malformed input: bad identifier"; + const uncompressed = uncompress(data, UNCOMPRESSED_CHUNK_SIZE); + if (crc(uncompressed).compare(checksum) !== 0) { + throw "malformed input: bad checksum"; + } + result.append(uncompressed); + break; } - this.state.foundIdentifier = true; - continue; - } + case ChunkType.UNCOMPRESSED: { + const checksum = frame.subarray(0, 4); + const uncompressed = frame.subarray(4); - if (type === ChunkType.COMPRESSED) { - result.append(uncompress(data.subarray(4))); - } - if (type === ChunkType.UNCOMPRESSED) { - result.append(data.subarray(4)); + if (uncompressed.length > UNCOMPRESSED_CHUNK_SIZE) { + throw "malformed input: too large"; + } + if (crc(uncompressed).compare(checksum) !== 0) { + throw "malformed input: bad checksum"; + } + result.append(uncompressed); + break; + } } } if (result.length === 0) { @@ -82,6 +105,10 @@ function getChunkType(value: number): ChunkType { case ChunkType.PADDING: return ChunkType.PADDING; default: + // https://github.com/google/snappy/blob/main/framing_format.txt#L129 + if (value >= 0x80 && value <= 0xfd) { + return ChunkType.SKIPPABLE; + } throw new Error("Unsupported snappy chunk type"); } } diff --git a/packages/reqresp/test/unit/encodingStrategies/sszSnappy/snappyFrames/uncompress.test.ts b/packages/reqresp/test/unit/encodingStrategies/sszSnappy/snappyFrames/uncompress.test.ts index 66d4f3548b9..b4dcc5085ad 100644 --- a/packages/reqresp/test/unit/encodingStrategies/sszSnappy/snappyFrames/uncompress.test.ts +++ b/packages/reqresp/test/unit/encodingStrategies/sszSnappy/snappyFrames/uncompress.test.ts @@ -1,6 +1,7 @@ import {pipe} from "it-pipe"; import {Uint8ArrayList} from "uint8arraylist"; import {describe, expect, it} from "vitest"; +import {ChunkType, IDENTIFIER_FRAME, crc} from "../../../../../src/encodingStrategies/sszSnappy/snappyFrames/common.js"; import {encodeSnappy} from "../../../../../src/encodingStrategies/sszSnappy/snappyFrames/compress.js"; import {SnappyFramesUncompress} from "../../../../../src/encodingStrategies/sszSnappy/snappyFrames/uncompress.js"; @@ -56,4 +57,43 @@ describe("encodingStrategies / sszSnappy / snappy frames / uncompress", () => { expect(decompress.uncompress(new Uint8ArrayList(Buffer.alloc(3, 1)))).toBe(null); }); + + it("should detect invalid checksum", () => { + const chunks = new Uint8ArrayList(); + chunks.append(IDENTIFIER_FRAME); + + chunks.append(Uint8Array.from([ChunkType.UNCOMPRESSED, 0x80, 0x00, 0x00])); + // first 4 bytes are checksum + // 0xffffffff is clearly an invalid checksum + chunks.append(Uint8Array.from(Array.from({length: 0x80}, () => 0xff))); + + const decompress = new SnappyFramesUncompress(); + expect(() => decompress.uncompress(chunks)).toThrow(/checksum/); + }); + + it("should detect skippable frames", () => { + const chunks = new Uint8ArrayList(); + chunks.append(IDENTIFIER_FRAME); + + chunks.append(Uint8Array.from([ChunkType.SKIPPABLE, 0x80, 0x00, 0x00])); + chunks.append(Uint8Array.from(Array.from({length: 0x80}, () => 0xff))); + + const decompress = new SnappyFramesUncompress(); + expect(decompress.uncompress(chunks)).toBeNull(); + }); + + it("should detect large data", () => { + const chunks = new Uint8ArrayList(); + chunks.append(IDENTIFIER_FRAME); + + // add a chunk of size 100000 + chunks.append(Uint8Array.from([ChunkType.UNCOMPRESSED, 160, 134, 1])); + const data = Uint8Array.from(Array.from({length: 100000 - 4}, () => 0xff)); + const checksum = crc(data); + chunks.append(checksum); + chunks.append(data); + + const decompress = new SnappyFramesUncompress(); + expect(() => decompress.uncompress(chunks)).toThrow(/large/); + }); }); From e6a0cb22b5afe7d640750554f5f4d901f653652b Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Fri, 10 Jan 2025 09:03:37 +0000 Subject: [PATCH 11/12] chore: reuse setup and build action in sim merge tests (#7345) --- .github/workflows/test-sim-merge.yml | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test-sim-merge.yml b/.github/workflows/test-sim-merge.yml index ad79bc2c003..38a0253e0b2 100644 --- a/.github/workflows/test-sim-merge.yml +++ b/.github/workflows/test-sim-merge.yml @@ -26,31 +26,10 @@ jobs: name: Sim merge tests runs-on: buildjet-4vcpu-ubuntu-2204 steps: - # - Uses YAML anchors in the future - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: "./.github/actions/setup-and-build" with: - node-version: 22 - check-latest: true - cache: yarn - - name: Node.js version - id: node - run: echo "v8CppApiVersion=$(node --print "process.versions.modules")" >> $GITHUB_OUTPUT - - name: Restore dependencies - uses: actions/cache@master - id: cache-deps - with: - path: | - node_modules - packages/*/node_modules - key: ${{ runner.os }}-${{ steps.node.outputs.v8CppApiVersion }}-${{ hashFiles('**/yarn.lock', '**/package.json') }} - - name: Install & build - if: steps.cache-deps.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile && yarn build - - name: Build - run: yarn build - if: steps.cache-deps.outputs.cache-hit == 'true' - # + node: 22 - name: Pull Geth run: docker pull $GETH_IMAGE From e30fd40c053e2dd07a4f5b4b6e37118efd91209a Mon Sep 17 00:00:00 2001 From: Phil Ngo Date: Fri, 10 Jan 2025 12:07:35 -0500 Subject: [PATCH 12/12] chore: bump package versions to 1.25.0 --- lerna.json | 2 +- packages/api/package.json | 10 +++++----- packages/beacon-node/package.json | 26 +++++++++++++------------- packages/cli/package.json | 26 +++++++++++++------------- packages/config/package.json | 8 ++++---- packages/db/package.json | 8 ++++---- packages/flare/package.json | 14 +++++++------- packages/fork-choice/package.json | 12 ++++++------ packages/light-client/package.json | 12 ++++++------ packages/logger/package.json | 6 +++--- packages/params/package.json | 2 +- packages/prover/package.json | 18 +++++++++--------- packages/reqresp/package.json | 12 ++++++------ packages/spec-test-util/package.json | 4 ++-- packages/state-transition/package.json | 10 +++++----- packages/test-utils/package.json | 6 +++--- packages/types/package.json | 4 ++-- packages/utils/package.json | 2 +- packages/validator/package.json | 18 +++++++++--------- 19 files changed, 100 insertions(+), 100 deletions(-) diff --git a/lerna.json b/lerna.json index 99654f9e81d..97c908dc50e 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useNx": true, - "version": "1.24.0", + "version": "1.25.0", "stream": true, "command": { "version": { diff --git a/packages/api/package.json b/packages/api/package.json index f650a377f6a..c2234e0db5e 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": { ".": { @@ -72,10 +72,10 @@ "dependencies": { "@chainsafe/persistent-merkle-tree": "^0.8.0", "@chainsafe/ssz": "^0.18.0", - "@lodestar/config": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0", + "@lodestar/config": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0", "eventsource": "^2.0.2", "qs": "^6.11.1" }, diff --git a/packages/beacon-node/package.json b/packages/beacon-node/package.json index f80dc93b131..4be101ba92a 100644 --- a/packages/beacon-node/package.json +++ b/packages/beacon-node/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": { ".": { @@ -120,18 +120,18 @@ "@libp2p/peer-id-factory": "^4.1.0", "@libp2p/prometheus-metrics": "^3.0.21", "@libp2p/tcp": "9.0.23", - "@lodestar/api": "^1.24.0", - "@lodestar/config": "^1.24.0", - "@lodestar/db": "^1.24.0", - "@lodestar/fork-choice": "^1.24.0", - "@lodestar/light-client": "^1.24.0", - "@lodestar/logger": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/reqresp": "^1.24.0", - "@lodestar/state-transition": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0", - "@lodestar/validator": "^1.24.0", + "@lodestar/api": "^1.25.0", + "@lodestar/config": "^1.25.0", + "@lodestar/db": "^1.25.0", + "@lodestar/fork-choice": "^1.25.0", + "@lodestar/light-client": "^1.25.0", + "@lodestar/logger": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/reqresp": "^1.25.0", + "@lodestar/state-transition": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0", + "@lodestar/validator": "^1.25.0", "@multiformats/multiaddr": "^12.1.3", "c-kzg": "^2.1.2", "datastore-core": "^9.1.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 8f3cc163cc5..b9d9ce7c164 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@chainsafe/lodestar", - "version": "1.24.0", + "version": "1.25.0", "description": "Command line interface for lodestar", "author": "ChainSafe Systems", "license": "LGPL-3.0", @@ -62,17 +62,17 @@ "@libp2p/crypto": "^4.1.0", "@libp2p/peer-id": "^4.1.0", "@libp2p/peer-id-factory": "^4.1.0", - "@lodestar/api": "^1.24.0", - "@lodestar/beacon-node": "^1.24.0", - "@lodestar/config": "^1.24.0", - "@lodestar/db": "^1.24.0", - "@lodestar/light-client": "^1.24.0", - "@lodestar/logger": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/state-transition": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0", - "@lodestar/validator": "^1.24.0", + "@lodestar/api": "^1.25.0", + "@lodestar/beacon-node": "^1.25.0", + "@lodestar/config": "^1.25.0", + "@lodestar/db": "^1.25.0", + "@lodestar/light-client": "^1.25.0", + "@lodestar/logger": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/state-transition": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0", + "@lodestar/validator": "^1.25.0", "@multiformats/multiaddr": "^12.1.3", "deepmerge": "^4.3.1", "ethers": "^6.7.0", @@ -88,7 +88,7 @@ "yargs": "^17.7.1" }, "devDependencies": { - "@lodestar/test-utils": "^1.24.0", + "@lodestar/test-utils": "^1.25.0", "@types/debug": "^4.1.7", "@types/got": "^9.6.12", "@types/inquirer": "^9.0.3", diff --git a/packages/config/package.json b/packages/config/package.json index c421d8802f0..8e9047a12db 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@lodestar/config", - "version": "1.24.0", + "version": "1.25.0", "description": "Chain configuration required for lodestar", "author": "ChainSafe Systems", "license": "Apache-2.0", @@ -65,8 +65,8 @@ ], "dependencies": { "@chainsafe/ssz": "^0.18.0", - "@lodestar/params": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0" + "@lodestar/params": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0" } } diff --git a/packages/db/package.json b/packages/db/package.json index c71fae52935..30cf7e6bbc2 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@lodestar/db", - "version": "1.24.0", + "version": "1.25.0", "description": "DB modules of Lodestar", "author": "ChainSafe Systems", "homepage": "https://github.com/ChainSafe/lodestar#readme", @@ -36,12 +36,12 @@ }, "dependencies": { "@chainsafe/ssz": "^0.18.0", - "@lodestar/config": "^1.24.0", - "@lodestar/utils": "^1.24.0", + "@lodestar/config": "^1.25.0", + "@lodestar/utils": "^1.25.0", "classic-level": "^1.4.1", "it-all": "^3.0.4" }, "devDependencies": { - "@lodestar/logger": "^1.24.0" + "@lodestar/logger": "^1.25.0" } } diff --git a/packages/flare/package.json b/packages/flare/package.json index a4fa6ca9639..d57a9de7c4b 100644 --- a/packages/flare/package.json +++ b/packages/flare/package.json @@ -1,6 +1,6 @@ { "name": "@lodestar/flare", - "version": "1.24.0", + "version": "1.25.0", "description": "Beacon chain debugging tool", "author": "ChainSafe Systems", "license": "Apache-2.0", @@ -60,12 +60,12 @@ "dependencies": { "@chainsafe/bls-keygen": "^0.4.0", "@chainsafe/blst": "^2.1.0", - "@lodestar/api": "^1.24.0", - "@lodestar/config": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/state-transition": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0", + "@lodestar/api": "^1.25.0", + "@lodestar/config": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/state-transition": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0", "source-map-support": "^0.5.21", "yargs": "^17.7.1" }, diff --git a/packages/fork-choice/package.json b/packages/fork-choice/package.json index a3d0470b21d..1102bca3c6b 100644 --- a/packages/fork-choice/package.json +++ b/packages/fork-choice/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": "./lib/index.js", "types": "./lib/index.d.ts", @@ -37,11 +37,11 @@ }, "dependencies": { "@chainsafe/ssz": "^0.18.0", - "@lodestar/config": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/state-transition": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0" + "@lodestar/config": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/state-transition": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0" }, "keywords": [ "ethereum", diff --git a/packages/light-client/package.json b/packages/light-client/package.json index 2ceac4f703b..9f408ac1cab 100644 --- a/packages/light-client/package.json +++ b/packages/light-client/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": { ".": { @@ -77,11 +77,11 @@ "@chainsafe/blst": "^0.2.0", "@chainsafe/persistent-merkle-tree": "^0.8.0", "@chainsafe/ssz": "^0.18.0", - "@lodestar/api": "^1.24.0", - "@lodestar/config": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0", + "@lodestar/api": "^1.25.0", + "@lodestar/config": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0", "mitt": "^3.0.0" }, "devDependencies": { diff --git a/packages/logger/package.json b/packages/logger/package.json index badf74add4a..a0c4ed936d3 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": { ".": { @@ -66,14 +66,14 @@ }, "types": "lib/index.d.ts", "dependencies": { - "@lodestar/utils": "^1.24.0", + "@lodestar/utils": "^1.25.0", "winston": "^3.8.2", "winston-daily-rotate-file": "^4.7.1", "winston-transport": "^4.5.0" }, "devDependencies": { "@chainsafe/threads": "^1.11.1", - "@lodestar/test-utils": "^1.24.0", + "@lodestar/test-utils": "^1.25.0", "@types/triple-beam": "^1.3.2", "triple-beam": "^1.3.0" }, diff --git a/packages/params/package.json b/packages/params/package.json index 7089fef3a13..8ec18b62efc 100644 --- a/packages/params/package.json +++ b/packages/params/package.json @@ -1,6 +1,6 @@ { "name": "@lodestar/params", - "version": "1.24.0", + "version": "1.25.0", "description": "Chain parameters required for lodestar", "author": "ChainSafe Systems", "license": "Apache-2.0", diff --git a/packages/prover/package.json b/packages/prover/package.json index 7df21de669d..58563612ea9 100644 --- a/packages/prover/package.json +++ b/packages/prover/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": { ".": { @@ -69,13 +69,13 @@ "@ethereumjs/tx": "^4.1.2", "@ethereumjs/util": "^8.0.6", "@ethereumjs/vm": "^6.4.2", - "@lodestar/api": "^1.24.0", - "@lodestar/config": "^1.24.0", - "@lodestar/light-client": "^1.24.0", - "@lodestar/logger": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0", + "@lodestar/api": "^1.25.0", + "@lodestar/config": "^1.25.0", + "@lodestar/light-client": "^1.25.0", + "@lodestar/logger": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0", "ethereum-cryptography": "^2.0.0", "find-up": "^6.3.0", "http-proxy": "^1.18.1", @@ -84,7 +84,7 @@ "yargs": "^17.7.1" }, "devDependencies": { - "@lodestar/test-utils": "^1.24.0", + "@lodestar/test-utils": "^1.25.0", "@types/http-proxy": "^1.17.10", "@types/yargs": "^17.0.24", "axios": "^1.3.4", diff --git a/packages/reqresp/package.json b/packages/reqresp/package.json index dc6082fe0b0..8814a1b7d13 100644 --- a/packages/reqresp/package.json +++ b/packages/reqresp/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": { ".": { @@ -54,9 +54,9 @@ "dependencies": { "@chainsafe/fast-crc32c": "^4.1.1", "@libp2p/interface": "^1.3.0", - "@lodestar/config": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/utils": "^1.24.0", + "@lodestar/config": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/utils": "^1.25.0", "it-all": "^3.0.4", "it-pipe": "^3.0.1", "snappy": "^7.2.2", @@ -65,8 +65,8 @@ "uint8arraylist": "^2.4.7" }, "devDependencies": { - "@lodestar/logger": "^1.24.0", - "@lodestar/types": "^1.24.0", + "@lodestar/logger": "^1.25.0", + "@lodestar/types": "^1.25.0", "libp2p": "1.4.3" }, "peerDependencies": { diff --git a/packages/spec-test-util/package.json b/packages/spec-test-util/package.json index 5ed1a6cdf83..d556e09707c 100644 --- a/packages/spec-test-util/package.json +++ b/packages/spec-test-util/package.json @@ -1,6 +1,6 @@ { "name": "@lodestar/spec-test-util", - "version": "1.24.0", + "version": "1.25.0", "description": "Spec test suite generator from yaml test files", "author": "ChainSafe Systems", "license": "Apache-2.0", @@ -62,7 +62,7 @@ "blockchain" ], "dependencies": { - "@lodestar/utils": "^1.24.0", + "@lodestar/utils": "^1.25.0", "axios": "^1.3.4", "rimraf": "^4.4.1", "snappyjs": "^0.7.0", diff --git a/packages/state-transition/package.json b/packages/state-transition/package.json index 5caf4d4ff3d..38c22e84d56 100644 --- a/packages/state-transition/package.json +++ b/packages/state-transition/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": { ".": { @@ -65,10 +65,10 @@ "@chainsafe/pubkey-index-map": "2.0.0", "@chainsafe/ssz": "^0.18.0", "@chainsafe/swap-or-not-shuffle": "^0.0.2", - "@lodestar/config": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0", + "@lodestar/config": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0", "bigint-buffer": "^1.1.5" }, "keywords": [ diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index a5588dddfd9..bc8a8d1c282 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,7 +1,7 @@ { "name": "@lodestar/test-utils", "private": true, - "version": "1.24.0", + "version": "1.25.0", "description": "Test utilities reused across other packages", "author": "ChainSafe Systems", "license": "Apache-2.0", @@ -59,8 +59,8 @@ "dependencies": { "@chainsafe/bls-keystore": "^3.1.0", "@chainsafe/blst": "^2.1.0", - "@lodestar/params": "^1.24.0", - "@lodestar/utils": "^1.24.0", + "@lodestar/params": "^1.25.0", + "@lodestar/utils": "^1.25.0", "axios": "^1.3.4", "testcontainers": "^10.2.1", "tmp": "^0.2.1", diff --git a/packages/types/package.json b/packages/types/package.json index 949755d62a9..6db16772d3f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": { ".": { @@ -74,7 +74,7 @@ "types": "lib/index.d.ts", "dependencies": { "@chainsafe/ssz": "^0.18.0", - "@lodestar/params": "^1.24.0", + "@lodestar/params": "^1.25.0", "ethereum-cryptography": "^2.0.0" }, "keywords": [ diff --git a/packages/utils/package.json b/packages/utils/package.json index 3347b4815ee..4180998f2ca 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -11,7 +11,7 @@ "bugs": { "url": "https://github.com/ChainSafe/lodestar/issues" }, - "version": "1.24.0", + "version": "1.25.0", "type": "module", "exports": "./lib/index.js", "files": [ diff --git a/packages/validator/package.json b/packages/validator/package.json index 255782e1b53..c71c6b68872 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -1,6 +1,6 @@ { "name": "@lodestar/validator", - "version": "1.24.0", + "version": "1.25.0", "description": "A Typescript implementation of the validator client", "author": "ChainSafe Systems", "license": "LGPL-3.0", @@ -47,17 +47,17 @@ "dependencies": { "@chainsafe/blst": "^2.1.0", "@chainsafe/ssz": "^0.18.0", - "@lodestar/api": "^1.24.0", - "@lodestar/config": "^1.24.0", - "@lodestar/db": "^1.24.0", - "@lodestar/params": "^1.24.0", - "@lodestar/state-transition": "^1.24.0", - "@lodestar/types": "^1.24.0", - "@lodestar/utils": "^1.24.0", + "@lodestar/api": "^1.25.0", + "@lodestar/config": "^1.25.0", + "@lodestar/db": "^1.25.0", + "@lodestar/params": "^1.25.0", + "@lodestar/state-transition": "^1.25.0", + "@lodestar/types": "^1.25.0", + "@lodestar/utils": "^1.25.0", "strict-event-emitter-types": "^2.0.0" }, "devDependencies": { - "@lodestar/test-utils": "^1.24.0", + "@lodestar/test-utils": "^1.25.0", "bigint-buffer": "^1.1.5", "rimraf": "^4.4.1" }