diff --git a/.config/nextest.toml b/.config/nextest.toml
index b701259fc2a..1ef771b3d94 100644
--- a/.config/nextest.toml
+++ b/.config/nextest.toml
@@ -20,7 +20,7 @@ retries = 0
# The number of threads to run tests with. Supported values are either an integer or
# the string "num-cpus". Can be overridden through the `--test-threads` option.
-test-threads = "num-cpus"
+test-threads = 8
# The number of threads required for each test. This is generally used in overrides to
# mark certain tests as heavier than others. However, it can also be set as a global parameter.
diff --git a/.github/workflows/local-testnet.yml b/.github/workflows/local-testnet.yml
index 1269aee6270..74a9071eab5 100644
--- a/.github/workflows/local-testnet.yml
+++ b/.github/workflows/local-testnet.yml
@@ -20,6 +20,9 @@ jobs:
- ubuntu-22.04
- macos-12
runs-on: ${{ matrix.os }}
+ env:
+ # Enable portable to prevent issues with caching `blst` for the wrong CPU type
+ FEATURES: portable,jemalloc
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 24ca09ec00e..26ef781b689 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -282,9 +282,6 @@ jobs:
|
| Docker | [${{ env.VERSION }}](https://hub.docker.com/r/${{ env.IMAGE_NAME }}/tags?page=1&ordering=last_updated&name=${{ env.VERSION }}) | [${{ env.IMAGE_NAME }}](https://hub.docker.com/r/${{ env.IMAGE_NAME }}) |
ENDBODY
)
- assets=()
- for asset in ./lighthouse-*.tar.gz*; do
- assets+=("-a" "$asset/$asset")
- done
+ assets=(./lighthouse-*.tar.gz*)
tag_name="${{ env.VERSION }}"
- echo "$body" | hub release create --draft "${assets[@]}" -F "-" "$tag_name"
+ echo "$body" | gh release create --draft -F "-" "$tag_name" "${assets[@]}"
diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml
index a296cc8491c..4b3922e2278 100644
--- a/.github/workflows/test-suite.yml
+++ b/.github/workflows/test-suite.yml
@@ -26,6 +26,8 @@ env:
WATCH_HOST: ${{ github.repository == 'sigp/lighthouse' && 'host.docker.internal' || 'localhost' }}
# Disable incremental compilation
CARGO_INCREMENTAL: 0
+ # Enable portable to prevent issues with caching `blst` for the wrong CPU type
+ TEST_FEATURES: portable
jobs:
target-branch-check:
name: target-branch-check
@@ -128,6 +130,21 @@ jobs:
bins: cargo-nextest
- name: Run operation_pool tests for all known forks
run: make test-op-pool
+ network-tests:
+ name: network-tests
+ runs-on: ubuntu-latest
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v3
+ - name: Get latest version of stable Rust
+ uses: moonrepo/setup-rust@v1
+ with:
+ channel: stable
+ cache-target: release
+ bins: cargo-nextest
+ - name: Run network tests for all known forks
+ run: make test-network
slasher-tests:
name: slasher-tests
runs-on: ubuntu-latest
@@ -271,6 +288,9 @@ jobs:
doppelganger-protection-test:
name: doppelganger-protection-test
runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }}
+ env:
+ # Enable portable to prevent issues with caching `blst` for the wrong CPU type
+ FEATURES: jemalloc,portable
steps:
- uses: actions/checkout@v3
- name: Get latest version of stable Rust
@@ -289,7 +309,8 @@ jobs:
run: |
make
- name: Install lcli
- if: env.SELF_HOSTED_RUNNERS == 'false'
+# TODO(jimmy): re-enable this once we merge deneb into unstable
+# if: env.SELF_HOSTED_RUNNERS == 'false'
run: make install-lcli
- name: Run the doppelganger protection failure test script
run: |
@@ -301,10 +322,11 @@ jobs:
./doppelganger_protection.sh success genesis.json
execution-engine-integration-ubuntu:
name: execution-engine-integration-ubuntu
- runs-on: ubuntu-latest
+ runs-on: ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v3
- name: Get latest version of stable Rust
+ if: env.SELF_HOSTED_RUNNERS == 'false'
uses: moonrepo/setup-rust@v1
with:
channel: stable
@@ -312,6 +334,9 @@ jobs:
cache: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - name: Add go compiler to $PATH
+ if: env.SELF_HOSTED_RUNNERS == 'true'
+ run: echo "/usr/local/go/bin" >> $GITHUB_PATH
- name: Run exec engine integration tests in release
run: make test-exec-engine
check-code:
@@ -340,8 +365,10 @@ jobs:
run: make arbitrary-fuzz
- name: Run cargo audit
run: make audit-CI
- - name: Run cargo vendor to make sure dependencies can be vendored for packaging, reproducibility and archival purpose
- run: CARGO_HOME=$(readlink -f $HOME) make vendor
+# TODO(sean): re-enable this when we can figure it out with c-kzg
+# Issue: /~https://github.com/sigp/lighthouse/issues/4440
+# - name: Run cargo vendor to make sure dependencies can be vendored for packaging, reproducibility and archival purpose
+# run: CARGO_HOME=$(readlink -f $HOME) make vendor
check-msrv:
name: check-msrv
runs-on: ubuntu-latest
diff --git a/.gitignore b/.gitignore
index 1b7e5dbb88b..e63e218a3bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
target/
+vendor/
**/*.rs.bk
*.pk
*.sk
@@ -9,7 +10,11 @@ perf.data*
/bin
genesis.ssz
/clippy.toml
+/.cargo
# IntelliJ
/*.iml
-.idea
\ No newline at end of file
+.idea
+
+# VSCode
+/.vscode
diff --git a/Cargo.lock b/Cargo.lock
index df817dc2035..7a70a0ac70b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -53,7 +53,6 @@ dependencies = [
"regex",
"rpassword",
"serde",
- "serde_derive",
"serde_yaml",
"slog",
"types",
@@ -135,7 +134,7 @@ version = "0.7.6"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
dependencies = [
- "getrandom 0.2.10",
+ "getrandom",
"once_cell",
"version_check",
]
@@ -153,9 +152,9 @@ dependencies = [
[[package]]
name = "aho-corasick"
-version = "1.1.1"
+version = "1.1.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab"
+checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
dependencies = [
"memchr",
]
@@ -203,9 +202,9 @@ checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
[[package]]
name = "arbitrary"
-version = "1.3.0"
+version = "1.3.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e"
+checksum = "a2e1373abdaa212b704512ec2bd8b26bd0b7d5c3f70117411a5d9a451383c859"
dependencies = [
"derive_arbitrary",
]
@@ -287,7 +286,7 @@ dependencies = [
"log",
"parking",
"polling",
- "rustix 0.37.23",
+ "rustix 0.37.26",
"slab",
"socket2 0.4.9",
"waker-fn",
@@ -304,13 +303,13 @@ dependencies = [
[[package]]
name = "async-trait"
-version = "0.1.73"
+version = "0.1.74"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0"
+checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -349,6 +348,17 @@ dependencies = [
"wildmatch",
]
+[[package]]
+name = "attohttpc"
+version = "0.24.1"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2"
+dependencies = [
+ "http",
+ "log",
+ "url",
+]
+
[[package]]
name = "atty"
version = "0.2.14"
@@ -488,6 +498,7 @@ dependencies = [
"environment",
"eth1",
"eth2",
+ "eth2_network_config",
"ethereum_hashing",
"ethereum_serde_utils",
"ethereum_ssz",
@@ -500,6 +511,7 @@ dependencies = [
"hex",
"int_to_bytes",
"itertools",
+ "kzg",
"lazy_static",
"lighthouse_metrics",
"logging",
@@ -518,6 +530,8 @@ dependencies = [
"serde_json",
"slasher",
"slog",
+ "slog-async",
+ "slog-term",
"sloggers",
"slot_clock",
"smallvec",
@@ -560,6 +574,7 @@ dependencies = [
"node_test_rig",
"sensitive_url",
"serde",
+ "serde_json",
"slasher",
"slog",
"store",
@@ -623,6 +638,29 @@ dependencies = [
"shlex",
]
+[[package]]
+name = "bindgen"
+version = "0.66.1"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"
+dependencies = [
+ "bitflags 2.4.1",
+ "cexpr",
+ "clang-sys",
+ "lazy_static",
+ "lazycell",
+ "log",
+ "peeking_take_while",
+ "prettyplease",
+ "proc-macro2",
+ "quote",
+ "regex",
+ "rustc-hash",
+ "shlex",
+ "syn 2.0.38",
+ "which",
+]
+
[[package]]
name = "bitflags"
version = "1.3.2"
@@ -631,9 +669,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
-version = "2.4.0"
+version = "2.4.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
+checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
[[package]]
name = "bitvec"
@@ -707,7 +745,6 @@ dependencies = [
"milagro_bls",
"rand",
"serde",
- "serde_derive",
"tree_hash",
"zeroize",
]
@@ -748,7 +785,6 @@ dependencies = [
"log",
"logging",
"serde",
- "serde_derive",
"serde_json",
"serde_yaml",
"slog",
@@ -801,9 +837,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c"
[[package]]
name = "byteorder"
-version = "1.4.3"
+version = "1.5.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
+checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "bytes"
@@ -835,6 +871,34 @@ dependencies = [
"pkg-config",
]
+[[package]]
+name = "c-kzg"
+version = "0.1.0"
+source = "git+/~https://github.com/ethereum//c-kzg-4844?rev=f5f6f863d475847876a2bd5ee252058d37c3a15d#f5f6f863d475847876a2bd5ee252058d37c3a15d"
+dependencies = [
+ "bindgen 0.66.1",
+ "blst",
+ "cc",
+ "glob",
+ "hex",
+ "libc",
+ "serde",
+]
+
+[[package]]
+name = "c-kzg"
+version = "0.1.0"
+source = "git+/~https://github.com/ethereum/c-kzg-4844?rev=f5f6f863d475847876a2bd5ee252058d37c3a15d#f5f6f863d475847876a2bd5ee252058d37c3a15d"
+dependencies = [
+ "bindgen 0.66.1",
+ "blst",
+ "cc",
+ "glob",
+ "hex",
+ "libc",
+ "serde",
+]
+
[[package]]
name = "cached_tree_hash"
version = "0.1.0"
@@ -861,9 +925,9 @@ dependencies = [
[[package]]
name = "cargo-platform"
-version = "0.1.3"
+version = "0.1.4"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479"
+checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36"
dependencies = [
"serde",
]
@@ -1039,7 +1103,6 @@ dependencies = [
"parking_lot 0.12.1",
"sensitive_url",
"serde",
- "serde_derive",
"serde_yaml",
"slasher",
"slasher_service",
@@ -1068,6 +1131,7 @@ name = "compare_fields"
version = "0.2.0"
dependencies = [
"compare_fields_derive",
+ "itertools",
]
[[package]]
@@ -1240,7 +1304,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef"
dependencies = [
"generic-array",
- "rand_core 0.6.4",
+ "rand_core",
"subtle",
"zeroize",
]
@@ -1252,7 +1316,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124"
dependencies = [
"generic-array",
- "rand_core 0.6.4",
+ "rand_core",
"subtle",
"zeroize",
]
@@ -1289,9 +1353,9 @@ dependencies = [
[[package]]
name = "csv"
-version = "1.2.2"
+version = "1.3.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086"
+checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe"
dependencies = [
"csv-core",
"itoa",
@@ -1301,9 +1365,9 @@ dependencies = [
[[package]]
name = "csv-core"
-version = "0.1.10"
+version = "0.1.11"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90"
+checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70"
dependencies = [
"memchr",
]
@@ -1327,19 +1391,6 @@ dependencies = [
"windows-sys 0.48.0",
]
-[[package]]
-name = "curve25519-dalek"
-version = "3.2.0"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61"
-dependencies = [
- "byteorder",
- "digest 0.9.0",
- "rand_core 0.5.1",
- "subtle",
- "zeroize",
-]
-
[[package]]
name = "curve25519-dalek"
version = "4.1.1"
@@ -1365,7 +1416,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -1534,9 +1585,12 @@ dependencies = [
[[package]]
name = "deranged"
-version = "0.3.8"
+version = "0.3.9"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946"
+checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3"
+dependencies = [
+ "powerfmt",
+]
[[package]]
name = "derivative"
@@ -1557,7 +1611,7 @@ checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -1575,11 +1629,11 @@ dependencies = [
[[package]]
name = "diesel"
-version = "2.1.2"
+version = "2.1.3"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "53c8a2cb22327206568569e5a45bb5a2c946455efdd76e24d15b7e82171af95e"
+checksum = "2268a214a6f118fce1838edba3d1561cf0e78d8de785475957a580a7f8c69d33"
dependencies = [
- "bitflags 2.4.0",
+ "bitflags 2.4.1",
"byteorder",
"diesel_derives",
"itoa",
@@ -1596,7 +1650,7 @@ dependencies = [
"diesel_table_macro_syntax",
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -1616,7 +1670,7 @@ version = "0.1.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5"
dependencies = [
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -1731,7 +1785,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -1766,7 +1820,7 @@ checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4"
dependencies = [
"der 0.7.8",
"digest 0.10.7",
- "elliptic-curve 0.13.5",
+ "elliptic-curve 0.13.6",
"rfc6979 0.4.0",
"signature 2.1.0",
"spki 0.7.2",
@@ -1774,9 +1828,9 @@ dependencies = [
[[package]]
name = "ed25519"
-version = "2.2.2"
+version = "2.2.3"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d"
+checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
dependencies = [
"pkcs8 0.10.2",
"signature 2.1.0",
@@ -1788,11 +1842,11 @@ version = "2.0.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980"
dependencies = [
- "curve25519-dalek 4.1.1",
+ "curve25519-dalek",
"ed25519",
- "rand_core 0.6.4",
+ "rand_core",
"serde",
- "sha2 0.10.7",
+ "sha2 0.10.8",
"zeroize",
]
@@ -1806,16 +1860,19 @@ dependencies = [
"compare_fields",
"compare_fields_derive",
"derivative",
+ "eth2_network_config",
"ethereum-types 0.14.1",
+ "ethereum_serde_utils",
"ethereum_ssz",
"ethereum_ssz_derive",
"execution_layer",
"fork_choice",
"fs2",
"hex",
+ "kzg",
"rayon",
"serde",
- "serde_derive",
+ "serde_json",
"serde_repr",
"serde_yaml",
"snap",
@@ -1846,7 +1903,7 @@ dependencies = [
"ff 0.12.1",
"generic-array",
"group 0.12.1",
- "rand_core 0.6.4",
+ "rand_core",
"sec1 0.3.0",
"subtle",
"zeroize",
@@ -1854,9 +1911,9 @@ dependencies = [
[[package]]
name = "elliptic-curve"
-version = "0.13.5"
+version = "0.13.6"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b"
+checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914"
dependencies = [
"base16ct 0.2.0",
"crypto-bigint 0.5.3",
@@ -1866,7 +1923,7 @@ dependencies = [
"group 0.13.0",
"pem-rfc7468",
"pkcs8 0.10.2",
- "rand_core 0.6.4",
+ "rand_core",
"sec1 0.7.3",
"subtle",
"zeroize",
@@ -1912,6 +1969,18 @@ dependencies = [
"syn 1.0.109",
]
+[[package]]
+name = "enum-as-inner"
+version = "0.6.0"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a"
+dependencies = [
+ "heck",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+]
+
[[package]]
name = "env_logger"
version = "0.8.4"
@@ -1946,7 +2015,6 @@ dependencies = [
"futures",
"logging",
"serde",
- "serde_derive",
"slog",
"slog-async",
"slog-json",
@@ -1964,24 +2032,22 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
-name = "errno"
-version = "0.3.3"
+name = "erased-serde"
+version = "0.3.31"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd"
+checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c"
dependencies = [
- "errno-dragonfly",
- "libc",
- "windows-sys 0.48.0",
+ "serde",
]
[[package]]
-name = "errno-dragonfly"
-version = "0.1.2"
+name = "errno"
+version = "0.3.5"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
+checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860"
dependencies = [
- "cc",
"libc",
+ "windows-sys 0.48.0",
]
[[package]]
@@ -2066,8 +2132,10 @@ dependencies = [
"serde",
"serde_json",
"slashing_protection",
+ "ssz_types",
"store",
"tokio",
+ "tree_hash",
"types",
]
@@ -2090,7 +2158,6 @@ dependencies = [
"lazy_static",
"num-bigint",
"serde",
- "serde_derive",
"serde_yaml",
]
@@ -2136,10 +2203,12 @@ dependencies = [
"discv5",
"eth2_config",
"ethereum_ssz",
+ "kzg",
"logging",
"pretty_reqwest_error",
"reqwest",
"sensitive_url",
+ "serde_json",
"serde_yaml",
"sha2 0.9.9",
"slog",
@@ -2260,7 +2329,7 @@ dependencies = [
"impl-codec 0.6.0",
"impl-rlp",
"impl-serde 0.4.0",
- "primitive-types 0.12.1",
+ "primitive-types 0.12.2",
"scale-info",
"uint",
]
@@ -2274,7 +2343,7 @@ dependencies = [
"cpufeatures",
"lazy_static",
"ring",
- "sha2 0.10.7",
+ "sha2 0.10.8",
]
[[package]]
@@ -2343,7 +2412,7 @@ dependencies = [
"dunce",
"ethers-core",
"eyre",
- "getrandom 0.2.10",
+ "getrandom",
"hex",
"proc-macro2",
"quote",
@@ -2414,7 +2483,7 @@ dependencies = [
"futures-core",
"futures-timer",
"futures-util",
- "getrandom 0.2.10",
+ "getrandom",
"hashers",
"hex",
"http",
@@ -2476,6 +2545,7 @@ dependencies = [
"bytes",
"environment",
"eth2",
+ "eth2_network_config",
"ethereum_serde_utils",
"ethereum_ssz",
"ethers-core",
@@ -2487,6 +2557,7 @@ dependencies = [
"hex",
"jsonwebtoken",
"keccak-hash",
+ "kzg",
"lazy_static",
"lighthouse_metrics",
"lru 0.7.8",
@@ -2567,7 +2638,7 @@ version = "0.12.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160"
dependencies = [
- "rand_core 0.6.4",
+ "rand_core",
"subtle",
]
@@ -2577,7 +2648,7 @@ version = "0.13.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449"
dependencies = [
- "rand_core 0.6.4",
+ "rand_core",
"subtle",
]
@@ -2644,9 +2715,9 @@ dependencies = [
[[package]]
name = "flate2"
-version = "1.0.27"
+version = "1.0.28"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010"
+checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
dependencies = [
"crc32fast",
"libz-sys",
@@ -2735,6 +2806,16 @@ dependencies = [
"futures-util",
]
+[[package]]
+name = "futures-bounded"
+version = "0.1.0"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "8b07bbbe7d7e78809544c6f718d875627addc73a7c3582447abc052cd3dc67e0"
+dependencies = [
+ "futures-timer",
+ "futures-util",
+]
+
[[package]]
name = "futures-channel"
version = "0.3.28"
@@ -2792,7 +2873,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -2893,17 +2974,6 @@ dependencies = [
"types",
]
-[[package]]
-name = "getrandom"
-version = "0.1.16"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi 0.9.0+wasi-snapshot-preview1",
-]
-
[[package]]
name = "getrandom"
version = "0.2.10"
@@ -2913,7 +2983,7 @@ dependencies = [
"cfg-if",
"js-sys",
"libc",
- "wasi 0.11.0+wasi-snapshot-preview1",
+ "wasi",
"wasm-bindgen",
]
@@ -2968,7 +3038,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7"
dependencies = [
"ff 0.12.1",
- "rand_core 0.6.4",
+ "rand_core",
"subtle",
]
@@ -2979,7 +3049,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
dependencies = [
"ff 0.13.0",
- "rand_core 0.6.4",
+ "rand_core",
"subtle",
]
@@ -3043,18 +3113,9 @@ dependencies = [
[[package]]
name = "hashbrown"
-version = "0.13.2"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
-dependencies = [
- "ahash 0.8.3",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.14.0"
+version = "0.14.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
+checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12"
dependencies = [
"ahash 0.8.3",
"allocator-api2",
@@ -3084,7 +3145,7 @@ version = "0.8.4"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7"
dependencies = [
- "hashbrown 0.14.0",
+ "hashbrown 0.14.1",
]
[[package]]
@@ -3193,6 +3254,15 @@ dependencies = [
"hmac 0.8.1",
]
+[[package]]
+name = "home"
+version = "0.5.5"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"
+dependencies = [
+ "windows-sys 0.48.0",
+]
+
[[package]]
name = "hostname"
version = "0.3.1"
@@ -3365,16 +3435,16 @@ dependencies = [
[[package]]
name = "iana-time-zone"
-version = "0.1.57"
+version = "0.1.58"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613"
+checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
- "windows 0.48.0",
+ "windows-core",
]
[[package]]
@@ -3446,9 +3516,9 @@ dependencies = [
[[package]]
name = "if-watch"
-version = "3.0.1"
+version = "3.1.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f"
+checksum = "bbb892e5777fe09e16f3d44de7802f4daa7267ecbe8c466f19d94e25bb0c303e"
dependencies = [
"async-io",
"core-foundation",
@@ -3460,7 +3530,7 @@ dependencies = [
"rtnetlink",
"system-configuration",
"tokio",
- "windows 0.34.0",
+ "windows",
]
[[package]]
@@ -3469,9 +3539,28 @@ version = "0.12.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "556b5a75cd4adb7c4ea21c64af1c48cefb2ce7d43dc4352c720a1fe47c21f355"
dependencies = [
- "attohttpc",
+ "attohttpc 0.16.3",
+ "log",
+ "rand",
+ "url",
+ "xmltree",
+]
+
+[[package]]
+name = "igd-next"
+version = "0.14.2"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "57e065e90a518ab5fedf79aa1e4b784e10f8e484a834f6bda85c42633a2cb7af"
+dependencies = [
+ "async-trait",
+ "attohttpc 0.24.1",
+ "bytes",
+ "futures",
+ "http",
+ "hyper",
"log",
"rand",
+ "tokio",
"url",
"xmltree",
]
@@ -3550,12 +3639,12 @@ dependencies = [
[[package]]
name = "indexmap"
-version = "2.0.0"
+version = "2.0.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
+checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897"
dependencies = [
"equivalent",
- "hashbrown 0.14.0",
+ "hashbrown 0.14.1",
]
[[package]]
@@ -3674,9 +3763,9 @@ dependencies = [
[[package]]
name = "jobserver"
-version = "0.1.26"
+version = "0.1.27"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
+checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d"
dependencies = [
"libc",
]
@@ -3713,7 +3802,7 @@ dependencies = [
"cfg-if",
"ecdsa 0.14.8",
"elliptic-curve 0.12.3",
- "sha2 0.10.7",
+ "sha2 0.10.8",
"sha3 0.10.8",
]
@@ -3725,9 +3814,9 @@ checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc"
dependencies = [
"cfg-if",
"ecdsa 0.16.8",
- "elliptic-curve 0.13.5",
+ "elliptic-curve 0.13.6",
"once_cell",
- "sha2 0.10.7",
+ "sha2 0.10.8",
"signature 2.1.0",
]
@@ -3746,10 +3835,27 @@ version = "0.10.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "4b286e6b663fb926e1eeb68528e69cb70ed46c6d65871a21b2215ae8154c6d3c"
dependencies = [
- "primitive-types 0.12.1",
+ "primitive-types 0.12.2",
"tiny-keccak",
]
+[[package]]
+name = "kzg"
+version = "0.1.0"
+dependencies = [
+ "arbitrary",
+ "c-kzg 0.1.0 (git+/~https://github.com/ethereum//c-kzg-4844?rev=f5f6f863d475847876a2bd5ee252058d37c3a15d)",
+ "c-kzg 0.1.0 (git+/~https://github.com/ethereum/c-kzg-4844?rev=f5f6f863d475847876a2bd5ee252058d37c3a15d)",
+ "derivative",
+ "ethereum_hashing",
+ "ethereum_serde_utils",
+ "ethereum_ssz",
+ "ethereum_ssz_derive",
+ "hex",
+ "serde",
+ "tree_hash",
+]
+
[[package]]
name = "lazy_static"
version = "1.4.0"
@@ -3786,6 +3892,7 @@ dependencies = [
"ethereum_ssz",
"genesis",
"int_to_bytes",
+ "kzg",
"lighthouse_network",
"lighthouse_version",
"log",
@@ -3828,9 +3935,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.148"
+version = "0.2.149"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
+checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
[[package]]
name = "libflate"
@@ -3864,9 +3971,9 @@ dependencies = [
[[package]]
name = "libm"
-version = "0.2.7"
+version = "0.2.8"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4"
+checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
[[package]]
name = "libmdbx"
@@ -3885,14 +3992,15 @@ dependencies = [
[[package]]
name = "libp2p"
-version = "0.52.3"
+version = "0.52.4"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "32d07d1502a027366d55afe187621c2d7895dc111a3df13b35fed698049681d7"
+checksum = "e94495eb319a85b70a68b85e2389a95bb3555c71c49025b78c691a854a7e6464"
dependencies = [
"bytes",
+ "either",
"futures",
"futures-timer",
- "getrandom 0.2.10",
+ "getrandom",
"instant",
"libp2p-allow-block-list",
"libp2p-connection-limits",
@@ -3908,9 +4016,12 @@ dependencies = [
"libp2p-quic",
"libp2p-swarm",
"libp2p-tcp",
+ "libp2p-upnp",
"libp2p-yamux",
"multiaddr",
"pin-project",
+ "rw-stream-sink",
+ "thiserror",
]
[[package]]
@@ -3967,10 +4078,11 @@ dependencies = [
[[package]]
name = "libp2p-dns"
-version = "0.40.0"
+version = "0.40.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "fd4394c81c0c06d7b4a60f3face7e8e8a9b246840f98d2c80508d0721b032147"
+checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b"
dependencies = [
+ "async-trait",
"futures",
"libp2p-core",
"libp2p-identity",
@@ -3982,9 +4094,9 @@ dependencies = [
[[package]]
name = "libp2p-gossipsub"
-version = "0.45.1"
+version = "0.45.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "2d157562dba6017193e5285acf6b1054759e83540bfd79f75b69d6ce774c88da"
+checksum = "f1f9624e2a843b655f1c1b8262b8d5de6f309413fca4d66f01bb0662429f84dc"
dependencies = [
"asynchronous-codec",
"base64 0.21.4",
@@ -3994,7 +4106,7 @@ dependencies = [
"fnv",
"futures",
"futures-ticker",
- "getrandom 0.2.10",
+ "getrandom",
"hex_fmt",
"instant",
"libp2p-core",
@@ -4006,7 +4118,7 @@ dependencies = [
"quick-protobuf-codec",
"rand",
"regex",
- "sha2 0.10.7",
+ "sha2 0.10.8",
"smallvec",
"unsigned-varint 0.7.2",
"void",
@@ -4014,19 +4126,20 @@ dependencies = [
[[package]]
name = "libp2p-identify"
-version = "0.43.0"
+version = "0.43.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "6a29675a32dbcc87790db6cf599709e64308f1ae9d5ecea2d259155889982db8"
+checksum = "45a96638a0a176bec0a4bcaebc1afa8cf909b114477209d7456ade52c61cd9cd"
dependencies = [
"asynchronous-codec",
"either",
"futures",
+ "futures-bounded",
"futures-timer",
"libp2p-core",
"libp2p-identity",
"libp2p-swarm",
"log",
- "lru 0.10.1",
+ "lru 0.12.0",
"quick-protobuf",
"quick-protobuf-codec",
"smallvec",
@@ -4036,13 +4149,14 @@ dependencies = [
[[package]]
name = "libp2p-identity"
-version = "0.2.3"
+version = "0.2.7"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "686e73aff5e23efbb99bc85340ea6fd8686986aa7b283a881ba182cfca535ca9"
+checksum = "cdd6317441f361babc74c2989c6484eb0726045399b6648de039e1805ea96972"
dependencies = [
"asn1_der",
"bs58 0.5.0",
"ed25519-dalek",
+ "hkdf",
"libsecp256k1",
"log",
"multihash",
@@ -4050,7 +4164,7 @@ dependencies = [
"quick-protobuf",
"rand",
"sec1 0.7.3",
- "sha2 0.10.7",
+ "sha2 0.10.8",
"thiserror",
"void",
"zeroize",
@@ -4073,7 +4187,7 @@ dependencies = [
"smallvec",
"socket2 0.5.4",
"tokio",
- "trust-dns-proto",
+ "trust-dns-proto 0.22.0",
"void",
]
@@ -4114,12 +4228,12 @@ dependencies = [
[[package]]
name = "libp2p-noise"
-version = "0.43.1"
+version = "0.43.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "71ce70757f2c0d82e9a3ef738fb10ea0723d16cec37f078f719e2c247704c1bb"
+checksum = "d2eeec39ad3ad0677551907dd304b2f13f17208ccebe333bef194076cd2e8921"
dependencies = [
"bytes",
- "curve25519-dalek 4.1.1",
+ "curve25519-dalek",
"futures",
"libp2p-core",
"libp2p-identity",
@@ -4129,7 +4243,7 @@ dependencies = [
"once_cell",
"quick-protobuf",
"rand",
- "sha2 0.10.7",
+ "sha2 0.10.8",
"snow",
"static_assertions",
"thiserror",
@@ -4139,9 +4253,9 @@ dependencies = [
[[package]]
name = "libp2p-plaintext"
-version = "0.40.0"
+version = "0.40.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "37266c683a757df713f7dcda0cdcb5ad4681355ffa1b37b77c113c176a531195"
+checksum = "53cc5390cc2f77b7de2452fb6105892d0bb64e3cafa3bb346abb603f4cc93a09"
dependencies = [
"asynchronous-codec",
"bytes",
@@ -4155,9 +4269,9 @@ dependencies = [
[[package]]
name = "libp2p-quic"
-version = "0.9.2"
+version = "0.9.3"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "4cb763e88f9a043546bfebd3575f340e7dd3d6c1b2cf2629600ec8965360c63a"
+checksum = "130d451d83f21b81eb7b35b360bc7972aeafb15177784adc56528db082e6b927"
dependencies = [
"bytes",
"futures",
@@ -4170,6 +4284,7 @@ dependencies = [
"parking_lot 0.12.1",
"quinn",
"rand",
+ "ring",
"rustls",
"socket2 0.5.4",
"thiserror",
@@ -4178,9 +4293,9 @@ dependencies = [
[[package]]
name = "libp2p-swarm"
-version = "0.43.4"
+version = "0.43.6"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "f0cf749abdc5ca1dce6296dc8ea0f012464dfcfd3ddd67ffc0cabd8241c4e1da"
+checksum = "48ff0e918a45fec0b6f27b30b0547a57c6c214aa8b13be3647b7701bfd8b8797"
dependencies = [
"either",
"fnv",
@@ -4209,14 +4324,14 @@ dependencies = [
"proc-macro-warning",
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
name = "libp2p-tcp"
-version = "0.40.0"
+version = "0.40.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "09bfdfb6f945c5c014b87872a0bdb6e0aef90e92f380ef57cd9013f118f9289d"
+checksum = "b558dd40d1bcd1aaaed9de898e9ec6a436019ecc2420dd0016e712fbb61c5508"
dependencies = [
"futures",
"futures-timer",
@@ -4248,6 +4363,22 @@ dependencies = [
"yasna",
]
+[[package]]
+name = "libp2p-upnp"
+version = "0.1.1"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "82775a47b34f10f787ad3e2a22e2c1541e6ebef4fe9f28f3ac553921554c94c1"
+dependencies = [
+ "futures",
+ "futures-timer",
+ "igd-next",
+ "libp2p-core",
+ "libp2p-swarm",
+ "log",
+ "tokio",
+ "void",
+]
+
[[package]]
name = "libp2p-yamux"
version = "0.44.1"
@@ -4412,7 +4543,6 @@ dependencies = [
"rand",
"regex",
"serde",
- "serde_derive",
"sha2 0.9.9",
"slog",
"slog-async",
@@ -4465,9 +4595,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
[[package]]
name = "linux-raw-sys"
-version = "0.4.7"
+version = "0.4.10"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128"
+checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
[[package]]
name = "lmdb-rkv"
@@ -4492,9 +4622,9 @@ dependencies = [
[[package]]
name = "lock_api"
-version = "0.4.10"
+version = "0.4.11"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16"
+checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
dependencies = [
"autocfg",
"scopeguard",
@@ -4543,11 +4673,11 @@ dependencies = [
[[package]]
name = "lru"
-version = "0.10.1"
+version = "0.12.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670"
+checksum = "1efa59af2ddfad1854ae27d75009d538d0998b4b2fd47083e743ac1a10e46c60"
dependencies = [
- "hashbrown 0.13.2",
+ "hashbrown 0.14.1",
]
[[package]]
@@ -4636,7 +4766,7 @@ name = "mdbx-sys"
version = "0.11.6-4"
source = "git+/~https://github.com/sigp/libmdbx-rs?tag=v0.1.4#096da80a83d14343f8df833006483f48075cd135"
dependencies = [
- "bindgen",
+ "bindgen 0.59.2",
"cc",
"cmake",
"libc",
@@ -4650,9 +4780,9 @@ checksum = "8c408dc227d302f1496c84d9dc68c00fec6f56f9228a18f3023f976f3ca7c945"
[[package]]
name = "memchr"
-version = "2.6.3"
+version = "2.6.4"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c"
+checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
[[package]]
name = "memoffset"
@@ -4778,7 +4908,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
dependencies = [
"libc",
- "wasi 0.11.0+wasi-snapshot-preview1",
+ "wasi",
"windows-sys 0.48.0",
]
@@ -4800,7 +4930,6 @@ dependencies = [
"reqwest",
"sensitive_url",
"serde",
- "serde_derive",
"serde_json",
"slog",
"store",
@@ -4962,6 +5091,7 @@ dependencies = [
"derivative",
"environment",
"error-chain",
+ "eth2",
"ethereum-types 0.14.1",
"ethereum_ssz",
"execution_layer",
@@ -4977,6 +5107,7 @@ dependencies = [
"lighthouse_metrics",
"lighthouse_network",
"logging",
+ "lru 0.7.8",
"lru_cache",
"matches",
"num_cpus",
@@ -5030,7 +5161,7 @@ version = "0.27.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
- "bitflags 2.4.0",
+ "bitflags 2.4.1",
"cfg-if",
"libc",
]
@@ -5138,9 +5269,9 @@ dependencies = [
[[package]]
name = "num-traits"
-version = "0.2.16"
+version = "0.2.17"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2"
+checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
dependencies = [
"autocfg",
]
@@ -5238,7 +5369,7 @@ version = "0.10.57"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c"
dependencies = [
- "bitflags 2.4.0",
+ "bitflags 2.4.1",
"cfg-if",
"foreign-types",
"libc",
@@ -5255,7 +5386,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -5303,7 +5434,6 @@ dependencies = [
"rand",
"rayon",
"serde",
- "serde_derive",
"state_processing",
"store",
"tokio",
@@ -5323,9 +5453,9 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b"
dependencies = [
"ecdsa 0.16.8",
- "elliptic-curve 0.13.5",
+ "elliptic-curve 0.13.6",
"primeorder",
- "sha2 0.10.7",
+ "sha2 0.10.8",
]
[[package]]
@@ -5382,9 +5512,9 @@ dependencies = [
[[package]]
name = "parking"
-version = "2.1.1"
+version = "2.2.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067"
+checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
[[package]]
name = "parking_lot"
@@ -5404,7 +5534,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
- "parking_lot_core 0.9.8",
+ "parking_lot_core 0.9.9",
]
[[package]]
@@ -5423,13 +5553,13 @@ dependencies = [
[[package]]
name = "parking_lot_core"
-version = "0.9.8"
+version = "0.9.9"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"
+checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
dependencies = [
"cfg-if",
"libc",
- "redox_syscall 0.3.5",
+ "redox_syscall 0.4.1",
"smallvec",
"windows-targets 0.48.5",
]
@@ -5441,7 +5571,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700"
dependencies = [
"base64ct",
- "rand_core 0.6.4",
+ "rand_core",
"subtle",
]
@@ -5469,7 +5599,7 @@ dependencies = [
"digest 0.10.7",
"hmac 0.12.1",
"password-hash",
- "sha2 0.10.7",
+ "sha2 0.10.8",
]
[[package]]
@@ -5547,7 +5677,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -5681,7 +5811,7 @@ dependencies = [
"md-5",
"memchr",
"rand",
- "sha2 0.10.7",
+ "sha2 0.10.8",
"stringprep",
]
@@ -5696,6 +5826,12 @@ dependencies = [
"postgres-protocol",
]
+[[package]]
+name = "powerfmt"
+version = "0.2.0"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
+
[[package]]
name = "ppv-lite86"
version = "0.2.17"
@@ -5719,13 +5855,23 @@ dependencies = [
"sensitive_url",
]
+[[package]]
+name = "prettyplease"
+version = "0.2.15"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d"
+dependencies = [
+ "proc-macro2",
+ "syn 2.0.38",
+]
+
[[package]]
name = "primeorder"
version = "0.13.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "3c2fcef82c0ec6eefcc179b978446c399b3cdf73c392c35604e399eee6df1ee3"
dependencies = [
- "elliptic-curve 0.13.5",
+ "elliptic-curve 0.13.6",
]
[[package]]
@@ -5743,9 +5889,9 @@ dependencies = [
[[package]]
name = "primitive-types"
-version = "0.12.1"
+version = "0.12.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66"
+checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2"
dependencies = [
"fixed-hash 0.8.0",
"impl-codec 0.6.0",
@@ -5757,12 +5903,12 @@ dependencies = [
[[package]]
name = "proc-macro-crate"
-version = "1.1.3"
+version = "1.3.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a"
+checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919"
dependencies = [
- "thiserror",
- "toml 0.5.11",
+ "once_cell",
+ "toml_edit",
]
[[package]]
@@ -5803,14 +5949,14 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
name = "proc-macro2"
-version = "1.0.67"
+version = "1.0.69"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328"
+checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
dependencies = [
"unicode-ident",
]
@@ -5827,7 +5973,7 @@ dependencies = [
"flate2",
"hex",
"lazy_static",
- "rustix 0.36.15",
+ "rustix 0.36.16",
]
[[package]]
@@ -5865,7 +6011,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -5876,7 +6022,6 @@ dependencies = [
"ethereum_ssz_derive",
"safe_arith",
"serde",
- "serde_derive",
"serde_yaml",
"superstruct",
"types",
@@ -6055,7 +6200,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
"rand_chacha",
- "rand_core 0.6.4",
+ "rand_core",
]
[[package]]
@@ -6065,16 +6210,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
- "rand_core 0.6.4",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.5.1"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
-dependencies = [
- "getrandom 0.1.16",
+ "rand_core",
]
[[package]]
@@ -6083,7 +6219,7 @@ version = "0.6.4"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
- "getrandom 0.2.10",
+ "getrandom",
]
[[package]]
@@ -6092,7 +6228,7 @@ version = "0.3.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f"
dependencies = [
- "rand_core 0.6.4",
+ "rand_core",
]
[[package]]
@@ -6145,27 +6281,36 @@ dependencies = [
"bitflags 1.3.2",
]
+[[package]]
+name = "redox_syscall"
+version = "0.4.1"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
+dependencies = [
+ "bitflags 1.3.2",
+]
+
[[package]]
name = "redox_users"
version = "0.4.3"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
dependencies = [
- "getrandom 0.2.10",
+ "getrandom",
"redox_syscall 0.2.16",
"thiserror",
]
[[package]]
name = "regex"
-version = "1.9.5"
+version = "1.10.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47"
+checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
dependencies = [
"aho-corasick",
"memchr",
- "regex-automata 0.3.8",
- "regex-syntax 0.7.5",
+ "regex-automata 0.4.3",
+ "regex-syntax 0.8.2",
]
[[package]]
@@ -6179,13 +6324,13 @@ dependencies = [
[[package]]
name = "regex-automata"
-version = "0.3.8"
+version = "0.4.3"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795"
+checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
dependencies = [
"aho-corasick",
"memchr",
- "regex-syntax 0.7.5",
+ "regex-syntax 0.8.2",
]
[[package]]
@@ -6196,15 +6341,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
-version = "0.7.5"
+version = "0.8.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
+checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]]
name = "reqwest"
-version = "0.11.20"
+version = "0.11.22"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1"
+checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b"
dependencies = [
"base64 0.21.4",
"bytes",
@@ -6230,6 +6375,7 @@ dependencies = [
"serde",
"serde_json",
"serde_urlencoded",
+ "system-configuration",
"tokio",
"tokio-native-tls",
"tokio-rustls",
@@ -6394,9 +6540,9 @@ dependencies = [
[[package]]
name = "rustix"
-version = "0.36.15"
+version = "0.36.16"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941"
+checksum = "6da3636faa25820d8648e0e31c5d519bbb01f72fdf57131f0f5f7da5fed36eab"
dependencies = [
"bitflags 1.3.2",
"errno",
@@ -6408,9 +6554,9 @@ dependencies = [
[[package]]
name = "rustix"
-version = "0.37.23"
+version = "0.37.26"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06"
+checksum = "84f3f8f960ed3b5a59055428714943298bf3fa2d4a1d53135084e0544829d995"
dependencies = [
"bitflags 1.3.2",
"errno",
@@ -6422,14 +6568,14 @@ dependencies = [
[[package]]
name = "rustix"
-version = "0.38.14"
+version = "0.38.20"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f"
+checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0"
dependencies = [
- "bitflags 2.4.0",
+ "bitflags 2.4.1",
"errno",
"libc",
- "linux-raw-sys 0.4.7",
+ "linux-raw-sys 0.4.10",
"windows-sys 0.48.0",
]
@@ -6638,9 +6784,9 @@ dependencies = [
[[package]]
name = "semver"
-version = "1.0.19"
+version = "1.0.20"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0"
+checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
dependencies = [
"serde",
]
@@ -6661,9 +6807,9 @@ dependencies = [
[[package]]
name = "serde"
-version = "1.0.188"
+version = "1.0.189"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
+checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537"
dependencies = [
"serde_derive",
]
@@ -6690,13 +6836,13 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.188"
+version = "1.0.189"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
+checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -6728,7 +6874,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -6812,9 +6958,9 @@ dependencies = [
[[package]]
name = "sha2"
-version = "0.10.7"
+version = "0.10.8"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8"
+checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
dependencies = [
"cfg-if",
"cpufeatures",
@@ -6845,9 +6991,9 @@ dependencies = [
[[package]]
name = "sharded-slab"
-version = "0.1.4"
+version = "0.1.7"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31"
+checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
dependencies = [
"lazy_static",
]
@@ -6874,7 +7020,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
dependencies = [
"digest 0.10.7",
- "rand_core 0.6.4",
+ "rand_core",
]
[[package]]
@@ -6884,7 +7030,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500"
dependencies = [
"digest 0.10.7",
- "rand_core 0.6.4",
+ "rand_core",
]
[[package]]
@@ -6955,7 +7101,6 @@ dependencies = [
"rayon",
"safe_arith",
"serde",
- "serde_derive",
"slog",
"sloggers",
"strum",
@@ -6995,7 +7140,6 @@ dependencies = [
"rayon",
"rusqlite",
"serde",
- "serde_derive",
"serde_json",
"tempfile",
"types",
@@ -7006,6 +7150,9 @@ name = "slog"
version = "2.7.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06"
+dependencies = [
+ "erased-serde",
+]
[[package]]
name = "slog-async"
@@ -7131,11 +7278,11 @@ dependencies = [
"aes-gcm",
"blake2",
"chacha20poly1305",
- "curve25519-dalek 4.1.1",
- "rand_core 0.6.4",
+ "curve25519-dalek",
+ "rand_core",
"ring",
"rustc_version",
- "sha2 0.10.7",
+ "sha2 0.10.8",
"subtle",
]
@@ -7264,7 +7411,6 @@ dependencies = [
"lru 0.7.8",
"parking_lot 0.12.1",
"serde",
- "serde_derive",
"slog",
"sloggers",
"state_processing",
@@ -7360,9 +7506,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.37"
+version = "2.0.38"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8"
+checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
dependencies = [
"proc-macro2",
"quote",
@@ -7430,7 +7576,6 @@ dependencies = [
"lighthouse_network",
"parking_lot 0.12.1",
"serde",
- "serde_derive",
"serde_json",
"sysinfo",
"types",
@@ -7483,7 +7628,7 @@ dependencies = [
"cfg-if",
"fastrand 2.0.1",
"redox_syscall 0.3.5",
- "rustix 0.38.14",
+ "rustix 0.38.20",
"windows-sys 0.48.0",
]
@@ -7536,7 +7681,7 @@ dependencies = [
"rand",
"serde",
"serde_json",
- "sha2 0.10.7",
+ "sha2 0.10.8",
]
[[package]]
@@ -7550,22 +7695,22 @@ dependencies = [
[[package]]
name = "thiserror"
-version = "1.0.48"
+version = "1.0.49"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7"
+checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.48"
+version = "1.0.49"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35"
+checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -7589,14 +7734,15 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe"
+checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"
dependencies = [
"deranged",
"itoa",
"libc",
"num_threads",
+ "powerfmt",
"serde",
"time-core",
"time-macros",
@@ -7640,7 +7786,7 @@ dependencies = [
"pbkdf2 0.11.0",
"rand",
"rustc-hash",
- "sha2 0.10.7",
+ "sha2 0.10.8",
"thiserror",
"unicode-normalization",
"wasm-bindgen",
@@ -7683,9 +7829,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.32.0"
+version = "1.33.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9"
+checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653"
dependencies = [
"backtrace",
"bytes",
@@ -7717,7 +7863,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -7845,7 +7991,7 @@ version = "0.19.15"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
- "indexmap 2.0.0",
+ "indexmap 2.0.2",
"serde",
"serde_spanned",
"toml_datetime",
@@ -7882,11 +8028,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
[[package]]
name = "tracing"
-version = "0.1.37"
+version = "0.1.40"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
+checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
dependencies = [
- "cfg-if",
"log",
"pin-project-lite",
"tracing-attributes",
@@ -7895,20 +8040,20 @@ dependencies = [
[[package]]
name = "tracing-attributes"
-version = "0.1.26"
+version = "0.1.27"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
+checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
name = "tracing-core"
-version = "0.1.31"
+version = "0.1.32"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a"
+checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
dependencies = [
"once_cell",
"valuable",
@@ -8013,7 +8158,7 @@ dependencies = [
"async-trait",
"cfg-if",
"data-encoding",
- "enum-as-inner",
+ "enum-as-inner 0.5.1",
"futures-channel",
"futures-io",
"futures-util",
@@ -8030,24 +8175,50 @@ dependencies = [
"url",
]
+[[package]]
+name = "trust-dns-proto"
+version = "0.23.1"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "559ac980345f7f5020883dd3bcacf176355225e01916f8c2efecad7534f682c6"
+dependencies = [
+ "async-trait",
+ "cfg-if",
+ "data-encoding",
+ "enum-as-inner 0.6.0",
+ "futures-channel",
+ "futures-io",
+ "futures-util",
+ "idna 0.4.0",
+ "ipnet",
+ "once_cell",
+ "rand",
+ "smallvec",
+ "thiserror",
+ "tinyvec",
+ "tokio",
+ "tracing",
+ "url",
+]
+
[[package]]
name = "trust-dns-resolver"
-version = "0.22.0"
+version = "0.23.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe"
+checksum = "c723b0e608b24ad04c73b2607e0241b2c98fd79795a95e98b068b6966138a29d"
dependencies = [
"cfg-if",
"futures-util",
"ipconfig",
- "lazy_static",
"lru-cache",
+ "once_cell",
"parking_lot 0.12.1",
+ "rand",
"resolv-conf",
"smallvec",
"thiserror",
"tokio",
"tracing",
- "trust-dns-proto",
+ "trust-dns-proto 0.23.1",
]
[[package]]
@@ -8083,6 +8254,7 @@ dependencies = [
"hex",
"int_to_bytes",
"itertools",
+ "kzg",
"lazy_static",
"log",
"maplit",
@@ -8097,9 +8269,7 @@ dependencies = [
"rusqlite",
"safe_arith",
"serde",
- "serde_derive",
"serde_json",
- "serde_with",
"serde_yaml",
"slog",
"smallvec",
@@ -8238,7 +8408,7 @@ version = "0.8.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
dependencies = [
- "getrandom 0.2.10",
+ "getrandom",
"serde",
]
@@ -8279,7 +8449,6 @@ dependencies = [
"safe_arith",
"sensitive_url",
"serde",
- "serde_derive",
"serde_json",
"slashing_protection",
"slog",
@@ -8398,8 +8567,8 @@ dependencies = [
[[package]]
name = "warp"
-version = "0.3.5"
-source = "git+/~https://github.com/seanmonstar/warp.git#5ad8a9cb155f6485d13d591a564d8c70053a388a"
+version = "0.3.6"
+source = "git+/~https://github.com/seanmonstar/warp.git#efe8548a19172e69918396d0fdbc369df9d0eb17"
dependencies = [
"bytes",
"futures-channel",
@@ -8443,12 +8612,6 @@ dependencies = [
"warp",
]
-[[package]]
-name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
@@ -8476,7 +8639,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
"wasm-bindgen-shared",
]
@@ -8510,7 +8673,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -8626,6 +8789,18 @@ version = "0.25.2"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
+[[package]]
+name = "which"
+version = "4.4.2"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
+dependencies = [
+ "either",
+ "home",
+ "once_cell",
+ "rustix 0.38.20",
+]
+
[[package]]
name = "whoami"
version = "1.4.1"
@@ -8687,23 +8862,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
-version = "0.34.0"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f"
-dependencies = [
- "windows_aarch64_msvc 0.34.0",
- "windows_i686_gnu 0.34.0",
- "windows_i686_msvc 0.34.0",
- "windows_x86_64_gnu 0.34.0",
- "windows_x86_64_msvc 0.34.0",
-]
-
-[[package]]
-name = "windows"
-version = "0.48.0"
+version = "0.51.1"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
+checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9"
dependencies = [
+ "windows-core",
"windows-targets 0.48.5",
]
@@ -8719,6 +8882,15 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "windows-core"
+version = "0.51.1"
+source = "registry+/~https://github.com/rust-lang/crates.io-index"
+checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64"
+dependencies = [
+ "windows-targets 0.48.5",
+]
+
[[package]]
name = "windows-sys"
version = "0.45.0"
@@ -8779,12 +8951,6 @@ version = "0.48.5"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.34.0"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d"
-
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.2"
@@ -8797,12 +8963,6 @@ version = "0.48.5"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
-[[package]]
-name = "windows_i686_gnu"
-version = "0.34.0"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed"
-
[[package]]
name = "windows_i686_gnu"
version = "0.42.2"
@@ -8815,12 +8975,6 @@ version = "0.48.5"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
-[[package]]
-name = "windows_i686_msvc"
-version = "0.34.0"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956"
-
[[package]]
name = "windows_i686_msvc"
version = "0.42.2"
@@ -8833,12 +8987,6 @@ version = "0.48.5"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.34.0"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4"
-
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.2"
@@ -8863,12 +9011,6 @@ version = "0.48.5"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.34.0"
-source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9"
-
[[package]]
name = "windows_x86_64_msvc"
version = "0.42.2"
@@ -8883,9 +9025,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "winnow"
-version = "0.5.15"
+version = "0.5.17"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc"
+checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c"
dependencies = [
"memchr",
]
@@ -8936,12 +9078,13 @@ dependencies = [
[[package]]
name = "x25519-dalek"
-version = "1.1.1"
+version = "2.0.0"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f"
+checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96"
dependencies = [
- "curve25519-dalek 3.2.0",
- "rand_core 0.5.1",
+ "curve25519-dalek",
+ "rand_core",
+ "serde",
"zeroize",
]
@@ -9027,7 +9170,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.37",
+ "syn 2.0.38",
]
[[package]]
@@ -9071,11 +9214,10 @@ dependencies = [
[[package]]
name = "zstd-sys"
-version = "2.0.8+zstd.1.5.5"
+version = "2.0.9+zstd.1.5.5"
source = "registry+/~https://github.com/rust-lang/crates.io-index"
-checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c"
+checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656"
dependencies = [
"cc",
- "libc",
"pkg-config",
]
diff --git a/Cargo.toml b/Cargo.toml
index 901ceea68be..9adb913ff5e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -59,6 +59,7 @@ members = [
"consensus/swap_or_not_shuffle",
"crypto/bls",
+ "crypto/kzg",
"crypto/eth2_key_derivation",
"crypto/eth2_keystore",
"crypto/eth2_wallet",
@@ -144,7 +145,7 @@ serde_json = "1"
serde_repr = "0.1"
serde_yaml = "0.8"
sha2 = "0.9"
-slog = { version = "2", features = ["max_level_trace", "release_max_level_trace"] }
+slog = { version = "2", features = ["max_level_trace", "release_max_level_trace", "nested-values"] }
slog-async = "2"
slog-term = "2"
sloggers = { version = "2", features = ["json"] }
@@ -194,6 +195,7 @@ fork_choice = { path = "consensus/fork_choice" }
genesis = { path = "beacon_node/genesis" }
http_api = { path = "beacon_node/http_api" }
int_to_bytes = { path = "consensus/int_to_bytes" }
+kzg = { path = "crypto/kzg" }
lighthouse_metrics = { path = "common/lighthouse_metrics" }
lighthouse_network = { path = "beacon_node/lighthouse_network" }
lighthouse_version = { path = "common/lighthouse_version" }
diff --git a/Cross.toml b/Cross.toml
index d5f7a5d5068..871391253d3 100644
--- a/Cross.toml
+++ b/Cross.toml
@@ -1,5 +1,5 @@
[target.x86_64-unknown-linux-gnu]
-pre-build = ["apt-get install -y cmake clang-3.9"]
+pre-build = ["apt-get install -y cmake clang-5.0"]
[target.aarch64-unknown-linux-gnu]
-pre-build = ["apt-get install -y cmake clang-3.9"]
+pre-build = ["apt-get install -y cmake clang-5.0"]
diff --git a/Dockerfile b/Dockerfile
index bcddef8a6f3..878a3602bd2 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,8 +3,10 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-de
COPY . lighthouse
ARG FEATURES
ARG PROFILE=release
+ARG CARGO_USE_GIT_CLI=true
ENV FEATURES $FEATURES
ENV PROFILE $PROFILE
+ENV CARGO_NET_GIT_FETCH_WITH_CLI=$CARGO_USE_GIT_CLI
RUN cd lighthouse && make
FROM ubuntu:22.04
diff --git a/Makefile b/Makefile
index 8f744e03c5a..6720d14336c 100644
--- a/Makefile
+++ b/Makefile
@@ -31,12 +31,15 @@ CROSS_PROFILE ?= release
# List of features to use when running EF tests.
EF_TEST_FEATURES ?=
+# List of features to use when running CI tests.
+TEST_FEATURES ?=
+
# Cargo profile for regular builds.
PROFILE ?= release
# List of all hard forks. This list is used to set env variables for several tests so that
# they run for different forks.
-FORKS=phase0 altair merge capella
+FORKS=phase0 altair merge capella deneb
# Extra flags for Cargo
CARGO_INSTALL_EXTRA_FLAGS?=
@@ -106,22 +109,26 @@ build-release-tarballs:
# Runs the full workspace tests in **release**, without downloading any additional
# test vectors.
test-release:
- cargo test --workspace --release --exclude ef_tests --exclude beacon_chain --exclude slasher
+ cargo test --workspace --release --features "$(TEST_FEATURES)" \
+ --exclude ef_tests --exclude beacon_chain --exclude slasher --exclude network
# Runs the full workspace tests in **release**, without downloading any additional
# test vectors, using nextest.
nextest-release:
- cargo nextest run --workspace --release --exclude ef_tests --exclude beacon_chain --exclude slasher
+ cargo nextest run --workspace --release --features "$(TEST_FEATURES)" \
+ --exclude ef_tests --exclude beacon_chain --exclude slasher --exclude network
# Runs the full workspace tests in **debug**, without downloading any additional test
# vectors.
test-debug:
- cargo test --workspace --exclude ef_tests --exclude beacon_chain
+ cargo test --workspace --features "$(TEST_FEATURES)" \
+ --exclude ef_tests --exclude beacon_chain --exclude network
# Runs the full workspace tests in **debug**, without downloading any additional test
# vectors, using nextest.
nextest-debug:
- cargo nextest run --workspace --exclude ef_tests --exclude beacon_chain
+ cargo nextest run --workspace --features "$(TEST_FEATURES)" \
+ --exclude ef_tests --exclude beacon_chain --exclude network
# Runs cargo-fmt (linter).
cargo-fmt:
@@ -129,7 +136,7 @@ cargo-fmt:
# Typechecks benchmark code
check-benches:
- cargo check --workspace --benches
+ cargo check --workspace --benches --features "$(TEST_FEATURES)"
# Runs only the ef-test vectors.
run-ef-tests:
@@ -151,21 +158,29 @@ nextest-run-ef-tests:
test-beacon-chain: $(patsubst %,test-beacon-chain-%,$(FORKS))
test-beacon-chain-%:
- env FORK_NAME=$* cargo nextest run --release --features fork_from_env,slasher/lmdb -p beacon_chain
+ env FORK_NAME=$* cargo nextest run --release --features "fork_from_env,slasher/lmdb,$(TEST_FEATURES)" -p beacon_chain
# Run the tests in the `operation_pool` crate for all known forks.
test-op-pool: $(patsubst %,test-op-pool-%,$(FORKS))
test-op-pool-%:
env FORK_NAME=$* cargo nextest run --release \
- --features 'beacon_chain/fork_from_env'\
+ --features "beacon_chain/fork_from_env,$(TEST_FEATURES)"\
-p operation_pool
+# Run the tests in the `network` crate for all known forks.
+test-network: $(patsubst %,test-network-%,$(FORKS))
+
+test-network-%:
+ env FORK_NAME=$* cargo nextest run --release \
+ --features "fork_from_env,$(TEST_FEATURES)" \
+ -p network
+
# Run the tests in the `slasher` crate for all supported database backends.
test-slasher:
- cargo nextest run --release -p slasher --features lmdb
- cargo nextest run --release -p slasher --no-default-features --features mdbx
- cargo nextest run --release -p slasher --features lmdb,mdbx # both backends enabled
+ cargo nextest run --release -p slasher --features "lmdb,$(TEST_FEATURES)"
+ cargo nextest run --release -p slasher --no-default-features --features "mdbx,$(TEST_FEATURES)"
+ cargo nextest run --release -p slasher --features "lmdb,mdbx,$(TEST_FEATURES)" # both backends enabled
# Runs only the tests/state_transition_vectors tests.
run-state-transition-tests:
@@ -191,7 +206,7 @@ test-full: cargo-fmt test-release test-debug test-ef test-exec-engine
# Lints the code for bad style and potentially unsafe arithmetic using Clippy.
# Clippy lints are opt-in per-crate for now. By default, everything is allowed except for performance and correctness lints.
lint:
- cargo clippy --workspace --tests $(EXTRA_CLIPPY_OPTS) -- \
+ cargo clippy --workspace --tests $(EXTRA_CLIPPY_OPTS) --features "$(TEST_FEATURES)" -- \
-D clippy::fn_to_numeric_cast_any \
-D warnings \
-A clippy::derive_partial_eq_without_eq \
@@ -222,8 +237,8 @@ make-ef-tests:
# Verifies that crates compile with fuzzing features enabled
arbitrary-fuzz:
- cargo check -p state_processing --features arbitrary-fuzz
- cargo check -p slashing_protection --features arbitrary-fuzz
+ cargo check -p state_processing --features arbitrary-fuzz,$(TEST_FEATURES)
+ cargo check -p slashing_protection --features arbitrary-fuzz,$(TEST_FEATURES)
# Runs cargo audit (Audit Cargo.lock files for crates with security vulnerabilities reported to the RustSec Advisory Database)
audit: install-audit audit-CI
@@ -240,7 +255,7 @@ vendor:
# Runs `cargo udeps` to check for unused dependencies
udeps:
- cargo +$(PINNED_NIGHTLY) udeps --tests --all-targets --release
+ cargo +$(PINNED_NIGHTLY) udeps --tests --all-targets --release --features "$(TEST_FEATURES)"
# Performs a `cargo` clean and cleans the `ef_tests` directory.
clean:
diff --git a/account_manager/src/validator/exit.rs b/account_manager/src/validator/exit.rs
index 602390556c5..bc9e0ee1dd6 100644
--- a/account_manager/src/validator/exit.rs
+++ b/account_manager/src/validator/exit.rs
@@ -14,7 +14,7 @@ use slot_clock::{SlotClock, SystemTimeSlotClock};
use std::path::{Path, PathBuf};
use std::time::Duration;
use tokio::time::sleep;
-use types::{ChainSpec, Epoch, EthSpec, Fork, VoluntaryExit};
+use types::{ChainSpec, Epoch, EthSpec, VoluntaryExit};
pub const CMD: &str = "exit";
pub const KEYSTORE_FLAG: &str = "keystore";
@@ -146,7 +146,6 @@ async fn publish_voluntary_exit(
.ok_or("Failed to get current epoch. Please check your system time")?;
let validator_index = get_validator_index_for_exit(client, &keypair.pk, epoch, spec).await?;
- let fork = get_beacon_state_fork(client).await?;
let voluntary_exit = VoluntaryExit {
epoch,
validator_index,
@@ -173,12 +172,8 @@ async fn publish_voluntary_exit(
if confirmation == CONFIRMATION_PHRASE {
// Sign and publish the voluntary exit to network
- let signed_voluntary_exit = voluntary_exit.sign(
- &keypair.sk,
- &fork,
- genesis_data.genesis_validators_root,
- spec,
- );
+ let signed_voluntary_exit =
+ voluntary_exit.sign(&keypair.sk, genesis_data.genesis_validators_root, spec);
client
.post_beacon_pool_voluntary_exits(&signed_voluntary_exit)
.await
@@ -316,16 +311,6 @@ async fn is_syncing(client: &BeaconNodeHttpClient) -> Result {
.is_syncing)
}
-/// Get fork object for the current state by querying the beacon node client.
-async fn get_beacon_state_fork(client: &BeaconNodeHttpClient) -> Result {
- Ok(client
- .get_beacon_states_fork(StateId::Head)
- .await
- .map_err(|e| format!("Failed to get get fork: {:?}", e))?
- .ok_or("Failed to get fork, state not found")?
- .data)
-}
-
/// Calculates the current epoch from the genesis time and current time.
fn get_current_epoch(genesis_time: u64, spec: &ChainSpec) -> Option {
let slot_clock = SystemTimeSlotClock::new(
diff --git a/beacon_node/Cargo.toml b/beacon_node/Cargo.toml
index 073a0d17003..276faaecdd4 100644
--- a/beacon_node/Cargo.toml
+++ b/beacon_node/Cargo.toml
@@ -37,6 +37,7 @@ eth2_network_config = { workspace = true }
execution_layer = { workspace = true }
lighthouse_network = { workspace = true }
serde = { workspace = true }
+serde_json = { workspace = true }
clap_utils = { workspace = true }
hyper = { workspace = true }
lighthouse_version = { workspace = true }
diff --git a/beacon_node/beacon_chain/Cargo.toml b/beacon_node/beacon_chain/Cargo.toml
index 7dce849039b..ee7000cea31 100644
--- a/beacon_node/beacon_chain/Cargo.toml
+++ b/beacon_node/beacon_chain/Cargo.toml
@@ -10,6 +10,7 @@ default = ["participation_metrics"]
write_ssz_files = [] # Writes debugging .ssz files to /tmp during block processing.
participation_metrics = [] # Exposes validator participation metrics to Prometheus.
fork_from_env = [] # Initialise the harness chain spec from the FORK_NAME env variable
+portable = ["bls/supranational-portable"]
[dev-dependencies]
maplit = { workspace = true }
@@ -17,6 +18,8 @@ environment = { workspace = true }
serde_json = { workspace = true }
[dependencies]
+serde_json = { workspace = true }
+eth2_network_config = { workspace = true }
merkle_proof = { workspace = true }
store = { workspace = true }
parking_lot = { workspace = true }
@@ -50,6 +53,7 @@ lru = { workspace = true }
tempfile = { workspace = true }
bitvec = { workspace = true }
bls = { workspace = true }
+kzg = { workspace = true }
safe_arith = { workspace = true }
fork_choice = { workspace = true }
task_executor = { workspace = true }
@@ -65,6 +69,8 @@ superstruct = { workspace = true }
hex = { workspace = true }
exit-future = { workspace = true }
oneshot_broadcast = { path = "../../common/oneshot_broadcast/" }
+slog-term = { workspace = true }
+slog-async = { workspace = true }
[[test]]
name = "beacon_chain_tests"
diff --git a/beacon_node/beacon_chain/src/attestation_rewards.rs b/beacon_node/beacon_chain/src/attestation_rewards.rs
index 94bd28f98fd..992c7a479e0 100644
--- a/beacon_node/beacon_chain/src/attestation_rewards.rs
+++ b/beacon_node/beacon_chain/src/attestation_rewards.rs
@@ -5,6 +5,7 @@ use participation_cache::ParticipationCache;
use safe_arith::SafeArith;
use serde_utils::quoted_u64::Quoted;
use slog::debug;
+use state_processing::per_epoch_processing::altair::process_inactivity_updates;
use state_processing::{
common::altair::BaseRewardPerIncrement,
per_epoch_processing::altair::{participation_cache, rewards_and_penalties::get_flag_weight},
@@ -50,9 +51,10 @@ impl BeaconChain {
match state {
BeaconState::Base(_) => self.compute_attestation_rewards_base(state, validators),
- BeaconState::Altair(_) | BeaconState::Merge(_) | BeaconState::Capella(_) => {
- self.compute_attestation_rewards_altair(state, validators)
- }
+ BeaconState::Altair(_)
+ | BeaconState::Merge(_)
+ | BeaconState::Capella(_)
+ | BeaconState::Deneb(_) => self.compute_attestation_rewards_altair(state, validators),
}
}
@@ -123,6 +125,7 @@ impl BeaconChain {
// Calculate ideal_rewards
let participation_cache = ParticipationCache::new(&state, spec)?;
+ process_inactivity_updates(&mut state, &participation_cache, spec)?;
let previous_epoch = state.previous_epoch();
@@ -189,6 +192,7 @@ impl BeaconChain {
let mut head_reward = 0i64;
let mut target_reward = 0i64;
let mut source_reward = 0i64;
+ let mut inactivity_penalty = 0i64;
if eligible {
let effective_balance = state.get_effective_balance(*validator_index)?;
@@ -214,6 +218,14 @@ impl BeaconChain {
head_reward = 0;
} else if flag_index == TIMELY_TARGET_FLAG_INDEX {
target_reward = *penalty;
+
+ let penalty_numerator = effective_balance
+ .safe_mul(state.get_inactivity_score(*validator_index)?)?;
+ let penalty_denominator = spec
+ .inactivity_score_bias
+ .safe_mul(spec.inactivity_penalty_quotient_for_state(&state))?;
+ inactivity_penalty =
+ -(penalty_numerator.safe_div(penalty_denominator)? as i64);
} else if flag_index == TIMELY_SOURCE_FLAG_INDEX {
source_reward = *penalty;
}
@@ -225,8 +237,7 @@ impl BeaconChain {
target: target_reward,
source: source_reward,
inclusion_delay: None,
- // TODO: altair calculation logic needs to be updated to include inactivity penalty
- inactivity: 0,
+ inactivity: inactivity_penalty,
});
}
@@ -249,7 +260,6 @@ impl BeaconChain {
target: 0,
source: 0,
inclusion_delay: None,
- // TODO: altair calculation logic needs to be updated to include inactivity penalty
inactivity: 0,
});
match *flag_index {
diff --git a/beacon_node/beacon_chain/src/attestation_verification.rs b/beacon_node/beacon_chain/src/attestation_verification.rs
index 5535fec37c4..d7a8bca4d0f 100644
--- a/beacon_node/beacon_chain/src/attestation_verification.rs
+++ b/beacon_node/beacon_chain/src/attestation_verification.rs
@@ -55,7 +55,7 @@ use std::borrow::Cow;
use strum::AsRefStr;
use tree_hash::TreeHash;
use types::{
- Attestation, BeaconCommittee, ChainSpec, CommitteeIndex, Epoch, EthSpec, Hash256,
+ Attestation, BeaconCommittee, ChainSpec, CommitteeIndex, Epoch, EthSpec, ForkName, Hash256,
IndexedAttestation, SelectionProof, SignedAggregateAndProof, Slot, SubnetId,
};
@@ -1049,10 +1049,21 @@ pub fn verify_propagation_slot_range(
}
// Taking advantage of saturating subtraction on `Slot`.
- let earliest_permissible_slot = slot_clock
+ let one_epoch_prior = slot_clock
.now_with_past_tolerance(spec.maximum_gossip_clock_disparity())
.ok_or(BeaconChainError::UnableToReadSlot)?
- E::slots_per_epoch();
+
+ let current_fork =
+ spec.fork_name_at_slot::(slot_clock.now().ok_or(BeaconChainError::UnableToReadSlot)?);
+ let earliest_permissible_slot = match current_fork {
+ ForkName::Base | ForkName::Altair | ForkName::Merge | ForkName::Capella => one_epoch_prior,
+ // EIP-7045
+ ForkName::Deneb => one_epoch_prior
+ .epoch(E::slots_per_epoch())
+ .start_slot(E::slots_per_epoch()),
+ };
+
if attestation_slot < earliest_permissible_slot {
return Err(Error::PastSlot {
attestation_slot,
diff --git a/beacon_node/beacon_chain/src/beacon_block_reward.rs b/beacon_node/beacon_chain/src/beacon_block_reward.rs
index 80a90fd3e51..79f6b97fdad 100644
--- a/beacon_node/beacon_chain/src/beacon_block_reward.rs
+++ b/beacon_node/beacon_chain/src/beacon_block_reward.rs
@@ -64,19 +64,19 @@ impl BeaconChain {
self.compute_beacon_block_attestation_reward_base(block, block_root, state)
.map_err(|e| {
error!(
- self.log,
- "Error calculating base block attestation reward";
- "error" => ?e
+ self.log,
+ "Error calculating base block attestation reward";
+ "error" => ?e
);
BeaconChainError::BlockRewardAttestationError
})?
} else {
- self.compute_beacon_block_attestation_reward_altair(block, state)
+ self.compute_beacon_block_attestation_reward_altair_deneb(block, state)
.map_err(|e| {
error!(
- self.log,
- "Error calculating altair block attestation reward";
- "error" => ?e
+ self.log,
+ "Error calculating altair block attestation reward";
+ "error" => ?e
);
BeaconChainError::BlockRewardAttestationError
})?
@@ -173,7 +173,9 @@ impl BeaconChain {
Ok(block_attestation_reward)
}
- fn compute_beacon_block_attestation_reward_altair>(
+ fn compute_beacon_block_attestation_reward_altair_deneb<
+ Payload: AbstractExecPayload,
+ >(
&self,
block: BeaconBlockRef<'_, T::EthSpec, Payload>,
state: &BeaconState,
@@ -192,6 +194,7 @@ impl BeaconChain {
for attestation in block.body().attestations() {
let data = &attestation.data;
let inclusion_delay = state.slot().safe_sub(data.slot)?.as_u64();
+ // [Modified in Deneb:EIP7045]
let participation_flag_indices = get_attestation_participation_flag_indices(
state,
data,
diff --git a/beacon_node/beacon_chain/src/beacon_block_streamer.rs b/beacon_node/beacon_chain/src/beacon_block_streamer.rs
index e43f2a8dd81..9312d4511d5 100644
--- a/beacon_node/beacon_chain/src/beacon_block_streamer.rs
+++ b/beacon_node/beacon_chain/src/beacon_block_streamer.rs
@@ -3,7 +3,7 @@ use execution_layer::{ExecutionLayer, ExecutionPayloadBodyV1};
use slog::{crit, debug, Logger};
use std::collections::HashMap;
use std::sync::Arc;
-use store::DatabaseBlock;
+use store::{DatabaseBlock, ExecutionPayloadDeneb};
use task_executor::TaskExecutor;
use tokio::sync::{
mpsc::{self, UnboundedSender},
@@ -97,6 +97,7 @@ fn reconstruct_default_header_block(
let payload: ExecutionPayload = match fork {
ForkName::Merge => ExecutionPayloadMerge::default().into(),
ForkName::Capella => ExecutionPayloadCapella::default().into(),
+ ForkName::Deneb => ExecutionPayloadDeneb::default().into(),
ForkName::Base | ForkName::Altair => {
return Err(Error::PayloadReconstruction(format!(
"Block with fork variant {} has execution payload",
@@ -714,19 +715,21 @@ mod tests {
}
#[tokio::test]
- async fn check_all_blocks_from_altair_to_capella() {
+ async fn check_all_blocks_from_altair_to_deneb() {
let slots_per_epoch = MinimalEthSpec::slots_per_epoch() as usize;
let num_epochs = 8;
let bellatrix_fork_epoch = 2usize;
let capella_fork_epoch = 4usize;
+ let deneb_fork_epoch = 6usize;
let num_blocks_produced = num_epochs * slots_per_epoch;
let mut spec = test_spec::();
spec.altair_fork_epoch = Some(Epoch::new(0));
spec.bellatrix_fork_epoch = Some(Epoch::new(bellatrix_fork_epoch as u64));
spec.capella_fork_epoch = Some(Epoch::new(capella_fork_epoch as u64));
+ spec.deneb_fork_epoch = Some(Epoch::new(deneb_fork_epoch as u64));
- let harness = get_harness(VALIDATOR_COUNT, spec);
+ let harness = get_harness(VALIDATOR_COUNT, spec.clone());
// go to bellatrix fork
harness
.extend_slots(bellatrix_fork_epoch * slots_per_epoch)
@@ -833,17 +836,19 @@ mod tests {
}
#[tokio::test]
- async fn check_fallback_altair_to_capella() {
+ async fn check_fallback_altair_to_deneb() {
let slots_per_epoch = MinimalEthSpec::slots_per_epoch() as usize;
let num_epochs = 8;
let bellatrix_fork_epoch = 2usize;
let capella_fork_epoch = 4usize;
+ let deneb_fork_epoch = 6usize;
let num_blocks_produced = num_epochs * slots_per_epoch;
let mut spec = test_spec::();
spec.altair_fork_epoch = Some(Epoch::new(0));
spec.bellatrix_fork_epoch = Some(Epoch::new(bellatrix_fork_epoch as u64));
spec.capella_fork_epoch = Some(Epoch::new(capella_fork_epoch as u64));
+ spec.deneb_fork_epoch = Some(Epoch::new(deneb_fork_epoch as u64));
let harness = get_harness(VALIDATOR_COUNT, spec);
diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs
index c7bfd195b09..6bc35cad7a5 100644
--- a/beacon_node/beacon_chain/src/beacon_chain.rs
+++ b/beacon_node/beacon_chain/src/beacon_chain.rs
@@ -7,14 +7,22 @@ use crate::attester_cache::{AttesterCache, AttesterCacheKey};
use crate::beacon_block_streamer::{BeaconBlockStreamer, CheckEarlyAttesterCache};
use crate::beacon_proposer_cache::compute_proposer_duties_from_head;
use crate::beacon_proposer_cache::BeaconProposerCache;
+use crate::blob_verification::{self, GossipBlobError, GossipVerifiedBlob};
use crate::block_times_cache::BlockTimesCache;
+use crate::block_verification::POS_PANDA_BANNER;
use crate::block_verification::{
- check_block_is_finalized_checkpoint_or_descendant, check_block_relevancy, get_block_root,
+ check_block_is_finalized_checkpoint_or_descendant, check_block_relevancy,
signature_verify_chain_segment, BlockError, ExecutionPendingBlock, GossipVerifiedBlock,
- IntoExecutionPendingBlock, PayloadVerificationOutcome, POS_PANDA_BANNER,
+ IntoExecutionPendingBlock,
+};
+use crate::block_verification_types::{
+ AsBlock, AvailableExecutedBlock, BlockImportData, ExecutedBlock, RpcBlock,
};
pub use crate::canonical_head::{CanonicalHead, CanonicalHeadRwLock};
use crate::chain_config::ChainConfig;
+use crate::data_availability_checker::{
+ Availability, AvailabilityCheckError, AvailableBlock, DataAvailabilityChecker,
+};
use crate::early_attester_cache::EarlyAttesterCache;
use crate::errors::{BeaconChainError as Error, BlockProductionError};
use crate::eth1_chain::{Eth1Chain, Eth1ChainBackend};
@@ -41,6 +49,7 @@ use crate::observed_aggregates::{
use crate::observed_attesters::{
ObservedAggregators, ObservedAttesters, ObservedSyncAggregators, ObservedSyncContributors,
};
+use crate::observed_blob_sidecars::ObservedBlobSidecars;
use crate::observed_block_producers::ObservedBlockProducers;
use crate::observed_operations::{ObservationOutcome, ObservedOperations};
use crate::persisted_beacon_chain::{PersistedBeaconChain, DUMMY_CANONICAL_HEAD_BLOCK_ROOT};
@@ -57,9 +66,12 @@ use crate::validator_monitor::{
HISTORIC_EPOCHS as VALIDATOR_MONITOR_HISTORIC_EPOCHS,
};
use crate::validator_pubkey_cache::ValidatorPubkeyCache;
-use crate::{metrics, BeaconChainError, BeaconForkChoiceStore, BeaconSnapshot, CachedHead};
+use crate::{
+ kzg_utils, metrics, AvailabilityPendingExecutedBlock, BeaconChainError, BeaconForkChoiceStore,
+ BeaconSnapshot, CachedHead,
+};
use eth2::lighthouse::StandardBlockReward;
-use eth2::types::{EventKind, SseBlock, SseExtendedPayloadAttributes, SyncDuty};
+use eth2::types::{EventKind, SseBlobSidecar, SseBlock, SseExtendedPayloadAttributes, SyncDuty};
use execution_layer::{
BlockProposalContents, BlockProposalContentsType, BuilderParams, ChainHealth, ExecutionLayer,
FailedCondition, PayloadAttributes, PayloadStatus,
@@ -71,6 +83,7 @@ use fork_choice::{
use futures::channel::mpsc::Sender;
use itertools::process_results;
use itertools::Itertools;
+use kzg::Kzg;
use operation_pool::{AttestationRef, OperationPool, PersistedOperationPool, ReceivedPreCapella};
use parking_lot::{Mutex, RwLock};
use proto_array::{DoNotReOrg, ProposerHeadError};
@@ -107,13 +120,15 @@ use task_executor::{ShutdownReason, TaskExecutor};
use tokio_stream::Stream;
use tree_hash::TreeHash;
use types::beacon_state::CloneConfig;
+use types::blob_sidecar::{BlobSidecarList, FixedBlobSidecarList};
use types::payload::BlockProductionVersion;
+use types::sidecar::BlobItems;
use types::*;
pub type ForkChoiceError = fork_choice::Error;
/// Alias to appease clippy.
-type HashBlockTuple = (Hash256, Arc>);
+type HashBlockTuple = (Hash256, RpcBlock);
/// The time-out before failure during an operation to take a read/write RwLock on the block
/// processing cache.
@@ -172,6 +187,34 @@ pub enum WhenSlotSkipped {
Prev,
}
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub enum AvailabilityProcessingStatus {
+ MissingComponents(Slot, Hash256),
+ Imported(Hash256),
+}
+
+impl TryInto for AvailabilityProcessingStatus {
+ type Error = ();
+
+ fn try_into(self) -> Result {
+ match self {
+ AvailabilityProcessingStatus::Imported(hash) => Ok(hash.into()),
+ _ => Err(()),
+ }
+ }
+}
+
+impl TryInto for AvailabilityProcessingStatus {
+ type Error = ();
+
+ fn try_into(self) -> Result {
+ match self {
+ AvailabilityProcessingStatus::Imported(hash) => Ok(hash),
+ _ => Err(()),
+ }
+ }
+}
+
/// The result of a chain segment processing.
pub enum ChainSegmentResult {
/// Processing this chain segment finished successfully.
@@ -194,9 +237,13 @@ pub enum ProduceBlockVerification {
pub struct PrePayloadAttributes {
pub proposer_index: u64,
pub prev_randao: Hash256,
+ /// The block number of the block being built upon (same block as fcU `headBlockHash`).
+ ///
/// The parent block number is not part of the payload attributes sent to the EL, but *is*
/// sent to builders via SSE.
pub parent_block_number: u64,
+ /// The block root of the block being built upon (same block as fcU `headBlockHash`).
+ pub parent_beacon_block_root: Hash256,
}
/// Information about a state/block at a specific slot.
@@ -360,6 +407,8 @@ pub struct BeaconChain {
pub(crate) observed_sync_aggregators: RwLock>,
/// Maintains a record of which validators have proposed blocks for each slot.
pub observed_block_producers: RwLock>,
+ /// Maintains a record of blob sidecars seen over the gossip network.
+ pub(crate) observed_blob_sidecars: RwLock>,
/// Maintains a record of which validators have submitted voluntary exits.
pub(crate) observed_voluntary_exits: Mutex>,
/// Maintains a record of which validators we've seen proposer slashings for.
@@ -429,6 +478,11 @@ pub struct BeaconChain {
pub validator_monitor: RwLock>,
/// The slot at which blocks are downloaded back to.
pub genesis_backfill_slot: Slot,
+ /// Provides a KZG verification and temporary storage for blocks and blobs as
+ /// they are collected and combined.
+ pub data_availability_checker: Arc>,
+ /// The KZG trusted setup used by this chain.
+ pub kzg: Option::Kzg>>>,
}
pub enum BeaconBlockResponseType {
@@ -439,6 +493,7 @@ pub enum BeaconBlockResponseType {
pub struct BeaconBlockResponse> {
pub block: BeaconBlock,
pub state: BeaconState,
+ pub maybe_side_car: Option>::Sidecar>>,
pub execution_payload_value: Option,
pub consensus_block_value: Option,
}
@@ -601,6 +656,13 @@ impl BeaconChain {
Ok(())
}
+ pub fn persist_data_availability_checker(&self) -> Result<(), Error> {
+ let _timer = metrics::start_timer(&metrics::PERSIST_DATA_AVAILABILITY_CHECKER);
+ self.data_availability_checker.persist_all()?;
+
+ Ok(())
+ }
+
/// Returns the slot _right now_ according to `self.slot_clock`. Returns `Err` if the slot is
/// unavailable.
///
@@ -681,10 +743,10 @@ impl BeaconChain {
start_slot,
end_slot,
|| {
- (
+ Ok((
head.beacon_state.clone_with_only_committee_caches(),
head.beacon_block_root,
- )
+ ))
},
&self.spec,
)?;
@@ -778,10 +840,10 @@ impl BeaconChain {
start_slot,
end_slot,
|| {
- (
+ Ok((
head.beacon_state.clone_with_only_committee_caches(),
head.beacon_state_root(),
- )
+ ))
},
&self.spec,
)?;
@@ -1051,6 +1113,15 @@ impl BeaconChain {
)
}
+ pub fn get_blobs_checking_early_attester_cache(
+ &self,
+ block_root: &Hash256,
+ ) -> Result, Error> {
+ self.early_attester_cache
+ .get_blobs(*block_root)
+ .map_or_else(|| self.get_blobs(block_root), Ok)
+ }
+
/// Returns the block at the given root, if any.
///
/// ## Errors
@@ -1115,6 +1186,17 @@ impl BeaconChain {
.map(Some)
}
+ /// Returns the blobs at the given root, if any.
+ ///
+ /// ## Errors
+ /// May return a database error.
+ pub fn get_blobs(&self, block_root: &Hash256) -> Result, Error> {
+ match self.store.get_blobs(block_root)? {
+ Some(blobs) => Ok(blobs),
+ None => Ok(BlobSidecarList::default()),
+ }
+ }
+
pub fn get_blinded_block(
&self,
block_root: &Hash256,
@@ -1934,6 +2016,21 @@ impl BeaconChain {
})
}
+ pub fn verify_blob_sidecar_for_gossip(
+ self: &Arc,
+ blob_sidecar: SignedBlobSidecar,
+ subnet_id: u64,
+ ) -> Result, GossipBlobError> {
+ metrics::inc_counter(&metrics::BLOBS_SIDECAR_PROCESSING_REQUESTS);
+ let _timer = metrics::start_timer(&metrics::BLOBS_SIDECAR_GOSSIP_VERIFICATION_TIMES);
+ blob_verification::validate_blob_sidecar_for_gossip(blob_sidecar, subnet_id, self).map(
+ |v| {
+ metrics::inc_counter(&metrics::BLOBS_SIDECAR_PROCESSING_SUCCESSES);
+ v
+ },
+ )
+ }
+
/// Accepts some 'LightClientOptimisticUpdate' from the network and attempts to verify it
pub fn verify_optimistic_update_for_gossip(
self: &Arc,
@@ -2439,7 +2536,7 @@ impl BeaconChain {
/// This method is potentially long-running and should not run on the core executor.
pub fn filter_chain_segment(
self: &Arc,
- chain_segment: Vec>>,
+ chain_segment: Vec>,
) -> Result>, ChainSegmentResult> {
// This function will never import any blocks.
let imported_blocks = 0;
@@ -2456,14 +2553,14 @@ impl BeaconChain {
for (i, block) in chain_segment.into_iter().enumerate() {
// Ensure the block is the correct structure for the fork at `block.slot()`.
- if let Err(e) = block.fork_name(&self.spec) {
+ if let Err(e) = block.as_block().fork_name(&self.spec) {
return Err(ChainSegmentResult::Failed {
imported_blocks,
error: BlockError::InconsistentFork(e),
});
}
- let block_root = get_block_root(&block);
+ let block_root = block.block_root();
if let Some((child_parent_root, child_slot)) = children.get(i) {
// If this block has a child in this chain segment, ensure that its parent root matches
@@ -2487,7 +2584,7 @@ impl BeaconChain {
}
}
- match check_block_relevancy(&block, block_root, self) {
+ match check_block_relevancy(block.as_block(), block_root, self) {
// If the block is relevant, add it to the filtered chain segment.
Ok(_) => filtered_chain_segment.push((block_root, block)),
// If the block is already known, simply ignore this block.
@@ -2545,7 +2642,7 @@ impl BeaconChain {
/// `Self::process_block`.
pub async fn process_chain_segment(
self: &Arc,
- chain_segment: Vec>>,
+ chain_segment: Vec>,
notify_execution_layer: NotifyExecutionLayer,
) -> ChainSegmentResult {
let mut imported_blocks = 0;
@@ -2569,7 +2666,7 @@ impl BeaconChain {
while let Some((_root, block)) = filtered_chain_segment.first() {
// Determine the epoch of the first block in the remaining segment.
- let start_epoch = block.slot().epoch(T::EthSpec::slots_per_epoch());
+ let start_epoch = block.epoch();
// The `last_index` indicates the position of the first block in an epoch greater
// than the current epoch: partitioning the blocks into a run of blocks in the same
@@ -2577,9 +2674,7 @@ impl BeaconChain {
// the same `BeaconState`.
let last_index = filtered_chain_segment
.iter()
- .position(|(_root, block)| {
- block.slot().epoch(T::EthSpec::slots_per_epoch()) > start_epoch
- })
+ .position(|(_root, block)| block.epoch() > start_epoch)
.unwrap_or(filtered_chain_segment.len());
let mut blocks = filtered_chain_segment.split_off(last_index);
@@ -2619,7 +2714,24 @@ impl BeaconChain {
)
.await
{
- Ok(_) => imported_blocks += 1,
+ Ok(status) => {
+ match status {
+ AvailabilityProcessingStatus::Imported(_) => {
+ // The block was imported successfully.
+ imported_blocks += 1;
+ }
+ AvailabilityProcessingStatus::MissingComponents(slot, block_root) => {
+ warn!(self.log, "Blobs missing in response to range request";
+ "block_root" => ?block_root, "slot" => slot);
+ return ChainSegmentResult::Failed {
+ imported_blocks,
+ error: BlockError::AvailabilityCheck(
+ AvailabilityCheckError::MissingBlobs,
+ ),
+ };
+ }
+ }
+ }
Err(error) => {
return ChainSegmentResult::Failed {
imported_blocks,
@@ -2687,6 +2799,117 @@ impl BeaconChain {
.map_err(BeaconChainError::TokioJoin)?
}
+ /// Cache the blob in the processing cache, process it, then evict it from the cache if it was
+ /// imported or errors.
+ pub async fn process_gossip_blob(
+ self: &Arc,
+ blob: GossipVerifiedBlob,
+ ) -> Result> {
+ let block_root = blob.block_root();
+
+ // If this block has already been imported to forkchoice it must have been available, so
+ // we don't need to process its blobs again.
+ if self
+ .canonical_head
+ .fork_choice_read_lock()
+ .contains_block(&block_root)
+ {
+ return Err(BlockError::BlockIsAlreadyKnown);
+ }
+
+ if let Some(event_handler) = self.event_handler.as_ref() {
+ if event_handler.has_blob_sidecar_subscribers() {
+ event_handler.register(EventKind::BlobSidecar(SseBlobSidecar::from_blob_sidecar(
+ blob.as_blob(),
+ )));
+ }
+ }
+
+ self.data_availability_checker
+ .notify_gossip_blob(blob.as_blob().slot, block_root, &blob);
+ let r = self.check_gossip_blob_availability_and_import(blob).await;
+ self.remove_notified(&block_root, r)
+ }
+
+ /// Cache the blobs in the processing cache, process it, then evict it from the cache if it was
+ /// imported or errors.
+ pub async fn process_rpc_blobs(
+ self: &Arc,
+ slot: Slot,
+ block_root: Hash256,
+ blobs: FixedBlobSidecarList,
+ ) -> Result> {
+ // If this block has already been imported to forkchoice it must have been available, so
+ // we don't need to process its blobs again.
+ if self
+ .canonical_head
+ .fork_choice_read_lock()
+ .contains_block(&block_root)
+ {
+ return Err(BlockError::BlockIsAlreadyKnown);
+ }
+
+ if let Some(event_handler) = self.event_handler.as_ref() {
+ if event_handler.has_blob_sidecar_subscribers() {
+ for blob in blobs.iter().filter_map(|maybe_blob| maybe_blob.as_ref()) {
+ event_handler.register(EventKind::BlobSidecar(
+ SseBlobSidecar::from_blob_sidecar(blob),
+ ));
+ }
+ }
+ }
+
+ self.data_availability_checker
+ .notify_rpc_blobs(slot, block_root, &blobs);
+ let r = self
+ .check_rpc_blob_availability_and_import(slot, block_root, blobs)
+ .await;
+ self.remove_notified(&block_root, r)
+ }
+
+ /// Remove any block components from the *processing cache* if we no longer require them. If the
+ /// block was imported full or erred, we no longer require them.
+ fn remove_notified(
+ &self,
+ block_root: &Hash256,
+ r: Result>,
+ ) -> Result> {
+ let has_missing_components =
+ matches!(r, Ok(AvailabilityProcessingStatus::MissingComponents(_, _)));
+ if !has_missing_components {
+ self.data_availability_checker.remove_notified(block_root);
+ }
+ r
+ }
+
+ /// Wraps `process_block` in logic to cache the block's commitments in the processing cache
+ /// and evict if the block was imported or erred.
+ pub async fn process_block_with_early_caching>(
+ self: &Arc,
+ block_root: Hash256,
+ unverified_block: B,
+ notify_execution_layer: NotifyExecutionLayer,
+ ) -> Result> {
+ if let Ok(commitments) = unverified_block
+ .block()
+ .message()
+ .body()
+ .blob_kzg_commitments()
+ {
+ self.data_availability_checker.notify_block_commitments(
+ unverified_block.block().slot(),
+ block_root,
+ commitments.clone(),
+ );
+ };
+ let r = self
+ .process_block(block_root, unverified_block, notify_execution_layer, || {
+ Ok(())
+ })
+ .await;
+ self.remove_notified(&block_root, r)
+ }
+
/// Returns `Ok(block_root)` if the given `unverified_block` was successfully verified and
/// imported into the chain.
///
@@ -2694,6 +2917,7 @@ impl BeaconChain {
///
/// - `SignedBeaconBlock`
/// - `GossipVerifiedBlock`
+ /// - `RpcBlock`
///
/// ## Errors
///
@@ -2705,15 +2929,14 @@ impl BeaconChain {
unverified_block: B,
notify_execution_layer: NotifyExecutionLayer,
publish_fn: impl FnOnce() -> Result<(), BlockError> + Send + 'static,
- ) -> Result> {
+ ) -> Result> {
// Start the Prometheus timer.
let _full_timer = metrics::start_timer(&metrics::BLOCK_PROCESSING_TIMES);
// Increment the Prometheus counter for block processing requests.
metrics::inc_counter(&metrics::BLOCK_PROCESSING_REQUESTS);
- // Clone the block so we can provide it to the event handler.
- let block = unverified_block.block().clone();
+ let block_slot = unverified_block.block().slot();
// A small closure to group the verification and import errors.
let chain = self.clone();
@@ -2724,26 +2947,42 @@ impl BeaconChain {
notify_execution_layer,
)?;
publish_fn()?;
- chain
- .import_execution_pending_block(execution_pending)
- .await
+ let executed_block = chain.into_executed_block(execution_pending).await?;
+ match executed_block {
+ ExecutedBlock::Available(block) => {
+ self.import_available_block(Box::new(block)).await
+ }
+ ExecutedBlock::AvailabilityPending(block) => {
+ self.check_block_availability_and_import(block).await
+ }
+ }
};
// Verify and import the block.
match import_block.await {
// The block was successfully verified and imported. Yay.
- Ok(block_root) => {
+ Ok(status @ AvailabilityProcessingStatus::Imported(block_root)) => {
trace!(
self.log,
"Beacon block imported";
"block_root" => ?block_root,
- "block_slot" => %block.slot(),
+ "block_slot" => block_slot,
);
// Increment the Prometheus counter for block processing successes.
metrics::inc_counter(&metrics::BLOCK_PROCESSING_SUCCESSES);
- Ok(block_root)
+ Ok(status)
+ }
+ Ok(status @ AvailabilityProcessingStatus::MissingComponents(slot, block_root)) => {
+ trace!(
+ self.log,
+ "Beacon block awaiting blobs";
+ "block_root" => ?block_root,
+ "block_slot" => slot,
+ );
+
+ Ok(status)
}
Err(e @ BlockError::BeaconChainError(BeaconChainError::TokioJoin(_))) => {
debug!(
@@ -2775,36 +3014,27 @@ impl BeaconChain {
}
}
- /// Accepts a fully-verified block and imports it into the chain without performing any
- /// additional verification.
+ /// Accepts a fully-verified block and awaits on it's payload verification handle to
+ /// get a fully `ExecutedBlock`
///
- /// An error is returned if the block was unable to be imported. It may be partially imported
- /// (i.e., this function is not atomic).
- pub async fn import_execution_pending_block(
+ /// An error is returned if the verification handle couldn't be awaited.
+ pub async fn into_executed_block(
self: Arc,
execution_pending_block: ExecutionPendingBlock,
- ) -> Result> {
+ ) -> Result, BlockError> {
let ExecutionPendingBlock {
block,
- block_root,
- state,
- parent_block,
- confirmed_state_roots,
+ import_data,
payload_verification_handle,
- parent_eth1_finalization_data,
- consensus_context,
} = execution_pending_block;
- let PayloadVerificationOutcome {
- payload_verification_status,
- is_valid_merge_transition_block,
- } = payload_verification_handle
+ let payload_verification_outcome = payload_verification_handle
.await
.map_err(BeaconChainError::TokioJoin)?
.ok_or(BeaconChainError::RuntimeShutdown)??;
// Log the PoS pandas if a merge transition just occurred.
- if is_valid_merge_transition_block {
+ if payload_verification_outcome.is_valid_merge_transition_block {
info!(self.log, "{}", POS_PANDA_BANNER);
info!(
self.log,
@@ -2832,9 +3062,101 @@ impl BeaconChain {
.into_root()
);
}
+ Ok(ExecutedBlock::new(
+ block,
+ import_data,
+ payload_verification_outcome,
+ ))
+ }
+
+ /* Import methods */
+
+ /// Checks if the block is available, and imports immediately if so, otherwise caches the block
+ /// in the data availability checker.
+ async fn check_block_availability_and_import(
+ self: &Arc,
+ block: AvailabilityPendingExecutedBlock,
+ ) -> Result> {
+ let slot = block.block.slot();
+ let availability = self
+ .data_availability_checker
+ .put_pending_executed_block(block)?;
+ self.process_availability(slot, availability).await
+ }
+
+ /// Checks if the provided blob can make any cached blocks available, and imports immediately
+ /// if so, otherwise caches the blob in the data availability checker.
+ async fn check_gossip_blob_availability_and_import(
+ self: &Arc,
+ blob: GossipVerifiedBlob,
+ ) -> Result> {
+ let slot = blob.slot();
+ let availability = self.data_availability_checker.put_gossip_blob(blob)?;
+
+ self.process_availability(slot, availability).await
+ }
+
+ /// Checks if the provided blobs can make any cached blocks available, and imports immediately
+ /// if so, otherwise caches the blob in the data availability checker.
+ async fn check_rpc_blob_availability_and_import(
+ self: &Arc,
+ slot: Slot,
+ block_root: Hash256,
+ blobs: FixedBlobSidecarList,
+ ) -> Result> {
+ let availability = self
+ .data_availability_checker
+ .put_rpc_blobs(block_root, blobs)?;
+
+ self.process_availability(slot, availability).await
+ }
+
+ /// Imports a fully available block. Otherwise, returns `AvailabilityProcessingStatus::MissingComponents`
+ ///
+ /// An error is returned if the block was unable to be imported. It may be partially imported
+ /// (i.e., this function is not atomic).
+ async fn process_availability(
+ self: &Arc,
+ slot: Slot,
+ availability: Availability,
+ ) -> Result> {
+ match availability {
+ Availability::Available(block) => {
+ // This is the time since start of the slot where all the components of the block have become available
+ let delay =
+ get_slot_delay_ms(timestamp_now(), block.block.slot(), &self.slot_clock);
+ metrics::observe_duration(&metrics::BLOCK_AVAILABILITY_DELAY, delay);
+ // Block is fully available, import into fork choice
+ self.import_available_block(block).await
+ }
+ Availability::MissingComponents(block_root) => Ok(
+ AvailabilityProcessingStatus::MissingComponents(slot, block_root),
+ ),
+ }
+ }
+
+ pub async fn import_available_block(
+ self: &Arc,
+ block: Box>,
+ ) -> Result> {
+ let AvailableExecutedBlock {
+ block,
+ import_data,
+ payload_verification_outcome,
+ } = *block;
+
+ let BlockImportData {
+ block_root,
+ state,
+ parent_block,
+ parent_eth1_finalization_data,
+ confirmed_state_roots,
+ consensus_context,
+ } = import_data;
+ // import
let chain = self.clone();
- let block_hash = self
+ let block_root = self
.spawn_blocking_handle(
move || {
chain.import_block(
@@ -2842,7 +3164,7 @@ impl BeaconChain {
block_root,
state,
confirmed_state_roots,
- payload_verification_status,
+ payload_verification_outcome.payload_verification_status,
parent_block,
parent_eth1_finalization_data,
consensus_context,
@@ -2851,11 +3173,10 @@ impl BeaconChain {
"payload_verification_handle",
)
.await??;
-
- Ok(block_hash)
+ Ok(AvailabilityProcessingStatus::Imported(block_root))
}
- /// Accepts a fully-verified block and imports it into the chain without performing any
+ /// Accepts a fully-verified and available block and imports it into the chain without performing any
/// additional verification.
///
/// An error is returned if the block was unable to be imported. It may be partially imported
@@ -2863,7 +3184,7 @@ impl BeaconChain {
#[allow(clippy::too_many_arguments)]
fn import_block(
&self,
- signed_block: Arc>,
+ signed_block: AvailableBlock,
block_root: Hash256,
mut state: BeaconState,
confirmed_state_roots: Vec,
@@ -2916,7 +3237,9 @@ impl BeaconChain {
let mut fork_choice = self.canonical_head.fork_choice_write_lock();
// Do not import a block that doesn't descend from the finalized root.
- check_block_is_finalized_checkpoint_or_descendant(self, &fork_choice, &signed_block)?;
+ let signed_block =
+ check_block_is_finalized_checkpoint_or_descendant(self, &fork_choice, signed_block)?;
+ let block = signed_block.message();
// Register the new block with the fork choice service.
{
@@ -3027,6 +3350,8 @@ impl BeaconChain {
// If the write fails, revert fork choice to the version from disk, else we can
// end up with blocks in fork choice that are missing from disk.
// See /~https://github.com/sigp/lighthouse/issues/2028
+ let (_, signed_block, blobs) = signed_block.deconstruct();
+ let block = signed_block.message();
ops.extend(
confirmed_state_roots
.into_iter()
@@ -3034,9 +3359,21 @@ impl BeaconChain {
);
ops.push(StoreOp::PutBlock(block_root, signed_block.clone()));
ops.push(StoreOp::PutState(block.state_root(), &state));
+
+ if let Some(blobs) = blobs {
+ if !blobs.is_empty() {
+ debug!(
+ self.log, "Writing blobs to store";
+ "block_root" => %block_root,
+ "count" => blobs.len(),
+ );
+ ops.push(StoreOp::PutBlobs(block_root, blobs));
+ }
+ }
+
let txn_lock = self.store.hot_db.begin_rw_transaction();
- if let Err(e) = self.store.do_atomically(ops) {
+ if let Err(e) = self.store.do_atomically_with_block_and_blobs_cache(ops) {
error!(
self.log,
"Database write failed!";
@@ -3237,7 +3574,7 @@ impl BeaconChain {
// Sync aggregate.
if let Ok(sync_aggregate) = block.body().sync_aggregate() {
// `SyncCommittee` for the sync_aggregate should correspond to the duty slot
- let duty_epoch = block.slot().epoch(T::EthSpec::slots_per_epoch());
+ let duty_epoch = block.epoch();
match self.sync_committee_at_epoch(duty_epoch) {
Ok(sync_committee) => {
@@ -3518,7 +3855,7 @@ impl BeaconChain {
parent_block_slot: Slot,
) {
// Do not write to eth1 finalization cache for blocks older than 5 epochs.
- if block.slot().epoch(T::EthSpec::slots_per_epoch()) + 5 < current_epoch {
+ if block.epoch() + 5 < current_epoch {
return;
}
@@ -3628,6 +3965,8 @@ impl BeaconChain {
verification: ProduceBlockVerification,
block_production_version: BlockProductionVersion,
) -> Result, BlockProductionError> {
+ metrics::inc_counter(&metrics::BLOCK_PRODUCTION_REQUESTS);
+ let _complete_timer = metrics::start_timer(&metrics::BLOCK_PRODUCTION_TIMES);
// Part 1/2 (blocking)
//
// Load the parent state from disk.
@@ -3663,9 +4002,6 @@ impl BeaconChain {
self: &Arc,
slot: Slot,
) -> Result<(BeaconState, Option), BlockProductionError> {
- metrics::inc_counter(&metrics::BLOCK_PRODUCTION_REQUESTS);
- let _complete_timer = metrics::start_timer(&metrics::BLOCK_PRODUCTION_TIMES);
-
let fork_choice_timer = metrics::start_timer(&metrics::BLOCK_PRODUCTION_FORK_CHOICE_TIMES);
self.wait_for_fork_choice_before_block_production(slot)?;
drop(fork_choice_timer);
@@ -3868,10 +4204,10 @@ impl BeaconChain {
let proposal_epoch = proposal_slot.epoch(T::EthSpec::slots_per_epoch());
let head_block_root = cached_head.head_block_root();
- let parent_block_root = cached_head.parent_block_root();
+ let head_parent_block_root = cached_head.parent_block_root();
// The proposer head must be equal to the canonical head or its parent.
- if proposer_head != head_block_root && proposer_head != parent_block_root {
+ if proposer_head != head_block_root && proposer_head != head_parent_block_root {
warn!(
self.log,
"Unable to compute payload attributes";
@@ -3950,7 +4286,7 @@ impl BeaconChain {
// Get the `prev_randao` and parent block number.
let head_block_number = cached_head.head_block_number()?;
- let (prev_randao, parent_block_number) = if proposer_head == parent_block_root {
+ let (prev_randao, parent_block_number) = if proposer_head == head_parent_block_root {
(
cached_head.parent_random()?,
head_block_number.saturating_sub(1),
@@ -3963,6 +4299,7 @@ impl BeaconChain {
proposer_index,
prev_randao,
parent_block_number,
+ parent_beacon_block_root: proposer_head,
}))
}
@@ -4395,13 +4732,13 @@ impl BeaconChain {
// If required, start the process of loading an execution payload from the EL early. This
// allows it to run concurrently with things like attestation packing.
-
let prepare_payload_handle = match &state {
BeaconState::Base(_) | BeaconState::Altair(_) => None,
- BeaconState::Merge(_) | BeaconState::Capella(_) => {
+ BeaconState::Merge(_) | BeaconState::Capella(_) | BeaconState::Deneb(_) => {
let prepare_payload_handle = get_execution_payload(
self.clone(),
&state,
+ parent_root,
proposer_index,
builder_params,
block_production_version,
@@ -4610,7 +4947,7 @@ impl BeaconChain {
bls_to_execution_changes,
} = partial_beacon_block;
- let (inner_block, execution_payload_value) = match &state {
+ let (inner_block, blobs_opt, proofs_opt, execution_payload_value) = match &state {
BeaconState::Base(_) => (
BeaconBlock::Base(BeaconBlockBase {
slot,
@@ -4629,6 +4966,8 @@ impl BeaconChain {
_phantom: PhantomData,
},
}),
+ None,
+ None,
Uint256::zero(),
),
BeaconState::Altair(_) => (
@@ -4651,13 +4990,14 @@ impl BeaconChain {
_phantom: PhantomData,
},
}),
+ None,
+ None,
Uint256::zero(),
),
BeaconState::Merge(_) => {
let block_proposal_contents =
block_contents.ok_or(BlockProductionError::MissingExecutionPayload)?;
let execution_payload_value = block_proposal_contents.block_value().to_owned();
-
(
BeaconBlock::Merge(BeaconBlockMerge {
slot,
@@ -4681,6 +5021,8 @@ impl BeaconChain {
.map_err(|_| BlockProductionError::InvalidPayloadFork)?,
},
}),
+ None,
+ None,
execution_payload_value,
)
}
@@ -4713,6 +5055,44 @@ impl BeaconChain {
bls_to_execution_changes: bls_to_execution_changes.into(),
},
}),
+ None,
+ None,
+ execution_payload_value,
+ )
+ }
+ BeaconState::Deneb(_) => {
+ let (payload, kzg_commitments, blobs, proofs, execution_payload_value) =
+ block_contents
+ .ok_or(BlockProductionError::MissingExecutionPayload)?
+ .deconstruct();
+
+ (
+ BeaconBlock::Deneb(BeaconBlockDeneb {
+ slot,
+ proposer_index,
+ parent_root,
+ state_root: Hash256::zero(),
+ body: BeaconBlockBodyDeneb {
+ randao_reveal,
+ eth1_data,
+ graffiti,
+ proposer_slashings: proposer_slashings.into(),
+ attester_slashings: attester_slashings.into(),
+ attestations: attestations.into(),
+ deposits: deposits.into(),
+ voluntary_exits: voluntary_exits.into(),
+ sync_aggregate: sync_aggregate
+ .ok_or(BlockProductionError::MissingSyncAggregate)?,
+ execution_payload: payload
+ .try_into()
+ .map_err(|_| BlockProductionError::InvalidPayloadFork)?,
+ bls_to_execution_changes: bls_to_execution_changes.into(),
+ blob_kzg_commitments: kzg_commitments
+ .ok_or(BlockProductionError::InvalidPayloadFork)?,
+ },
+ }),
+ blobs,
+ proofs,
execution_payload_value,
)
}
@@ -4742,6 +5122,7 @@ impl BeaconChain {
ProduceBlockVerification::VerifyRandao => BlockSignatureStrategy::VerifyRandao,
ProduceBlockVerification::NoVerification => BlockSignatureStrategy::NoVerification,
};
+
// Use a context without block root or proposer index so that both are checked.
let mut ctxt = ConsensusContext::new(block.slot());
@@ -4775,6 +5156,57 @@ impl BeaconChain {
let (mut block, _) = block.deconstruct();
*block.state_root_mut() = state_root;
+ let blobs_verification_timer =
+ metrics::start_timer(&metrics::BLOCK_PRODUCTION_BLOBS_VERIFICATION_TIMES);
+ let maybe_sidecar_list = match (blobs_opt, proofs_opt) {
+ (Some(blobs_or_blobs_roots), Some(proofs)) => {
+ let expected_kzg_commitments =
+ block.body().blob_kzg_commitments().map_err(|_| {
+ BlockProductionError::InvalidBlockVariant(
+ "deneb block does not contain kzg commitments".to_string(),
+ )
+ })?;
+
+ if expected_kzg_commitments.len() != blobs_or_blobs_roots.len() {
+ return Err(BlockProductionError::MissingKzgCommitment(format!(
+ "Missing KZG commitment for slot {}. Expected {}, got: {}",
+ block.slot(),
+ blobs_or_blobs_roots.len(),
+ expected_kzg_commitments.len()
+ )));
+ }
+
+ let kzg_proofs = Vec::from(proofs);
+
+ if let Some(blobs) = blobs_or_blobs_roots.blobs() {
+ let kzg = self
+ .kzg
+ .as_ref()
+ .ok_or(BlockProductionError::TrustedSetupNotInitialized)?;
+ kzg_utils::validate_blobs::(
+ kzg,
+ expected_kzg_commitments,
+ blobs.iter().collect(),
+ &kzg_proofs,
+ )
+ .map_err(BlockProductionError::KzgError)?;
+ }
+
+ Some(
+ Sidecar::build_sidecar(
+ blobs_or_blobs_roots,
+ &block,
+ expected_kzg_commitments,
+ kzg_proofs,
+ )
+ .map_err(BlockProductionError::FailedToBuildBlobSidecars)?,
+ )
+ }
+ _ => None,
+ };
+
+ drop(blobs_verification_timer);
+
metrics::inc_counter(&metrics::BLOCK_PRODUCTION_SUCCESSES);
trace!(
@@ -4788,6 +5220,7 @@ impl BeaconChain {
Ok(BeaconBlockResponse {
block,
state,
+ maybe_side_car: maybe_sidecar_list,
execution_payload_value: Some(execution_payload_value),
consensus_block_value: Some(consensus_block_value),
})
@@ -4990,7 +5423,7 @@ impl BeaconChain {
return Ok(());
}
- // Fetch payoad attributes from the execution layer's cache, or compute them from scratch
+ // Fetch payload attributes from the execution layer's cache, or compute them from scratch
// if no matching entry is found. This saves recomputing the withdrawals which can take
// considerable time to compute if a state load is required.
let head_root = forkchoice_update_params.head_root;
@@ -5000,9 +5433,10 @@ impl BeaconChain {
{
payload_attributes
} else {
- let withdrawals = match self.spec.fork_name_at_slot::(prepare_slot) {
+ let prepare_slot_fork = self.spec.fork_name_at_slot::(prepare_slot);
+ let withdrawals = match prepare_slot_fork {
ForkName::Base | ForkName::Altair | ForkName::Merge => None,
- ForkName::Capella => {
+ ForkName::Capella | ForkName::Deneb => {
let chain = self.clone();
self.spawn_blocking_handle(
move || {
@@ -5015,6 +5449,11 @@ impl BeaconChain {
}
};
+ let parent_beacon_block_root = match prepare_slot_fork {
+ ForkName::Base | ForkName::Altair | ForkName::Merge | ForkName::Capella => None,
+ ForkName::Deneb => Some(pre_payload_attributes.parent_beacon_block_root),
+ };
+
let payload_attributes = PayloadAttributes::new(
self.slot_clock
.start_of(prepare_slot)
@@ -5023,6 +5462,7 @@ impl BeaconChain {
pre_payload_attributes.prev_randao,
execution_layer.get_suggested_fee_recipient(proposer).await,
withdrawals.map(Into::into),
+ parent_beacon_block_root,
);
execution_layer
@@ -6018,6 +6458,12 @@ impl BeaconChain {
gossip_attested || block_attested || aggregated || produced_block
}
+
+ /// The epoch at which we require a data availability check in block processing.
+ /// `None` if the `Deneb` fork is disabled.
+ pub fn data_availability_boundary(&self) -> Option {
+ self.data_availability_checker.data_availability_boundary()
+ }
}
impl Drop for BeaconChain {
@@ -6025,6 +6471,7 @@ impl Drop for BeaconChain {
let drop = || -> Result<(), Error> {
self.persist_head_and_fork_choice()?;
self.persist_op_pool()?;
+ self.persist_data_availability_checker()?;
self.persist_eth1_cache()
};
diff --git a/beacon_node/beacon_chain/src/blob_verification.rs b/beacon_node/beacon_chain/src/blob_verification.rs
new file mode 100644
index 00000000000..b535f3104c6
--- /dev/null
+++ b/beacon_node/beacon_chain/src/blob_verification.rs
@@ -0,0 +1,548 @@
+use derivative::Derivative;
+use slot_clock::SlotClock;
+use std::sync::Arc;
+
+use crate::beacon_chain::{
+ BeaconChain, BeaconChainTypes, BLOCK_PROCESSING_CACHE_LOCK_TIMEOUT,
+ VALIDATOR_PUBKEY_CACHE_LOCK_TIMEOUT,
+};
+use crate::block_verification::cheap_state_advance_to_obtain_committees;
+use crate::data_availability_checker::AvailabilityCheckError;
+use crate::kzg_utils::{validate_blob, validate_blobs};
+use crate::{metrics, BeaconChainError};
+use kzg::{Kzg, KzgCommitment};
+use slog::{debug, warn};
+use ssz_derive::{Decode, Encode};
+use ssz_types::VariableList;
+use tree_hash::TreeHash;
+use types::blob_sidecar::BlobIdentifier;
+use types::{
+ BeaconStateError, BlobSidecar, BlobSidecarList, CloneConfig, EthSpec, Hash256,
+ SignedBlobSidecar, Slot,
+};
+
+/// An error occurred while validating a gossip blob.
+#[derive(Debug)]
+pub enum GossipBlobError {
+ /// The blob sidecar is from a slot that is later than the current slot (with respect to the
+ /// gossip clock disparity).
+ ///
+ /// ## Peer scoring
+ ///
+ /// Assuming the local clock is correct, the peer has sent an invalid message.
+ FutureSlot {
+ message_slot: Slot,
+ latest_permissible_slot: Slot,
+ },
+
+ /// There was an error whilst processing the blob. It is not known if it is
+ /// valid or invalid.
+ ///
+ /// ## Peer scoring
+ ///
+ /// We were unable to process this blob due to an internal error. It's
+ /// unclear if the blob is valid.
+ BeaconChainError(BeaconChainError),
+
+ /// The `BlobSidecar` was gossiped over an incorrect subnet.
+ ///
+ /// ## Peer scoring
+ ///
+ /// The blob is invalid or the peer is faulty.
+ InvalidSubnet { expected: u64, received: u64 },
+
+ /// The sidecar corresponds to a slot older than the finalized head slot.
+ ///
+ /// ## Peer scoring
+ ///
+ /// It's unclear if this blob is valid, but this blob is for a finalized slot and is
+ /// therefore useless to us.
+ PastFinalizedSlot {
+ blob_slot: Slot,
+ finalized_slot: Slot,
+ },
+
+ /// The proposer index specified in the sidecar does not match the locally computed
+ /// proposer index.
+ ///
+ /// ## Peer scoring
+ ///
+ /// The blob is invalid and the peer is faulty.
+ ProposerIndexMismatch { sidecar: usize, local: usize },
+
+ /// The proposal signature in invalid.
+ ///
+ /// ## Peer scoring
+ ///
+ /// The blob is invalid and the peer is faulty.
+ ProposerSignatureInvalid,
+
+ /// The proposal_index corresponding to blob.beacon_block_root is not known.
+ ///
+ /// ## Peer scoring
+ ///
+ /// The blob is invalid and the peer is faulty.
+ UnknownValidator(u64),
+
+ /// The provided blob is not from a later slot than its parent.
+ ///
+ /// ## Peer scoring
+ ///
+ /// The blob is invalid and the peer is faulty.
+ BlobIsNotLaterThanParent { blob_slot: Slot, parent_slot: Slot },
+
+ /// The provided blob's parent block is unknown.
+ ///
+ /// ## Peer scoring
+ ///
+ /// We cannot process the blob without validating its parent, the peer isn't necessarily faulty.
+ BlobParentUnknown(Arc>),
+
+ /// A blob has already been seen for the given `(sidecar.block_root, sidecar.index)` tuple
+ /// over gossip or no gossip sources.
+ ///
+ /// ## Peer scoring
+ ///
+ /// The peer isn't faulty, but we do not forward it over gossip.
+ RepeatBlob {
+ proposer: u64,
+ slot: Slot,
+ index: u64,
+ },
+}
+
+impl std::fmt::Display for GossipBlobError {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ match self {
+ GossipBlobError::BlobParentUnknown(blob_sidecar) => {
+ write!(
+ f,
+ "BlobParentUnknown(parent_root:{})",
+ blob_sidecar.block_parent_root
+ )
+ }
+ other => write!(f, "{:?}", other),
+ }
+ }
+}
+
+impl From for GossipBlobError {
+ fn from(e: BeaconChainError) -> Self {
+ GossipBlobError::BeaconChainError(e)
+ }
+}
+
+impl From for GossipBlobError {
+ fn from(e: BeaconStateError) -> Self {
+ GossipBlobError::BeaconChainError(BeaconChainError::BeaconStateError(e))
+ }
+}
+
+pub type GossipVerifiedBlobList = VariableList<
+ GossipVerifiedBlob,
+ <::EthSpec as EthSpec>::MaxBlobsPerBlock,
+>;
+
+/// A wrapper around a `BlobSidecar` that indicates it has been approved for re-gossiping on
+/// the p2p network.
+#[derive(Debug)]
+pub struct GossipVerifiedBlob {
+ blob: SignedBlobSidecar,
+}
+
+impl GossipVerifiedBlob {
+ pub fn new(
+ blob: SignedBlobSidecar,
+ chain: &BeaconChain,
+ ) -> Result> {
+ let blob_index = blob.message.index;
+ validate_blob_sidecar_for_gossip(blob, blob_index, chain)
+ }
+ /// Construct a `GossipVerifiedBlob` that is assumed to be valid.
+ ///
+ /// This should ONLY be used for testing.
+ pub fn __assumed_valid(blob: SignedBlobSidecar) -> Self {
+ Self { blob }
+ }
+ pub fn id(&self) -> BlobIdentifier {
+ self.blob.message.id()
+ }
+ pub fn block_root(&self) -> Hash256 {
+ self.blob.message.block_root
+ }
+ pub fn to_blob(self) -> Arc> {
+ self.blob.message
+ }
+ pub fn as_blob(&self) -> &BlobSidecar {
+ &self.blob.message
+ }
+ pub fn signed_blob(&self) -> SignedBlobSidecar {
+ self.blob.clone()
+ }
+ pub fn slot(&self) -> Slot {
+ self.blob.message.slot
+ }
+ pub fn index(&self) -> u64 {
+ self.blob.message.index
+ }
+ pub fn kzg_commitment(&self) -> KzgCommitment {
+ self.blob.message.kzg_commitment
+ }
+ pub fn proposer_index(&self) -> u64 {
+ self.blob.message.proposer_index
+ }
+}
+
+pub fn validate_blob_sidecar_for_gossip(
+ signed_blob_sidecar: SignedBlobSidecar,
+ subnet: u64,
+ chain: &BeaconChain,
+) -> Result, GossipBlobError> {
+ let blob_slot = signed_blob_sidecar.message.slot;
+ let blob_index = signed_blob_sidecar.message.index;
+ let block_parent_root = signed_blob_sidecar.message.block_parent_root;
+ let blob_proposer_index = signed_blob_sidecar.message.proposer_index;
+ let block_root = signed_blob_sidecar.message.block_root;
+ let blob_epoch = blob_slot.epoch(T::EthSpec::slots_per_epoch());
+
+ // Verify that the blob_sidecar was received on the correct subnet.
+ if blob_index != subnet {
+ return Err(GossipBlobError::InvalidSubnet {
+ expected: blob_index,
+ received: subnet,
+ });
+ }
+
+ let blob_root = get_blob_root(&signed_blob_sidecar);
+
+ // Verify that the sidecar is not from a future slot.
+ let latest_permissible_slot = chain
+ .slot_clock
+ .now_with_future_tolerance(chain.spec.maximum_gossip_clock_disparity())
+ .ok_or(BeaconChainError::UnableToReadSlot)?;
+ if blob_slot > latest_permissible_slot {
+ return Err(GossipBlobError::FutureSlot {
+ message_slot: blob_slot,
+ latest_permissible_slot,
+ });
+ }
+
+ // Verify that the sidecar slot is greater than the latest finalized slot
+ let latest_finalized_slot = chain
+ .head()
+ .finalized_checkpoint()
+ .epoch
+ .start_slot(T::EthSpec::slots_per_epoch());
+ if blob_slot <= latest_finalized_slot {
+ return Err(GossipBlobError::PastFinalizedSlot {
+ blob_slot,
+ finalized_slot: latest_finalized_slot,
+ });
+ }
+
+ // Verify that this is the first blob sidecar received for the (sidecar.block_root, sidecar.index) tuple
+ if chain
+ .observed_blob_sidecars
+ .read()
+ .is_known(&signed_blob_sidecar.message)
+ .map_err(|e| GossipBlobError::BeaconChainError(e.into()))?
+ {
+ return Err(GossipBlobError::RepeatBlob {
+ proposer: blob_proposer_index,
+ slot: blob_slot,
+ index: blob_index,
+ });
+ }
+
+ // We have already verified that the blob is past finalization, so we can
+ // just check fork choice for the block's parent.
+ let Some(parent_block) = chain
+ .canonical_head
+ .fork_choice_read_lock()
+ .get_block(&block_parent_root)
+ else {
+ return Err(GossipBlobError::BlobParentUnknown(
+ signed_blob_sidecar.message,
+ ));
+ };
+
+ if parent_block.slot >= blob_slot {
+ return Err(GossipBlobError::BlobIsNotLaterThanParent {
+ blob_slot,
+ parent_slot: parent_block.slot,
+ });
+ }
+
+ // Note: We check that the proposer_index matches against the shuffling first to avoid
+ // signature verification against an invalid proposer_index.
+ let proposer_shuffling_root =
+ if parent_block.slot.epoch(T::EthSpec::slots_per_epoch()) == blob_epoch {
+ parent_block
+ .next_epoch_shuffling_id
+ .shuffling_decision_block
+ } else {
+ parent_block.root
+ };
+
+ let proposer_opt = chain
+ .beacon_proposer_cache
+ .lock()
+ .get_slot::(proposer_shuffling_root, blob_slot);
+
+ let (proposer_index, fork) = if let Some(proposer) = proposer_opt {
+ (proposer.index, proposer.fork)
+ } else {
+ debug!(
+ chain.log,
+ "Proposer shuffling cache miss for blob verification";
+ "block_root" => %block_root,
+ "index" => %blob_index,
+ );
+ if let Some(mut snapshot) = chain
+ .snapshot_cache
+ .try_read_for(BLOCK_PROCESSING_CACHE_LOCK_TIMEOUT)
+ .and_then(|snapshot_cache| {
+ snapshot_cache.get_cloned(block_parent_root, CloneConfig::committee_caches_only())
+ })
+ {
+ if snapshot.beacon_state.slot() == blob_slot {
+ debug!(
+ chain.log,
+ "Cloning snapshot cache state for blob verification";
+ "block_root" => %block_root,
+ "index" => %blob_index,
+ );
+ (
+ snapshot
+ .beacon_state
+ .get_beacon_proposer_index(blob_slot, &chain.spec)?,
+ snapshot.beacon_state.fork(),
+ )
+ } else {
+ debug!(
+ chain.log,
+ "Cloning and advancing snapshot cache state for blob verification";
+ "block_root" => %block_root,
+ "index" => %blob_index,
+ );
+ let state =
+ cheap_state_advance_to_obtain_committees::<_, GossipBlobError>(
+ &mut snapshot.beacon_state,
+ Some(snapshot.beacon_block_root),
+ blob_slot,
+ &chain.spec,
+ )?;
+ (
+ state.get_beacon_proposer_index(blob_slot, &chain.spec)?,
+ state.fork(),
+ )
+ }
+ }
+ // Need to advance the state to get the proposer index
+ else {
+ warn!(
+ chain.log,
+ "Snapshot cache miss for blob verification";
+ "block_root" => %block_root,
+ "index" => %blob_index,
+ );
+
+ let parent_block = chain
+ .get_blinded_block(&block_parent_root)
+ .map_err(GossipBlobError::BeaconChainError)?
+ .ok_or_else(|| {
+ GossipBlobError::from(BeaconChainError::MissingBeaconBlock(block_parent_root))
+ })?;
+
+ let mut parent_state = chain
+ .get_state(&parent_block.state_root(), Some(parent_block.slot()))?
+ .ok_or_else(|| {
+ BeaconChainError::DBInconsistent(format!(
+ "Missing state {:?}",
+ parent_block.state_root()
+ ))
+ })?;
+ let state = cheap_state_advance_to_obtain_committees::<_, GossipBlobError>(
+ &mut parent_state,
+ Some(parent_block.state_root()),
+ blob_slot,
+ &chain.spec,
+ )?;
+
+ let proposers = state.get_beacon_proposer_indices(&chain.spec)?;
+ let proposer_index = *proposers
+ .get(blob_slot.as_usize() % T::EthSpec::slots_per_epoch() as usize)
+ .ok_or_else(|| BeaconChainError::NoProposerForSlot(blob_slot))?;
+
+ // Prime the proposer shuffling cache with the newly-learned value.
+ chain.beacon_proposer_cache.lock().insert(
+ blob_epoch,
+ proposer_shuffling_root,
+ proposers,
+ state.fork(),
+ )?;
+ (proposer_index, state.fork())
+ }
+ };
+
+ if proposer_index != blob_proposer_index as usize {
+ return Err(GossipBlobError::ProposerIndexMismatch {
+ sidecar: blob_proposer_index as usize,
+ local: proposer_index,
+ });
+ }
+
+ // Signature verification
+ let signature_is_valid = {
+ let pubkey_cache = chain
+ .validator_pubkey_cache
+ .try_read_for(VALIDATOR_PUBKEY_CACHE_LOCK_TIMEOUT)
+ .ok_or(BeaconChainError::ValidatorPubkeyCacheLockTimeout)
+ .map_err(GossipBlobError::BeaconChainError)?;
+
+ let pubkey = pubkey_cache
+ .get(proposer_index)
+ .ok_or_else(|| GossipBlobError::UnknownValidator(proposer_index as u64))?;
+
+ signed_blob_sidecar.verify_signature(
+ Some(blob_root),
+ pubkey,
+ &fork,
+ chain.genesis_validators_root,
+ &chain.spec,
+ )
+ };
+
+ if !signature_is_valid {
+ return Err(GossipBlobError::ProposerSignatureInvalid);
+ }
+
+ // Now the signature is valid, store the proposal so we don't accept another blob sidecar
+ // with the same `BlobIdentifier`.
+ // It's important to double-check that the proposer still hasn't been observed so we don't
+ // have a race-condition when verifying two blocks simultaneously.
+ //
+ // Note: If this BlobSidecar goes on to fail full verification, we do not evict it from the seen_cache
+ // as alternate blob_sidecars for the same identifier can still be retrieved
+ // over rpc. Evicting them from this cache would allow faster propagation over gossip. So we allow
+ // retrieval of potentially valid blocks over rpc, but try to punish the proposer for signing
+ // invalid messages. Issue for more background
+ // /~https://github.com/ethereum/consensus-specs/issues/3261
+ if chain
+ .observed_blob_sidecars
+ .write()
+ .observe_sidecar(&signed_blob_sidecar.message)
+ .map_err(|e| GossipBlobError::BeaconChainError(e.into()))?
+ {
+ return Err(GossipBlobError::RepeatBlob {
+ proposer: proposer_index as u64,
+ slot: blob_slot,
+ index: blob_index,
+ });
+ }
+
+ Ok(GossipVerifiedBlob {
+ blob: signed_blob_sidecar,
+ })
+}
+
+/// Wrapper over a `BlobSidecar` for which we have completed kzg verification.
+/// i.e. `verify_blob_kzg_proof(blob, commitment, proof) == true`.
+#[derive(Debug, Derivative, Clone, Encode, Decode)]
+#[derivative(PartialEq, Eq)]
+#[ssz(struct_behaviour = "transparent")]
+pub struct KzgVerifiedBlob {
+ blob: Arc>,
+}
+
+impl PartialOrd for KzgVerifiedBlob {
+ fn partial_cmp(&self, other: &Self) -> Option