From d96d793bfbbef2322cba99b1676c3d63e1197b15 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Thu, 12 Jan 2023 14:17:14 -0500 Subject: [PATCH] fix compilation issues --- .github/workflows/docker.yml | 1 - Cargo.lock | 35 ++++++++++++++++++++++++++ beacon_node/execution_layer/src/lib.rs | 2 +- consensus/types/Cargo.toml | 2 +- consensus/types/src/blobs_sidecar.rs | 1 - crypto/kzg/Cargo.toml | 1 + crypto/kzg/src/kzg_commitment.rs | 9 +++++++ crypto/kzg/src/kzg_proof.rs | 9 +++++++ lcli/Cargo.toml | 1 - testing/ef_tests/Cargo.toml | 1 - 10 files changed, 56 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cf4949e3f..a4e1fefe2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -41,7 +41,6 @@ jobs: run: | echo "VERSION=capella" >> $GITHUB_ENV echo "VERSION_SUFFIX=" >> $GITHUB_ENV - echo "CROSS_FEATURES=withdrawals-processing" >> $GITHUB_ENV - name: Extract version (if eip4844) if: github.event.ref == 'refs/heads/eip4844' run: | diff --git a/Cargo.lock b/Cargo.lock index 9921064d8..62fe137c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -564,6 +564,7 @@ dependencies = [ "eth1", "eth2", "eth2_hashing", + "eth2_network_config", "eth2_ssz", "eth2_ssz_derive", "eth2_ssz_types", @@ -575,6 +576,7 @@ dependencies = [ "hex", "int_to_bytes", "itertools", + "kzg", "lazy_static", "lighthouse_metrics", "logging", @@ -634,6 +636,7 @@ dependencies = [ "node_test_rig", "sensitive_url", "serde", + "serde_json", "slasher", "slog", "store", @@ -890,6 +893,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "c-kzg" +version = "0.1.0" +source = "git+https://github.com/pawanjay176/c-kzg-4844?rev=c9e4fa0dabdd000738b7fcdf85a72880a5da8748#c9e4fa0dabdd000738b7fcdf85a72880a5da8748" +dependencies = [ + "hex", + "libc", +] + [[package]] name = "cached_tree_hash" version = "0.1.0" @@ -2196,6 +2208,8 @@ dependencies = [ "enr", "eth2_config", "eth2_ssz", + "kzg", + "serde_json", "serde_yaml", "tempfile", "types", @@ -3666,6 +3680,25 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "kzg" +version = "0.1.0" +dependencies = [ + "arbitrary", + "c-kzg", + "derivative", + "eth2_hashing", + "eth2_serde_utils", + "eth2_ssz", + "eth2_ssz_derive", + "ethereum-types 0.12.1", + "hex", + "rand 0.7.3", + "serde", + "serde_derive", + "tree_hash", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -3696,6 +3729,7 @@ dependencies = [ "environment", "eth1_test_rig", "eth2", + "eth2_hashing", "eth2_network_config", "eth2_ssz", "eth2_wallet", @@ -8244,6 +8278,7 @@ dependencies = [ "hex", "int_to_bytes", "itertools", + "kzg", "lazy_static", "log", "maplit", diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index d2bcfdd9f..cd014d0a3 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -327,7 +327,7 @@ impl ExecutionLayer { let auth = Auth::new(jwt_key, jwt_id, jwt_version); debug!(log, "Loaded execution endpoint"; "endpoint" => %execution_url, "jwt_path" => ?secret_file.as_path()); let api = - HttpJsonRpc::new_with_auth(execution_url, auth, execution_timeout_multiplier, spec) + HttpJsonRpc::new_with_auth(execution_url, auth, execution_timeout_multiplier, &spec) .map_err(Error::ApiError)?; Engine::new(api, executor.clone(), &log) }; diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index 5f82e802c..97ce90de6 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -12,7 +12,7 @@ harness = false serde-big-array = {version = "0.3.2", features = ["const-generics"]} merkle_proof = { path = "../../consensus/merkle_proof" } bls = { path = "../../crypto/bls", features = ["arbitrary"] } -kzg = { path = "../../crypto/kzg" } +kzg = { path = "../../crypto/kzg", features = ["arbitrary"] } compare_fields = { path = "../../common/compare_fields" } compare_fields_derive = { path = "../../common/compare_fields_derive" } eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" } diff --git a/consensus/types/src/blobs_sidecar.rs b/consensus/types/src/blobs_sidecar.rs index ff1754d92..d544a3d91 100644 --- a/consensus/types/src/blobs_sidecar.rs +++ b/consensus/types/src/blobs_sidecar.rs @@ -17,7 +17,6 @@ use tree_hash_derive::TreeHash; Encode, Decode, TreeHash, - PartialEq, Default, TestRandom, Derivative, diff --git a/crypto/kzg/Cargo.toml b/crypto/kzg/Cargo.toml index 53c64a4b3..0d2b1bf30 100644 --- a/crypto/kzg/Cargo.toml +++ b/crypto/kzg/Cargo.toml @@ -19,6 +19,7 @@ hex = "0.4.2" eth2_hashing = "0.3.0" ethereum-types = "0.12.1" c-kzg = {git = "https://github.com/pawanjay176/c-kzg-4844", rev = "c9e4fa0dabdd000738b7fcdf85a72880a5da8748" } +arbitrary = { version = "1.0", features = ["derive"], optional = true } [features] default = ["mainnet-spec"] diff --git a/crypto/kzg/src/kzg_commitment.rs b/crypto/kzg/src/kzg_commitment.rs index 44609d83e..8d6eefecd 100644 --- a/crypto/kzg/src/kzg_commitment.rs +++ b/crypto/kzg/src/kzg_commitment.rs @@ -102,3 +102,12 @@ impl Debug for KzgCommitment { write!(f, "{}", eth2_serde_utils::hex::encode(&self.0)) } } + +#[cfg(feature = "arbitrary")] +impl arbitrary::Arbitrary<'_> for KzgCommitment { + fn arbitrary(u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result { + let mut bytes = [0u8; KZG_COMMITMENT_BYTES_LEN]; + u.fill_buffer(&mut bytes)?; + Ok(KzgCommitment(bytes)) + } +} diff --git a/crypto/kzg/src/kzg_proof.rs b/crypto/kzg/src/kzg_proof.rs index be85088f7..32166ee84 100644 --- a/crypto/kzg/src/kzg_proof.rs +++ b/crypto/kzg/src/kzg_proof.rs @@ -126,3 +126,12 @@ impl Debug for KzgProof { write!(f, "{}", eth2_serde_utils::hex::encode(&self.0)) } } + +#[cfg(feature = "arbitrary")] +impl arbitrary::Arbitrary<'_> for KzgProof { + fn arbitrary(u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result { + let mut bytes = [0u8; KZG_PROOF_BYTES_LEN]; + u.fill_buffer(&mut bytes)?; + Ok(KzgProof(bytes)) + } +} diff --git a/lcli/Cargo.toml b/lcli/Cargo.toml index 4e9665e1a..ab7bc43df 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -8,7 +8,6 @@ edition = "2021" [features] portable = ["bls/supranational-portable"] fake_crypto = ['bls/fake_crypto'] -withdrawals-processing = ["beacon_chain/withdrawals-processing", "store/withdrawals-processing", "state_processing/withdrawals-processing"] [dependencies] bls = { path = "../crypto/bls" } diff --git a/testing/ef_tests/Cargo.toml b/testing/ef_tests/Cargo.toml index 7834ed65f..79664a262 100644 --- a/testing/ef_tests/Cargo.toml +++ b/testing/ef_tests/Cargo.toml @@ -9,7 +9,6 @@ edition = "2021" ef_tests = [] milagro = ["bls/milagro"] fake_crypto = ["bls/fake_crypto"] -withdrawals-processing = ["state_processing/withdrawals-processing", "store/withdrawals-processing", "beacon_chain/withdrawals-processing", "execution_layer/withdrawals-processing"] [dependencies] bls = { path = "../../crypto/bls", default-features = false }