From 50321c6671e7aa3a5b508d433a5d892e7a3ba01f Mon Sep 17 00:00:00 2001 From: realbigsean Date: Fri, 3 Sep 2021 01:10:25 +0000 Subject: [PATCH] Updates to make crates publishable (#2472) ## Issue Addressed Related to: #2259 Made an attempt at all the necessary updates here to publish the crates to crates.io. I incremented the minor versions on all the crates that have been previously published. We still might run into some issues as we try to publish because I'm not able to test this out but I think it's a good starting point. ## Proposed Changes - Add description and license to `ssz_types` and `serde_util` - rename `serde_util` to `eth2_serde_util` - increment minor versions - remove path dependencies - remove patch dependencies ## Additional Info Crates published: - [x] `tree_hash` -- need to publish `tree_hash_derive` and `eth2_hashing` first - [x] `eth2_ssz_types` -- need to publish `eth2_serde_util` first - [x] `tree_hash_derive` - [x] `eth2_ssz` - [x] `eth2_ssz_derive` - [x] `eth2_serde_util` - [x] `eth2_hashing` Co-authored-by: realbigsean --- .github/workflows/publish-crate.yml | 66 +++ Cargo.lock | 437 +++++++++++------- Cargo.toml | 9 - account_manager/Cargo.toml | 4 +- beacon_node/Cargo.toml | 2 +- beacon_node/beacon_chain/Cargo.toml | 10 +- beacon_node/client/Cargo.toml | 4 +- beacon_node/eth1/Cargo.toml | 8 +- beacon_node/eth2_libp2p/Cargo.toml | 6 +- beacon_node/genesis/Cargo.toml | 6 +- beacon_node/http_api/Cargo.toml | 4 +- beacon_node/network/Cargo.toml | 6 +- beacon_node/operation_pool/Cargo.toml | 4 +- beacon_node/store/Cargo.toml | 6 +- boot_node/Cargo.toml | 2 +- common/clap_utils/Cargo.toml | 2 +- common/deposit_contract/Cargo.toml | 4 +- common/eth2/Cargo.toml | 6 +- common/eth2/src/lighthouse_vc/http_client.rs | 4 +- common/eth2/src/lighthouse_vc/types.rs | 6 +- common/eth2/src/types.rs | 58 +-- common/eth2_interop_keypairs/Cargo.toml | 2 +- common/eth2_network_config/Cargo.toml | 2 +- common/validator_dir/Cargo.toml | 2 +- consensus/cached_tree_hash/Cargo.toml | 10 +- consensus/fork_choice/Cargo.toml | 6 +- consensus/merkle_proof/Cargo.toml | 2 +- consensus/proto_array/Cargo.toml | 4 +- consensus/serde_utils/Cargo.toml | 4 +- consensus/ssz/Cargo.toml | 4 +- consensus/ssz_derive/Cargo.toml | 2 +- consensus/ssz_types/Cargo.toml | 10 +- consensus/ssz_types/src/bitfield.rs | 2 +- .../src/serde_utils/quoted_u64_fixed_vec.rs | 2 +- .../src/serde_utils/quoted_u64_var_list.rs | 2 +- consensus/state_processing/Cargo.toml | 10 +- consensus/swap_or_not_shuffle/Cargo.toml | 2 +- consensus/tree_hash/Cargo.toml | 6 +- consensus/tree_hash_derive/Cargo.toml | 2 +- consensus/types/Cargo.toml | 14 +- consensus/types/src/aggregate_and_proof.rs | 2 +- consensus/types/src/attestation_data.rs | 2 +- consensus/types/src/attestation_duty.rs | 2 +- consensus/types/src/beacon_block.rs | 2 +- consensus/types/src/beacon_block_header.rs | 2 +- consensus/types/src/beacon_state.rs | 4 +- consensus/types/src/chain_spec.rs | 36 +- consensus/types/src/contribution_and_proof.rs | 2 +- consensus/types/src/deposit_data.rs | 2 +- consensus/types/src/deposit_message.rs | 2 +- consensus/types/src/enr_fork_id.rs | 4 +- consensus/types/src/eth1_data.rs | 2 +- consensus/types/src/fork.rs | 4 +- consensus/types/src/fork_data.rs | 2 +- consensus/types/src/free_attestation.rs | 2 +- consensus/types/src/graffiti.rs | 6 +- consensus/types/src/indexed_attestation.rs | 2 +- consensus/types/src/pending_attestation.rs | 4 +- consensus/types/src/preset.rs | 78 ++-- consensus/types/src/slot_epoch.rs | 4 +- consensus/types/src/subnet_id.rs | 2 +- .../types/src/sync_committee_contribution.rs | 2 +- consensus/types/src/sync_committee_message.rs | 2 +- consensus/types/src/sync_duty.rs | 4 +- consensus/types/src/sync_subnet_id.rs | 2 +- consensus/types/src/validator.rs | 2 +- consensus/types/src/voluntary_exit.rs | 2 +- crypto/bls/Cargo.toml | 8 +- crypto/bls/src/generic_aggregate_signature.rs | 2 +- crypto/bls/src/generic_public_key.rs | 2 +- crypto/bls/src/generic_public_key_bytes.rs | 2 +- crypto/bls/src/generic_signature.rs | 2 +- crypto/bls/src/generic_signature_bytes.rs | 2 +- crypto/eth2_hashing/Cargo.toml | 2 +- crypto/eth2_keystore/Cargo.toml | 2 +- lcli/Cargo.toml | 4 +- lighthouse/Cargo.toml | 2 +- scripts/ci/publish.sh | 109 +++++ slasher/Cargo.toml | 8 +- testing/ef_tests/Cargo.toml | 8 +- testing/state_transition_vectors/Cargo.toml | 2 +- validator_client/Cargo.toml | 8 +- .../slashing_protection/Cargo.toml | 4 +- .../slashing_protection/src/interchange.rs | 8 +- validator_client/src/beacon_node_fallback.rs | 2 +- validator_client/src/http_api/api_secret.rs | 12 +- .../src/http_api/create_validator.rs | 2 +- validator_client/src/http_api/tests.rs | 2 +- 88 files changed, 682 insertions(+), 433 deletions(-) create mode 100644 .github/workflows/publish-crate.yml create mode 100755 scripts/ci/publish.sh diff --git a/.github/workflows/publish-crate.yml b/.github/workflows/publish-crate.yml new file mode 100644 index 000000000..a419025b4 --- /dev/null +++ b/.github/workflows/publish-crate.yml @@ -0,0 +1,66 @@ +name: Publish Crate + +on: + push: + tags: + - tree-hash-v* + - tree-hash-derive-v* + - eth2-ssz-v* + - eth2-ssz-derive-v* + - eth2-ssz-types-v* + - eth2-serde-util-v* + - eth2-hashing-v* + +env: + CARGO_API_TOKEN: ${{ secrets.CARGO_API_TOKEN }} + +jobs: + extract-tag: + runs-on: ubuntu-latest + steps: + - name: Extract tag + run: echo "::set-output name=TAG::$(echo ${GITHUB_REF#refs/tags/})" + id: extract_tag + outputs: + TAG: ${{ steps.extract_tag.outputs.TAG }} + + publish-crate: + runs-on: ubuntu-latest + needs: [extract-tag] + env: + TAG: ${{ needs.extract-tag.outputs.TAG }} + steps: + - uses: actions/checkout@v2 + - name: Update Rust + run: rustup update stable + - name: Cargo login + run: | + echo "${CARGO_API_TOKEN}" | cargo login + - name: publish tree hash + if: startsWith(env.TAG, 'tree-hash-v') + run: | + ./scripts/ci/publish.sh consensus/tree_hash tree_hash "$TAG" + - name: publish tree hash derive + if: startsWith(env.TAG, 'tree-hash-derive-v') + run: | + ./scripts/ci/publish.sh consensus/tree_hash_derive tree_hash_derive "$TAG" + - name: publish eth2 ssz + if: startsWith(env.TAG, 'eth2-ssz-v') + run: | + ./scripts/ci/publish.sh consensus/ssz eth2_ssz "$TAG" + - name: publish eth2 ssz derive + if: startsWith(env.TAG, 'eth2-ssz-derive-v') + run: | + ./scripts/ci/publish.sh consensus/ssz_derive eth2_ssz_derive "$TAG" + - name: publish ssz types + if: startsWith(env.TAG, 'eth2-ssz-types-v') + run: | + ./scripts/ci/publish.sh consensus/ssz_types eth2_ssz_types "$TAG" + - name: publish serde util + if: startsWith(env.TAG, 'eth2-serde-util-v') + run: | + ./scripts/ci/publish.sh consensus/serde_utils eth2_serde_utils "$TAG" + - name: publish eth2 hashing + if: startsWith(env.TAG, 'eth2-hashing-v') + run: | + ./scripts/ci/publish.sh crypto/eth2_hashing eth2_hashing "$TAG" diff --git a/Cargo.lock b/Cargo.lock index 9d2affa06..96029b781 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,8 +17,8 @@ dependencies = [ "eth2", "eth2_keystore", "eth2_network_config", - "eth2_ssz", - "eth2_ssz_derive", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "eth2_wallet", "eth2_wallet_manager", "filesystem", @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.42" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486" +checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf" [[package]] name = "arbitrary" @@ -183,9 +183,9 @@ checksum = "237430fd6ed3740afe94eefcc278ae21e050285be882804e0d6e8695f0c94691" [[package]] name = "arc-swap" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e906254e445520903e7fc9da4f709886c84ae4bc4ddaf0e093188d66df4dc820" +checksum = "34a23efe54373080cf871532e2d01076be41c4c896d32ef63af1b2dded924b03" [[package]] name = "arrayref" @@ -510,10 +510,10 @@ dependencies = [ "eth1", "eth2", "eth2_config", - "eth2_hashing", - "eth2_ssz", - "eth2_ssz_derive", - "eth2_ssz_types", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future", "fork_choice", "futures", @@ -550,7 +550,7 @@ dependencies = [ "task_executor", "tempfile", "tokio", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -568,7 +568,7 @@ dependencies = [ "eth2_config", "eth2_libp2p", "eth2_network_config", - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future", "futures", "genesis", @@ -617,9 +617,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da1976d75adbe5fbc88130ecd119529cf1cc6a93ae1546d8696ee66f0d21af1" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" @@ -702,16 +702,16 @@ version = "0.2.0" dependencies = [ "arbitrary 0.4.7", "blst", - "eth2_hashing", - "eth2_ssz", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_serde_utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.11.0", "hex", "milagro_bls", "rand 0.7.3", "serde", "serde_derive", - "serde_utils", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "zeroize", ] @@ -735,7 +735,7 @@ dependencies = [ "clap", "eth2_libp2p", "eth2_network_config", - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures", "hex", "log", @@ -845,15 +845,15 @@ checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" name = "cached_tree_hash" version = "0.1.0" dependencies = [ - "eth2_hashing", - "eth2_ssz", - "eth2_ssz_derive", - "eth2_ssz_types", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.11.0", "quickcheck", "quickcheck_macros", "smallvec", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -952,7 +952,7 @@ dependencies = [ "clap", "dirs", "eth2_network_config", - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex", "types", ] @@ -969,7 +969,7 @@ dependencies = [ "eth1", "eth2_config", "eth2_libp2p", - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures", "genesis", "http_api", @@ -996,7 +996,7 @@ dependencies = [ "timer", "tokio", "toml", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", "url", ] @@ -1399,13 +1399,13 @@ checksum = "b72465f46d518f6015d9cf07f7f3013a95dd6b9c2747c3d65ae0cce43929d14f" name = "deposit_contract" version = "0.2.0" dependencies = [ - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethabi 12.0.0", "hex", "reqwest", "serde_json", "sha2", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -1625,8 +1625,8 @@ dependencies = [ "compare_fields", "compare_fields_derive", "derivative", - "eth2_ssz", - "eth2_ssz_derive", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.11.0", "fs2", "hex", @@ -1639,8 +1639,8 @@ dependencies = [ "snap", "state_processing", "swap_or_not_shuffle", - "tree_hash", - "tree_hash_derive", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tree_hash_derive 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -1777,9 +1777,9 @@ dependencies = [ "environment", "eth1_test_rig", "eth2", - "eth2_hashing", - "eth2_ssz", - "eth2_ssz_derive", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "fallback", "futures", "hex", @@ -1798,7 +1798,7 @@ dependencies = [ "task_executor", "tokio", "toml", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", "web3", ] @@ -1823,8 +1823,9 @@ dependencies = [ "bytes 1.0.1", "eth2_keystore", "eth2_libp2p", - "eth2_ssz", - "eth2_ssz_derive", + "eth2_serde_utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures", "futures-util", "hex", @@ -1837,7 +1838,6 @@ dependencies = [ "sensitive_url", "serde", "serde_json", - "serde_utils", "types", "zeroize", ] @@ -1854,7 +1854,7 @@ dependencies = [ [[package]] name = "eth2_hashing" -version = "0.1.1" +version = "0.2.0" dependencies = [ "cpufeatures", "lazy_static", @@ -1864,13 +1864,25 @@ dependencies = [ "wasm-bindgen-test", ] +[[package]] +name = "eth2_hashing" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b67737df7e3769e823d9d583eb5d60bcc4b2ef97ca674d1964ef287a02f8517" +dependencies = [ + "cpufeatures", + "lazy_static", + "ring", + "sha2", +] + [[package]] name = "eth2_interop_keypairs" version = "0.2.0" dependencies = [ "base64 0.13.0", "bls", - "eth2_hashing", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex", "lazy_static", "num-bigint", @@ -1898,7 +1910,7 @@ dependencies = [ "aes", "bls", "eth2_key_derivation", - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex", "hmac 0.11.0", "pbkdf2 0.8.0", @@ -1923,9 +1935,9 @@ dependencies = [ "dirs", "discv5", "error-chain", - "eth2_ssz", - "eth2_ssz_derive", - "eth2_ssz_types", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future", "fnv", "futures", @@ -1967,7 +1979,7 @@ version = "0.2.0" dependencies = [ "enr", "eth2_config", - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "serde_yaml", "tempfile", @@ -1976,17 +1988,58 @@ dependencies = [ ] [[package]] -name = "eth2_ssz" -version = "0.1.2" +name = "eth2_serde_utils" +version = "0.1.0" +dependencies = [ + "hex", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "eth2_serde_utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "477fffc25490dfc866288273f96344c6879676a1337187fc39245cd422e10825" +dependencies = [ + "hex", + "serde", + "serde_derive", +] + +[[package]] +name = "eth2_ssz" +version = "0.3.0" +dependencies = [ + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.11.0", + "smallvec", +] + +[[package]] +name = "eth2_ssz" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a5dc942eddedd41e4591bab17bece2b00eb9eb153b8ea683c5bba682dbd41d" dependencies = [ - "eth2_ssz_derive", "ethereum-types 0.11.0", "smallvec", ] [[package]] name = "eth2_ssz_derive" -version = "0.1.0" +version = "0.2.1" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "eth2_ssz_derive" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12812b9ebe7b7246ab2ddf526cca7c6b1652b8f6a189450291eae702cf34808d" dependencies = [ "quote", "syn", @@ -1997,13 +2050,28 @@ name = "eth2_ssz_types" version = "0.2.0" dependencies = [ "arbitrary 0.4.7", - "eth2_ssz", + "eth2_serde_utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "serde_derive", "serde_json", - "serde_utils", - "tree_hash", - "tree_hash_derive", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tree_hash_derive 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum", +] + +[[package]] +name = "eth2_ssz_types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdc06d98dfc53d15835d75e4506643b7f9c64132878a11a3269ab8549ae06e68" +dependencies = [ + "arbitrary 0.4.7", + "eth2_serde_utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_derive", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "typenum", ] @@ -2265,14 +2333,14 @@ name = "fork_choice" version = "0.1.0" dependencies = [ "beacon_chain", - "eth2_ssz", - "eth2_ssz_derive", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex", "proto_array", "slot_clock", "state_processing", "store", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -2446,8 +2514,8 @@ dependencies = [ "environment", "eth1", "eth1_test_rig", - "eth2_hashing", - "eth2_ssz", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future", "futures", "int_to_bytes", @@ -2460,7 +2528,7 @@ dependencies = [ "slog", "state_processing", "tokio", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -2556,9 +2624,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" +checksum = "d7f3675cfef6a30c8031cf9e6493ebdc3bb3272a3fea3923c4210d1830e6a472" dependencies = [ "bytes 1.0.1", "fnv", @@ -2745,7 +2813,7 @@ dependencies = [ "eth1", "eth2", "eth2_libp2p", - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "fork_choice", "futures", "hex", @@ -2763,7 +2831,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", "warp", "warp_utils", @@ -2795,9 +2863,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" +checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" [[package]] name = "httpdate" @@ -3064,9 +3132,9 @@ checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" [[package]] name = "isahc" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81c01404730bb4574bbacb59ca0855f969f8eabd688ca22866f2cc333f1a4f69" +checksum = "431445cb4ba85a80cb1438a9ae8042dadb78ae4046ecee89ad027b614aa0ddb7" dependencies = [ "async-channel", "crossbeam-utils", @@ -3099,15 +3167,15 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "js-sys" -version = "0.3.52" +version = "0.3.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce791b7ca6638aae45be056e068fc756d871eb3b3b10b8efa62d1c9cec616752" +checksum = "e4bf49d50e2961077d9c99f4b7997d770a1114f087c3c2e0069b36c13fc2979d" dependencies = [ "wasm-bindgen", ] @@ -3211,7 +3279,7 @@ dependencies = [ "eth2_keystore", "eth2_libp2p", "eth2_network_config", - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "eth2_wallet", "futures", "genesis", @@ -3226,7 +3294,7 @@ dependencies = [ "simple_logger", "state_processing", "tokio", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", "validator_dir", "web3", @@ -3263,9 +3331,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" [[package]] name = "libc" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" +checksum = "a1fa8cddc8fbbee11227ef194b5317ed014b8acbf15139bd716a18ad3fe99ec5" [[package]] name = "libflate" @@ -3854,7 +3922,7 @@ dependencies = [ "directory", "env_logger 0.9.0", "environment", - "eth2_hashing", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "eth2_libp2p", "eth2_network_config", "futures", @@ -4040,9 +4108,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memoffset" @@ -4057,7 +4125,7 @@ dependencies = [ name = "merkle_proof" version = "0.2.0" dependencies = [ - "eth2_hashing", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.11.0", "lazy_static", "quickcheck", @@ -4095,9 +4163,9 @@ dependencies = [ [[package]] name = "minicbor" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1f5b98cb843034ca9ca7fd9cbfdd579c674d58fdc4a6015948be5559b52446" +checksum = "3fb74931969d99aeabd31fdffbcb7dfcc1b4cb07aed2c56480f28ea90dab5cb6" dependencies = [ "minicbor-derive", ] @@ -4288,8 +4356,8 @@ dependencies = [ "environment", "error-chain", "eth2_libp2p", - "eth2_ssz", - "eth2_ssz_types", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future", "fnv", "futures", @@ -4321,7 +4389,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -4470,9 +4538,9 @@ dependencies = [ [[package]] name = "object" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55827317fb4c08822499848a14237d2874d6f139828893017237e7ab93eb386" +checksum = "ee2766204889d09937d00bfbb7fec56bb2a199e2ade963cab19185d8a6104c7c" dependencies = [ "memchr", ] @@ -4547,8 +4615,8 @@ version = "0.2.0" dependencies = [ "beacon_chain", "derivative", - "eth2_ssz", - "eth2_ssz_derive", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "int_to_bytes", "itertools", "lazy_static", @@ -5022,8 +5090,8 @@ dependencies = [ name = "proto_array" version = "0.2.0" dependencies = [ - "eth2_ssz", - "eth2_ssz_derive", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "serde_derive", "serde_yaml", @@ -5032,9 +5100,9 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.25.0" +version = "2.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020f86b07722c5c4291f7c723eac4676b3892d47d9a7708dc2779696407f039b" +checksum = "23129d50f2c9355ced935fce8a08bd706ee2e7ce2b3b33bf61dace0e379ac63a" [[package]] name = "psutil" @@ -5517,9 +5585,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc-hash" @@ -5767,18 +5835,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.127" +version = "1.0.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" +checksum = "d1f72836d2aa753853178eda473a3b9d8e4eefdaf20523b919677e6de489f8f1" dependencies = [ "serde_derive", ] [[package]] name = "serde_cbor" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" dependencies = [ "half", "serde", @@ -5786,9 +5854,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.127" +version = "1.0.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" +checksum = "e57ae87ad533d9a56427558b516d0adac283614e347abf85b0dc0cbbf0a249f3" dependencies = [ "proc-macro2", "quote", @@ -5839,24 +5907,14 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_utils" -version = "0.1.0" -dependencies = [ - "hex", - "serde", - "serde_derive", - "serde_json", -] - [[package]] name = "serde_yaml" -version = "0.8.17" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15654ed4ab61726bf918a39cb8d98a2e2995b002387807fa6ba58fdf7f59bb23" +checksum = "6375dbd828ed6964c3748e4ef6d18e7a175d408ffe184bca01698d0c73f915a9" dependencies = [ "dtoa", - "linked-hash-map", + "indexmap", "serde", "yaml-rust", ] @@ -5992,8 +6050,8 @@ version = "0.1.0" dependencies = [ "bincode", "byteorder", - "eth2_ssz", - "eth2_ssz_derive", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "filesystem", "flate2", "lazy_static", @@ -6008,10 +6066,10 @@ dependencies = [ "serde", "serde_derive", "slog", - "sloggers 2.0.1", + "sloggers 2.0.2", "tempfile", - "tree_hash", - "tree_hash_derive", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tree_hash_derive 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -6037,6 +6095,7 @@ dependencies = [ name = "slashing_protection" version = "0.1.0" dependencies = [ + "eth2_serde_utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "filesystem", "lazy_static", "parking_lot", @@ -6047,9 +6106,8 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_utils", "tempfile", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -6149,9 +6207,9 @@ dependencies = [ [[package]] name = "sloggers" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7071b1119e436e93157c2e9e134138d9d8716dfe5e2f472500119bcbe4f45a4e" +checksum = "1ffcb984e952de7fdb085aa7bebcd4575e9d0c79630640a359a38578f0c18fd3" dependencies = [ "chrono", "libc", @@ -6180,11 +6238,11 @@ dependencies = [ [[package]] name = "sluice" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fa0333a60ff2e3474a6775cc611840c2a55610c831dd366503474c02f1a28f5" +checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5" dependencies = [ - "futures-channel", + "async-channel", "futures-core", "futures-io", ] @@ -6303,9 +6361,9 @@ dependencies = [ "beacon_chain", "bls", "env_logger 0.9.0", - "eth2_hashing", - "eth2_ssz", - "eth2_ssz_types", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "int_to_bytes", "integer-sqrt", "itertools", @@ -6319,8 +6377,8 @@ dependencies = [ "serde_derive", "serde_yaml", "smallvec", - "tree_hash", - "tree_hash_derive", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tree_hash_derive 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -6329,7 +6387,7 @@ name = "state_transition_vectors" version = "0.1.0" dependencies = [ "beacon_chain", - "eth2_ssz", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static", "state_processing", "types", @@ -6397,8 +6455,8 @@ dependencies = [ "beacon_chain", "db-key", "directory", - "eth2_ssz", - "eth2_ssz_derive", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "itertools", "lazy_static", "leveldb", @@ -6411,7 +6469,7 @@ dependencies = [ "sloggers 1.0.1", "state_processing", "tempfile", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -6484,15 +6542,15 @@ name = "swap_or_not_shuffle" version = "0.2.0" dependencies = [ "criterion", - "eth2_hashing", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.11.0", ] [[package]] name = "syn" -version = "1.0.74" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c" +checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7" dependencies = [ "proc-macro2", "quote", @@ -6762,9 +6820,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b" +checksum = "92036be488bb6594459f2e03b60e42df6f937fe6ca5c5ffdcb539c6b84dc40f5" dependencies = [ "autocfg 1.0.1", "bytes 1.0.1", @@ -6893,9 +6951,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8" dependencies = [ "lazy_static", ] @@ -6933,9 +6991,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab69019741fca4d98be3c62d2b75254528b5432233fd8a4d2739fec20278de48" +checksum = "b9cbe87a2fa7e35900ce5de20220a582a9483a7063811defce79d7cbd59d4cfe" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -6974,21 +7032,42 @@ dependencies = [ [[package]] name = "tree_hash" -version = "0.1.1" +version = "0.3.0" dependencies = [ "beacon_chain", - "eth2_hashing", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.11.0", "lazy_static", "rand 0.7.3", "smallvec", - "tree_hash_derive", + "tree_hash_derive 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] +[[package]] +name = "tree_hash" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0092991b5664c725f0fbf30ed7eba2163e36cb22a789e1e371e9575eaff580e0" +dependencies = [ + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ethereum-types 0.11.0", + "smallvec", +] + [[package]] name = "tree_hash_derive" -version = "0.2.0" +version = "0.3.1" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "tree_hash_derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbadff2b79dbe7e28bf382fc51c511552d3b8054b200a2e8cd973f61b3ae7603" dependencies = [ "quote", "syn", @@ -7091,11 +7170,12 @@ dependencies = [ "compare_fields_derive", "criterion", "derivative", - "eth2_hashing", + "eth2_hashing 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "eth2_interop_keypairs", - "eth2_ssz", - "eth2_ssz_derive", - "eth2_ssz_types", + "eth2_serde_utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.11.0", "hex", "int_to_bytes", @@ -7113,15 +7193,14 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_utils", "serde_yaml", "slog", "superstruct", "swap_or_not_shuffle", "tempfile", "test_random_derive", - "tree_hash", - "tree_hash_derive", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tree_hash_derive 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7286,8 +7365,9 @@ dependencies = [ "eth2_config", "eth2_interop_keypairs", "eth2_keystore", - "eth2_ssz", - "eth2_ssz_derive", + "eth2_serde_utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "eth2_ssz_derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future", "fallback", "filesystem", @@ -7313,7 +7393,6 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_utils", "serde_yaml", "slashing_protection", "slog", @@ -7323,7 +7402,7 @@ dependencies = [ "task_executor", "tempfile", "tokio", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", "validator_dir", "warp", @@ -7345,7 +7424,7 @@ dependencies = [ "rayon", "slog", "tempfile", - "tree_hash", + "tree_hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "types", ] @@ -7470,9 +7549,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.75" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b608ecc8f4198fe8680e2ed18eccab5f0cd4caaf3d83516fa5fb2e927fda2586" +checksum = "8ce9b1b516211d33767048e5d47fa2a381ed8b76fc48d2ce4aa39877f9f183e0" dependencies = [ "cfg-if 1.0.0", "serde", @@ -7482,9 +7561,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.75" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "580aa3a91a63d23aac5b6b267e2d13cb4f363e31dce6c352fca4752ae12e479f" +checksum = "cfe8dc78e2326ba5f845f4b5bf548401604fa20b1dd1d365fb73b6c1d6364041" dependencies = [ "bumpalo", "lazy_static", @@ -7497,9 +7576,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16646b21c3add8e13fdb8f20172f8a28c3dbf62f45406bcff0233188226cfe0c" +checksum = "95fded345a6559c2cfee778d562300c581f7d4ff3edb9b0d230d69800d213972" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -7509,9 +7588,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.75" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171ebf0ed9e1458810dfcb31f2e766ad6b3a89dbda42d8901f2b268277e5f09c" +checksum = "44468aa53335841d9d6b6c023eaab07c0cd4bddbcfdee3e2bb1e8d2cb8069fef" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7519,9 +7598,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.75" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2657dd393f03aa2a659c25c6ae18a13a4048cebd220e147933ea837efc589f" +checksum = "0195807922713af1e67dc66132c7328206ed9766af3858164fb583eedc25fbad" dependencies = [ "proc-macro2", "quote", @@ -7532,15 +7611,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.75" +version = "0.2.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e0c4a743a309662d45f4ede961d7afa4ba4131a59a639f29b0069c3798bbcc2" +checksum = "acdb075a845574a1fa5f09fd77e43f7747599301ea3417a9fbffdeedfc1f4a29" [[package]] name = "wasm-bindgen-test" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce783b6c3854292723f498b7bfcf65a782a320b6f1cb3012d08dfbc603fa62f5" +checksum = "046f563713e2e7a602f0b45d49a564355f9a8a404cac3fa27b9855718f6ba97a" dependencies = [ "console_error_panic_hook", "js-sys", @@ -7552,9 +7631,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3859815cf8435b92f3a34381bef950daffc1403bbb77ef99e35422a7b0abb194" +checksum = "3b561e538d0e87b844dd2ce4608581373854f19c4fa2c473570d9fa3797eeb56" dependencies = [ "proc-macro2", "quote", @@ -7577,9 +7656,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.52" +version = "0.3.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c70a82d842c9979078c772d4a1344685045f1a5628f677c2b2eab4dd7d2696" +checksum = "224b2f6b67919060055ef1a67807367c2066ed520c3862cc013d26cf893a783c" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 4b9a5b1b5..e5da9af38 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,12 +86,3 @@ members = [ "validator_client", "validator_client/slashing_protection", ] - -[patch] -[patch.crates-io] -tree_hash = { path = "consensus/tree_hash" } -tree_hash_derive = { path = "consensus/tree_hash_derive" } -eth2_ssz = { path = "consensus/ssz" } -eth2_ssz_derive = { path = "consensus/ssz_derive" } -eth2_ssz_types = { path = "consensus/ssz_types" } -eth2_hashing = { path = "crypto/eth2_hashing" } diff --git a/account_manager/Cargo.toml b/account_manager/Cargo.toml index 44c503146..d651c695f 100644 --- a/account_manager/Cargo.toml +++ b/account_manager/Cargo.toml @@ -15,8 +15,8 @@ dirs = "3.0.1" environment = { path = "../lighthouse/environment" } deposit_contract = { path = "../common/deposit_contract" } libc = "0.2.79" -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" hex = "0.4.2" rayon = "1.4.1" eth2_network_config = { path = "../common/eth2_network_config" } diff --git a/beacon_node/Cargo.toml b/beacon_node/Cargo.toml index c4d1a05ed..e441e473d 100644 --- a/beacon_node/Cargo.toml +++ b/beacon_node/Cargo.toml @@ -36,7 +36,7 @@ task_executor = { path = "../common/task_executor" } genesis = { path = "genesis" } eth2_network_config = { path = "../common/eth2_network_config" } eth2_libp2p = { path = "./eth2_libp2p" } -eth2_ssz = "0.1.2" +eth2_ssz = "0.3.0" serde = "1.0.116" clap_utils = { path = "../common/clap_utils" } hyper = "0.14.4" diff --git a/beacon_node/beacon_chain/Cargo.toml b/beacon_node/beacon_chain/Cargo.toml index 91127058f..6de43f88c 100644 --- a/beacon_node/beacon_chain/Cargo.toml +++ b/beacon_node/beacon_chain/Cargo.toml @@ -33,12 +33,12 @@ serde_json = "1.0.58" slog = { version = "2.5.2", features = ["max_level_trace"] } sloggers = "1.0.1" slot_clock = { path = "../../common/slot_clock" } -eth2_hashing = "0.1.0" -eth2_ssz = "0.1.2" -eth2_ssz_types = { path = "../../consensus/ssz_types" } -eth2_ssz_derive = "0.1.0" +eth2_hashing = "0.2.0" +eth2_ssz = "0.3.0" +eth2_ssz_types = "0.2.0" +eth2_ssz_derive = "0.2.1" state_processing = { path = "../../consensus/state_processing" } -tree_hash = "0.1.1" +tree_hash = "0.3.0" types = { path = "../../consensus/types" } tokio = "1.10.0" eth1 = { path = "../eth1" } diff --git a/beacon_node/client/Cargo.toml b/beacon_node/client/Cargo.toml index a62448d10..25d51e89e 100644 --- a/beacon_node/client/Cargo.toml +++ b/beacon_node/client/Cargo.toml @@ -17,7 +17,7 @@ eth2_libp2p = { path = "../eth2_libp2p" } parking_lot = "0.11.0" prometheus = "0.11.0" types = { path = "../../consensus/types" } -tree_hash = "0.1.1" +tree_hash = "0.3.0" eth2_config = { path = "../../common/eth2_config" } slot_clock = { path = "../../common/slot_clock" } serde = "1.0.116" @@ -35,7 +35,7 @@ eth1 = { path = "../eth1" } genesis = { path = "../genesis" } task_executor = { path = "../../common/task_executor" } environment = { path = "../../lighthouse/environment" } -eth2_ssz = "0.1.2" +eth2_ssz = "0.3.0" lazy_static = "1.4.0" lighthouse_metrics = { path = "../../common/lighthouse_metrics" } time = "0.2.22" diff --git a/beacon_node/eth1/Cargo.toml b/beacon_node/eth1/Cargo.toml index b05e9f3e2..ba05d1118 100644 --- a/beacon_node/eth1/Cargo.toml +++ b/beacon_node/eth1/Cargo.toml @@ -19,10 +19,10 @@ serde = { version = "1.0.116", features = ["derive"] } hex = "0.4.2" types = { path = "../../consensus/types"} merkle_proof = { path = "../../consensus/merkle_proof"} -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" -tree_hash = "0.1.1" -eth2_hashing = "0.1.0" +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" +tree_hash = "0.3.0" +eth2_hashing = "0.2.0" parking_lot = "0.11.0" slog = "2.5.2" tokio = { version = "1.10.0", features = ["full"] } diff --git a/beacon_node/eth2_libp2p/Cargo.toml b/beacon_node/eth2_libp2p/Cargo.toml index ac3eba1c6..d9a226b40 100644 --- a/beacon_node/eth2_libp2p/Cargo.toml +++ b/beacon_node/eth2_libp2p/Cargo.toml @@ -9,11 +9,11 @@ discv5 = { version = "0.1.0-beta.9", features = ["libp2p"] } unsigned-varint = { version = "0.6.0", features = ["codec"] } types = { path = "../../consensus/types" } hashset_delay = { path = "../../common/hashset_delay" } -eth2_ssz_types = { path = "../../consensus/ssz_types" } +eth2_ssz_types = "0.2.0" serde = { version = "1.0.116", features = ["derive"] } serde_derive = "1.0.116" -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" slog = { version = "2.5.2", features = ["max_level_trace"] } lighthouse_version = { path = "../../common/lighthouse_version" } tokio = { version = "1.10.0", features = ["time", "macros"] } diff --git a/beacon_node/genesis/Cargo.toml b/beacon_node/genesis/Cargo.toml index 7b5bfb1ee..3c97055f3 100644 --- a/beacon_node/genesis/Cargo.toml +++ b/beacon_node/genesis/Cargo.toml @@ -16,9 +16,9 @@ eth1 = { path = "../eth1"} rayon = "1.4.1" state_processing = { path = "../../consensus/state_processing" } merkle_proof = { path = "../../consensus/merkle_proof" } -eth2_ssz = "0.1.2" -eth2_hashing = "0.1.0" -tree_hash = "0.1.1" +eth2_ssz = "0.3.0" +eth2_hashing = "0.2.0" +tree_hash = "0.3.0" tokio = { version = "1.10.0", features = ["full"] } parking_lot = "0.11.0" slog = "2.5.2" diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index 98854e0af..1623cfa90 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -27,14 +27,14 @@ lighthouse_metrics = { path = "../../common/lighthouse_metrics" } lazy_static = "1.4.0" warp_utils = { path = "../../common/warp_utils" } slot_clock = { path = "../../common/slot_clock" } -eth2_ssz = { path = "../../consensus/ssz" } +eth2_ssz = "0.3.0" bs58 = "0.4.0" futures = "0.3.8" [dev-dependencies] store = { path = "../store" } environment = { path = "../../lighthouse/environment" } -tree_hash = "0.1.1" +tree_hash = "0.3.0" sensitive_url = { path = "../../common/sensitive_url" } [[test]] diff --git a/beacon_node/network/Cargo.toml b/beacon_node/network/Cargo.toml index e1483c939..6d97040bd 100644 --- a/beacon_node/network/Cargo.toml +++ b/beacon_node/network/Cargo.toml @@ -25,9 +25,9 @@ state_processing = { path = "../../consensus/state_processing" } slot_clock = { path = "../../common/slot_clock" } slog = { version = "2.5.2", features = ["max_level_trace"] } hex = "0.4.2" -eth2_ssz = "0.1.2" -eth2_ssz_types = { path = "../../consensus/ssz_types" } -tree_hash = "0.1.1" +eth2_ssz = "0.3.0" +eth2_ssz_types = "0.2.0" +tree_hash = "0.3.0" futures = "0.3.7" error-chain = "0.12.4" tokio = { version = "1.10.0", features = ["full"] } diff --git a/beacon_node/operation_pool/Cargo.toml b/beacon_node/operation_pool/Cargo.toml index 321159133..c90eba0ba 100644 --- a/beacon_node/operation_pool/Cargo.toml +++ b/beacon_node/operation_pool/Cargo.toml @@ -13,8 +13,8 @@ lighthouse_metrics = { path = "../../common/lighthouse_metrics" } parking_lot = "0.11.0" types = { path = "../../consensus/types" } state_processing = { path = "../../consensus/state_processing" } -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" rayon = "1.5.0" serde = "1.0.116" serde_derive = "1.0.116" diff --git a/beacon_node/store/Cargo.toml b/beacon_node/store/Cargo.toml index 19a1944a6..b906909a0 100644 --- a/beacon_node/store/Cargo.toml +++ b/beacon_node/store/Cargo.toml @@ -13,9 +13,9 @@ db-key = "0.0.5" leveldb = { version = "0.8.6", default-features = false } parking_lot = "0.11.0" itertools = "0.10.0" -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" -tree_hash = "0.1.1" +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" +tree_hash = "0.3.0" types = { path = "../../consensus/types" } state_processing = { path = "../../consensus/state_processing" } slog = "2.5.2" diff --git a/boot_node/Cargo.toml b/boot_node/Cargo.toml index 580e1e1ec..473645698 100644 --- a/boot_node/Cargo.toml +++ b/boot_node/Cargo.toml @@ -10,7 +10,7 @@ clap = "2.33.3" eth2_libp2p = { path = "../beacon_node/eth2_libp2p" } types = { path = "../consensus/types" } eth2_network_config = { path = "../common/eth2_network_config" } -eth2_ssz = "0.1.2" +eth2_ssz = "0.3.0" slog = "2.5.2" sloggers = "1.0.1" tokio = "1.10.0" diff --git a/common/clap_utils/Cargo.toml b/common/clap_utils/Cargo.toml index 561691715..3dfb3e5d2 100644 --- a/common/clap_utils/Cargo.toml +++ b/common/clap_utils/Cargo.toml @@ -12,4 +12,4 @@ hex = "0.4.2" dirs = "3.0.1" types = { path = "../../consensus/types" } eth2_network_config = { path = "../eth2_network_config" } -eth2_ssz = "0.1.2" +eth2_ssz = "0.3.0" diff --git a/common/deposit_contract/Cargo.toml b/common/deposit_contract/Cargo.toml index 6c27d1248..bd457e969 100644 --- a/common/deposit_contract/Cargo.toml +++ b/common/deposit_contract/Cargo.toml @@ -14,6 +14,6 @@ hex = "0.4.2" [dependencies] types = { path = "../../consensus/types"} -eth2_ssz = "0.1.2" -tree_hash = "0.1.1" +eth2_ssz = "0.3.0" +tree_hash = "0.3.0" ethabi = "12.0.0" diff --git a/common/eth2/Cargo.toml b/common/eth2/Cargo.toml index 7e6e12761..dcd21359d 100644 --- a/common/eth2/Cargo.toml +++ b/common/eth2/Cargo.toml @@ -14,7 +14,7 @@ hex = "0.4.2" reqwest = { version = "0.11.0", features = ["json","stream"] } eth2_libp2p = { path = "../../beacon_node/eth2_libp2p" } proto_array = { path = "../../consensus/proto_array", optional = true } -serde_utils = { path = "../../consensus/serde_utils" } +eth2_serde_utils = "0.1.0" zeroize = { version = "1.1.1", features = ["zeroize_derive"] } eth2_keystore = { path = "../../crypto/eth2_keystore" } libsecp256k1 = "0.6.0" @@ -22,8 +22,8 @@ ring = "0.16.19" bytes = "1.0.1" account_utils = { path = "../../common/account_utils" } sensitive_url = { path = "../../common/sensitive_url" } -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" futures-util = "0.3.8" futures = "0.3.8" diff --git a/common/eth2/src/lighthouse_vc/http_client.rs b/common/eth2/src/lighthouse_vc/http_client.rs index 5ed8374f1..16ecbf4af 100644 --- a/common/eth2/src/lighthouse_vc/http_client.rs +++ b/common/eth2/src/lighthouse_vc/http_client.rs @@ -36,7 +36,7 @@ pub fn parse_pubkey(secret: &str) -> Result { &secret[SECRET_PREFIX.len()..] }; - serde_utils::hex::decode(secret) + eth2_serde_utils::hex::decode(secret) .map_err(|e| Error::InvalidSecret(format!("invalid hex: {:?}", e))) .and_then(|bytes| { if bytes.len() != PK_LEN { @@ -101,7 +101,7 @@ impl ValidatorClientHttpClient { let message = Message::parse_slice(digest(&SHA256, &body).as_ref()).expect("sha256 is 32 bytes"); - serde_utils::hex::decode(&sig) + eth2_serde_utils::hex::decode(&sig) .ok() .and_then(|bytes| { let sig = Signature::parse_der(&bytes).ok()?; diff --git a/common/eth2/src/lighthouse_vc/types.rs b/common/eth2/src/lighthouse_vc/types.rs index 8994501c8..05ab74ccf 100644 --- a/common/eth2/src/lighthouse_vc/types.rs +++ b/common/eth2/src/lighthouse_vc/types.rs @@ -21,14 +21,14 @@ pub struct ValidatorRequest { #[serde(default)] #[serde(skip_serializing_if = "Option::is_none")] pub graffiti: Option, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub deposit_gwei: u64, } #[derive(Clone, PartialEq, Serialize, Deserialize)] pub struct CreateValidatorsMnemonicRequest { pub mnemonic: ZeroizeString, - #[serde(with = "serde_utils::quoted_u32")] + #[serde(with = "eth2_serde_utils::quoted_u32")] pub key_derivation_path_offset: u32, pub validators: Vec, } @@ -42,7 +42,7 @@ pub struct CreatedValidator { #[serde(skip_serializing_if = "Option::is_none")] pub graffiti: Option, pub eth1_deposit_tx_data: String, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub deposit_gwei: u64, } diff --git a/common/eth2/src/types.rs b/common/eth2/src/types.rs index 9a9f09ad6..6f583a395 100644 --- a/common/eth2/src/types.rs +++ b/common/eth2/src/types.rs @@ -77,10 +77,10 @@ impl std::fmt::Display for EndpointVersion { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct GenesisData { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub genesis_time: u64, pub genesis_validators_root: Hash256, - #[serde(with = "serde_utils::bytes_4_hex")] + #[serde(with = "eth2_serde_utils::bytes_4_hex")] pub genesis_fork_version: [u8; 4], } @@ -270,9 +270,9 @@ impl fmt::Display for ValidatorId { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ValidatorData { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub index: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub balance: u64, pub status: ValidatorStatus, pub validator: Validator, @@ -280,9 +280,9 @@ pub struct ValidatorData { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ValidatorBalanceData { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub index: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub balance: u64, } @@ -437,16 +437,16 @@ pub struct ValidatorsQuery { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct CommitteeData { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub index: u64, pub slot: Slot, - #[serde(with = "serde_utils::quoted_u64_vec")] + #[serde(with = "eth2_serde_utils::quoted_u64_vec")] pub validators: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct SyncCommitteeByValidatorIndices { - #[serde(with = "serde_utils::quoted_u64_vec")] + #[serde(with = "eth2_serde_utils::quoted_u64_vec")] pub validators: Vec, pub validator_aggregates: Vec, } @@ -454,7 +454,7 @@ pub struct SyncCommitteeByValidatorIndices { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(transparent)] pub struct SyncSubcommittee { - #[serde(with = "serde_utils::quoted_u64_vec")] + #[serde(with = "eth2_serde_utils::quoted_u64_vec")] pub indices: Vec, } @@ -479,7 +479,7 @@ pub struct BlockHeaderData { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct DepositContractData { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub chain_id: u64, pub address: Address, } @@ -501,7 +501,7 @@ pub struct IdentityData { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct MetaData { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub seq_number: u64, pub attnets: String, pub syncnets: String, @@ -546,20 +546,20 @@ pub struct ValidatorBalancesQuery { #[derive(Clone, Serialize, Deserialize)] #[serde(transparent)] -pub struct ValidatorIndexData(#[serde(with = "serde_utils::quoted_u64_vec")] pub Vec); +pub struct ValidatorIndexData(#[serde(with = "eth2_serde_utils::quoted_u64_vec")] pub Vec); #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct AttesterData { pub pubkey: PublicKeyBytes, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub validator_index: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub committees_at_slot: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub committee_index: CommitteeIndex, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub committee_length: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub validator_committee_index: u64, pub slot: Slot, } @@ -567,7 +567,7 @@ pub struct AttesterData { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ProposerData { pub pubkey: PublicKeyBytes, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub validator_index: u64, pub slot: Slot, } @@ -592,11 +592,11 @@ pub struct ValidatorAggregateAttestationQuery { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct BeaconCommitteeSubscription { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub validator_index: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub committee_index: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub committees_at_slot: u64, pub slot: Slot, pub is_aggregator: bool, @@ -714,13 +714,13 @@ impl fmt::Display for PeerDirection { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct PeerCount { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub connected: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub connecting: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub disconnected: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub disconnecting: u64, } @@ -752,7 +752,7 @@ pub struct SseHead { #[derive(PartialEq, Debug, Serialize, Deserialize, Clone)] pub struct SseChainReorg { pub slot: Slot, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub depth: u64, pub old_head_block: Hash256, pub old_head_state: Hash256, @@ -910,13 +910,13 @@ impl FromStr for Accept { #[derive(Debug, Serialize, Deserialize)] pub struct LivenessRequestData { pub epoch: Epoch, - #[serde(with = "serde_utils::quoted_u64_vec")] + #[serde(with = "eth2_serde_utils::quoted_u64_vec")] pub indices: Vec, } #[derive(PartialEq, Debug, Serialize, Deserialize)] pub struct LivenessResponseData { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub index: u64, pub epoch: Epoch, pub is_live: bool, diff --git a/common/eth2_interop_keypairs/Cargo.toml b/common/eth2_interop_keypairs/Cargo.toml index c451e068c..c23fe52fe 100644 --- a/common/eth2_interop_keypairs/Cargo.toml +++ b/common/eth2_interop_keypairs/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] lazy_static = "1.4.0" num-bigint = "0.3.0" -eth2_hashing = "0.1.0" +eth2_hashing = "0.2.0" hex = "0.4.2" serde_yaml = "0.8.13" serde = "1.0.116" diff --git a/common/eth2_network_config/Cargo.toml b/common/eth2_network_config/Cargo.toml index bab813d19..934a6b8bf 100644 --- a/common/eth2_network_config/Cargo.toml +++ b/common/eth2_network_config/Cargo.toml @@ -17,6 +17,6 @@ tempfile = "3.1.0" serde = "1.0.116" serde_yaml = "0.8.13" types = { path = "../../consensus/types"} -eth2_ssz = "0.1.2" +eth2_ssz = "0.3.0" eth2_config = { path = "../eth2_config"} enr = { version = "0.5.1", features = ["ed25519", "k256"] } diff --git a/common/validator_dir/Cargo.toml b/common/validator_dir/Cargo.toml index eb6a4e9e4..25078c15a 100644 --- a/common/validator_dir/Cargo.toml +++ b/common/validator_dir/Cargo.toml @@ -17,7 +17,7 @@ types = { path = "../../consensus/types" } rand = "0.7.3" deposit_contract = { path = "../deposit_contract" } rayon = "1.4.1" -tree_hash = "0.1.1" +tree_hash = "0.3.0" slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] } hex = "0.4.2" derivative = "2.1.1" diff --git a/consensus/cached_tree_hash/Cargo.toml b/consensus/cached_tree_hash/Cargo.toml index 0e5505b01..9af5c2a15 100644 --- a/consensus/cached_tree_hash/Cargo.toml +++ b/consensus/cached_tree_hash/Cargo.toml @@ -6,11 +6,11 @@ edition = "2018" [dependencies] ethereum-types = "0.11.0" -eth2_ssz_types = { path = "../ssz_types" } -eth2_hashing = "0.1.0" -eth2_ssz_derive = "0.1.0" -eth2_ssz = "0.1.2" -tree_hash = "0.1.1" +eth2_ssz_types = "0.2.0" +eth2_hashing = "0.2.0" +eth2_ssz_derive = "0.2.1" +eth2_ssz = "0.3.0" +tree_hash = "0.3.0" smallvec = "1.6.1" [dev-dependencies] diff --git a/consensus/fork_choice/Cargo.toml b/consensus/fork_choice/Cargo.toml index a5724bc1a..7fbbe8276 100644 --- a/consensus/fork_choice/Cargo.toml +++ b/consensus/fork_choice/Cargo.toml @@ -9,13 +9,13 @@ edition = "2018" [dependencies] types = { path = "../types" } proto_array = { path = "../proto_array" } -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" [dev-dependencies] state_processing = { path = "../../consensus/state_processing" } beacon_chain = { path = "../../beacon_node/beacon_chain" } store = { path = "../../beacon_node/store" } -tree_hash = "0.1.1" +tree_hash = "0.3.0" slot_clock = { path = "../../common/slot_clock" } hex = "0.4.2" diff --git a/consensus/merkle_proof/Cargo.toml b/consensus/merkle_proof/Cargo.toml index 580c8891e..11fdbb5c5 100644 --- a/consensus/merkle_proof/Cargo.toml +++ b/consensus/merkle_proof/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] ethereum-types = "0.11.0" -eth2_hashing = "0.1.0" +eth2_hashing = "0.2.0" lazy_static = "1.4.0" safe_arith = { path = "../safe_arith" } diff --git a/consensus/proto_array/Cargo.toml b/consensus/proto_array/Cargo.toml index 111f24a3b..2cd3e0037 100644 --- a/consensus/proto_array/Cargo.toml +++ b/consensus/proto_array/Cargo.toml @@ -10,8 +10,8 @@ path = "src/bin.rs" [dependencies] types = { path = "../types" } -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" serde = "1.0.116" serde_derive = "1.0.116" serde_yaml = "0.8.13" diff --git a/consensus/serde_utils/Cargo.toml b/consensus/serde_utils/Cargo.toml index 060179846..2cda517a6 100644 --- a/consensus/serde_utils/Cargo.toml +++ b/consensus/serde_utils/Cargo.toml @@ -1,8 +1,10 @@ [package] -name = "serde_utils" +name = "eth2_serde_utils" version = "0.1.0" authors = ["Paul Hauner "] edition = "2018" +description = "Serialization and deserialization utilities useful for JSON representations of Ethereum 2.0 types." +license = "Apache-2.0" [dependencies] serde = { version = "1.0.116", features = ["derive"] } diff --git a/consensus/ssz/Cargo.toml b/consensus/ssz/Cargo.toml index 7ae2f069c..b7f4f542d 100644 --- a/consensus/ssz/Cargo.toml +++ b/consensus/ssz/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eth2_ssz" -version = "0.1.2" +version = "0.3.0" authors = ["Paul Hauner "] edition = "2018" description = "SimpleSerialize (SSZ) as used in Ethereum 2.0" @@ -10,7 +10,7 @@ license = "Apache-2.0" name = "ssz" [dev-dependencies] -eth2_ssz_derive = "0.1.0" +eth2_ssz_derive = "0.2.1" [dependencies] ethereum-types = "0.11.0" diff --git a/consensus/ssz_derive/Cargo.toml b/consensus/ssz_derive/Cargo.toml index fb0de111c..9112fe87b 100644 --- a/consensus/ssz_derive/Cargo.toml +++ b/consensus/ssz_derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eth2_ssz_derive" -version = "0.1.0" +version = "0.2.1" authors = ["Paul Hauner "] edition = "2018" description = "Procedural derive macros to accompany the eth2_ssz crate." diff --git a/consensus/ssz_types/Cargo.toml b/consensus/ssz_types/Cargo.toml index 39d085b66..4a5ed171c 100644 --- a/consensus/ssz_types/Cargo.toml +++ b/consensus/ssz_types/Cargo.toml @@ -3,19 +3,21 @@ name = "eth2_ssz_types" version = "0.2.0" authors = ["Paul Hauner "] edition = "2018" +description = "Provides types with unique properties required for SSZ serialization and Merklization." +license = "Apache-2.0" [lib] name = "ssz_types" [dependencies] -tree_hash = "0.1.1" +tree_hash = "0.3.0" serde = "1.0.116" serde_derive = "1.0.116" -serde_utils = { path = "../serde_utils" } -eth2_ssz = "0.1.2" +eth2_serde_utils = "0.1.0" +eth2_ssz = "0.3.0" typenum = "1.12.0" arbitrary = { version = "0.4.6", features = ["derive"], optional = true } [dev-dependencies] serde_json = "1.0.58" -tree_hash_derive = "0.2.0" +tree_hash_derive = "0.3.1" diff --git a/consensus/ssz_types/src/bitfield.rs b/consensus/ssz_types/src/bitfield.rs index 71a240168..f0fb8a9fd 100644 --- a/consensus/ssz_types/src/bitfield.rs +++ b/consensus/ssz_types/src/bitfield.rs @@ -1,9 +1,9 @@ use crate::tree_hash::bitfield_bytes_tree_hash_root; use crate::Error; use core::marker::PhantomData; +use eth2_serde_utils::hex::{encode as hex_encode, PrefixedHexVisitor}; use serde::de::{Deserialize, Deserializer}; use serde::ser::{Serialize, Serializer}; -use serde_utils::hex::{encode as hex_encode, PrefixedHexVisitor}; use ssz::{Decode, Encode}; use tree_hash::Hash256; use typenum::Unsigned; diff --git a/consensus/ssz_types/src/serde_utils/quoted_u64_fixed_vec.rs b/consensus/ssz_types/src/serde_utils/quoted_u64_fixed_vec.rs index 8d6ee4f1b..0eb265adc 100644 --- a/consensus/ssz_types/src/serde_utils/quoted_u64_fixed_vec.rs +++ b/consensus/ssz_types/src/serde_utils/quoted_u64_fixed_vec.rs @@ -6,9 +6,9 @@ use crate::serde_utils::quoted_u64_var_list::deserialize_max; use crate::FixedVector; +use eth2_serde_utils::quoted_u64_vec::QuotedIntWrapper; use serde::ser::SerializeSeq; use serde::{Deserializer, Serializer}; -use serde_utils::quoted_u64_vec::QuotedIntWrapper; use std::marker::PhantomData; use typenum::Unsigned; diff --git a/consensus/ssz_types/src/serde_utils/quoted_u64_var_list.rs b/consensus/ssz_types/src/serde_utils/quoted_u64_var_list.rs index b39bf62a9..9e176b635 100644 --- a/consensus/ssz_types/src/serde_utils/quoted_u64_var_list.rs +++ b/consensus/ssz_types/src/serde_utils/quoted_u64_var_list.rs @@ -5,9 +5,9 @@ //! Quotes can be optional during decoding. If the length of the `Vec` is greater than `N`, deserialization fails. use crate::VariableList; +use eth2_serde_utils::quoted_u64_vec::QuotedIntWrapper; use serde::ser::SerializeSeq; use serde::{Deserializer, Serializer}; -use serde_utils::quoted_u64_vec::QuotedIntWrapper; use std::marker::PhantomData; use typenum::Unsigned; diff --git a/consensus/state_processing/Cargo.toml b/consensus/state_processing/Cargo.toml index 989316be6..88e7f5069 100644 --- a/consensus/state_processing/Cargo.toml +++ b/consensus/state_processing/Cargo.toml @@ -16,16 +16,16 @@ beacon_chain = { path = "../../beacon_node/beacon_chain" } bls = { path = "../../crypto/bls" } integer-sqrt = "0.1.5" itertools = "0.10.0" -eth2_ssz = "0.1.2" -eth2_ssz_types = { path = "../ssz_types" } +eth2_ssz = "0.3.0" +eth2_ssz_types = "0.2.0" merkle_proof = { path = "../merkle_proof" } log = "0.4.11" safe_arith = { path = "../safe_arith" } -tree_hash = "0.1.1" -tree_hash_derive = "0.2.0" +tree_hash = "0.3.0" +tree_hash_derive = "0.3.1" types = { path = "../types", default-features = false } rayon = "1.4.1" -eth2_hashing = "0.1.0" +eth2_hashing = "0.2.0" int_to_bytes = { path = "../int_to_bytes" } smallvec = "1.6.1" arbitrary = { version = "0.4.6", features = ["derive"], optional = true } diff --git a/consensus/swap_or_not_shuffle/Cargo.toml b/consensus/swap_or_not_shuffle/Cargo.toml index af4ab922b..3086c491f 100644 --- a/consensus/swap_or_not_shuffle/Cargo.toml +++ b/consensus/swap_or_not_shuffle/Cargo.toml @@ -12,7 +12,7 @@ harness = false criterion = "0.3.3" [dependencies] -eth2_hashing = "0.1.0" +eth2_hashing = "0.2.0" ethereum-types = "0.11.0" [features] diff --git a/consensus/tree_hash/Cargo.toml b/consensus/tree_hash/Cargo.toml index 80a9bfd54..8cb34314d 100644 --- a/consensus/tree_hash/Cargo.toml +++ b/consensus/tree_hash/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tree_hash" -version = "0.1.1" +version = "0.3.0" authors = ["Paul Hauner "] edition = "2018" license = "Apache-2.0" @@ -8,14 +8,14 @@ description = "Efficient Merkle-hashing as used in Ethereum 2.0" [dev-dependencies] rand = "0.7.3" -tree_hash_derive = "0.2.0" +tree_hash_derive = "0.3.1" types = { path = "../types" } lazy_static = "1.4.0" beacon_chain = { path = "../../beacon_node/beacon_chain" } [dependencies] ethereum-types = "0.11.0" -eth2_hashing = "0.1.0" +eth2_hashing = "0.2.0" smallvec = "1.6.1" [features] diff --git a/consensus/tree_hash_derive/Cargo.toml b/consensus/tree_hash_derive/Cargo.toml index 10c743cb3..cb88c92f9 100644 --- a/consensus/tree_hash_derive/Cargo.toml +++ b/consensus/tree_hash_derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tree_hash_derive" -version = "0.2.0" +version = "0.3.1" authors = ["Paul Hauner "] edition = "2018" description = "Procedural derive macros to accompany the tree_hash crate." diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index 1b2a838eb..f539c60c3 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -14,7 +14,7 @@ compare_fields = { path = "../../common/compare_fields" } compare_fields_derive = { path = "../../common/compare_fields_derive" } eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" } ethereum-types = "0.11.0" -eth2_hashing = "0.1.0" +eth2_hashing = "0.2.0" hex = "0.4.2" int_to_bytes = { path = "../int_to_bytes" } log = "0.4.11" @@ -25,13 +25,13 @@ safe_arith = { path = "../safe_arith" } serde = {version = "1.0.116" , features = ["rc"] } serde_derive = "1.0.116" slog = "2.5.2" -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" -eth2_ssz_types = { path = "../ssz_types" } +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" +eth2_ssz_types = "0.2.0" swap_or_not_shuffle = { path = "../swap_or_not_shuffle" } test_random_derive = { path = "../../common/test_random_derive" } -tree_hash = "0.1.1" -tree_hash_derive = "0.2.0" +tree_hash = "0.3.0" +tree_hash_derive = "0.3.1" rand_xorshift = "0.2.0" cached_tree_hash = { path = "../cached_tree_hash" } serde_yaml = "0.8.13" @@ -39,7 +39,7 @@ tempfile = "3.1.0" derivative = "2.1.1" rusqlite = { version = "0.25.3", features = ["bundled"], optional = true } arbitrary = { version = "0.4.6", features = ["derive"], optional = true } -serde_utils = { path = "../serde_utils" } +eth2_serde_utils = "0.1.0" regex = "1.3.9" lazy_static = "1.4.0" parking_lot = "0.11.1" diff --git a/consensus/types/src/aggregate_and_proof.rs b/consensus/types/src/aggregate_and_proof.rs index 528712261..19c8f8a0a 100644 --- a/consensus/types/src/aggregate_and_proof.rs +++ b/consensus/types/src/aggregate_and_proof.rs @@ -16,7 +16,7 @@ use tree_hash_derive::TreeHash; #[serde(bound = "T: EthSpec")] pub struct AggregateAndProof { /// The index of the validator that created the attestation. - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub aggregator_index: u64, /// The aggregate attestation. pub aggregate: Attestation, diff --git a/consensus/types/src/attestation_data.rs b/consensus/types/src/attestation_data.rs index 3eee735f7..8792a3c56 100644 --- a/consensus/types/src/attestation_data.rs +++ b/consensus/types/src/attestation_data.rs @@ -27,7 +27,7 @@ use tree_hash_derive::TreeHash; )] pub struct AttestationData { pub slot: Slot, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub index: u64, // LMD GHOST vote diff --git a/consensus/types/src/attestation_duty.rs b/consensus/types/src/attestation_duty.rs index 613d7fd1c..ecfa613ed 100644 --- a/consensus/types/src/attestation_duty.rs +++ b/consensus/types/src/attestation_duty.rs @@ -13,6 +13,6 @@ pub struct AttestationDuty { /// The total number of attesters in the committee. pub committee_len: usize, /// The committee count at `attestation_slot`. - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub committees_at_slot: u64, } diff --git a/consensus/types/src/beacon_block.rs b/consensus/types/src/beacon_block.rs index 962e75cc2..74bdfe44d 100644 --- a/consensus/types/src/beacon_block.rs +++ b/consensus/types/src/beacon_block.rs @@ -40,7 +40,7 @@ pub struct BeaconBlock { #[superstruct(getter(copy))] pub slot: Slot, #[superstruct(getter(copy))] - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub proposer_index: u64, #[superstruct(getter(copy))] pub parent_root: Hash256, diff --git a/consensus/types/src/beacon_block_header.rs b/consensus/types/src/beacon_block_header.rs index 64fbaef86..cca8fef84 100644 --- a/consensus/types/src/beacon_block_header.rs +++ b/consensus/types/src/beacon_block_header.rs @@ -16,7 +16,7 @@ use tree_hash_derive::TreeHash; )] pub struct BeaconBlockHeader { pub slot: Slot, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub proposer_index: u64, pub parent_root: Hash256, pub state_root: Hash256, diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index e62d53a1a..a78b6130c 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -198,7 +198,7 @@ where { // Versioning #[superstruct(getter(copy))] - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub genesis_time: u64, #[superstruct(getter(copy))] pub genesis_validators_root: Hash256, @@ -219,7 +219,7 @@ where pub eth1_data: Eth1Data, pub eth1_data_votes: VariableList, #[superstruct(getter(copy))] - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub eth1_deposit_index: u64, // Registry diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index dfa8775b2..7c0c348fd 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -1,7 +1,7 @@ use crate::*; +use eth2_serde_utils::quoted_u64::MaybeQuoted; use int_to_bytes::int_to_bytes4; use serde_derive::{Deserialize, Serialize}; -use serde_utils::quoted_u64::MaybeQuoted; use std::fs::File; use std::path::Path; use tree_hash::TreeHash; @@ -533,44 +533,44 @@ pub struct Config { #[serde(default)] pub preset_base: String, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] min_genesis_active_validator_count: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] min_genesis_time: u64, - #[serde(with = "serde_utils::bytes_4_hex")] + #[serde(with = "eth2_serde_utils::bytes_4_hex")] genesis_fork_version: [u8; 4], - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] genesis_delay: u64, - #[serde(with = "serde_utils::bytes_4_hex")] + #[serde(with = "eth2_serde_utils::bytes_4_hex")] altair_fork_version: [u8; 4], altair_fork_epoch: Option>, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] seconds_per_slot: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] seconds_per_eth1_block: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] min_validator_withdrawability_delay: Epoch, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] shard_committee_period: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] eth1_follow_distance: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] inactivity_score_bias: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] inactivity_score_recovery_rate: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] ejection_balance: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] min_per_epoch_churn_limit: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] churn_limit_quotient: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] deposit_chain_id: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] deposit_network_id: u64, deposit_contract_address: Address, } diff --git a/consensus/types/src/contribution_and_proof.rs b/consensus/types/src/contribution_and_proof.rs index e5371f469..855e36bc9 100644 --- a/consensus/types/src/contribution_and_proof.rs +++ b/consensus/types/src/contribution_and_proof.rs @@ -14,7 +14,7 @@ use tree_hash_derive::TreeHash; #[serde(bound = "T: EthSpec")] pub struct ContributionAndProof { /// The index of the validator that created the sync contribution. - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub aggregator_index: u64, /// The aggregate contribution. pub contribution: SyncCommitteeContribution, diff --git a/consensus/types/src/deposit_data.rs b/consensus/types/src/deposit_data.rs index ac2bdd13d..d984f168f 100644 --- a/consensus/types/src/deposit_data.rs +++ b/consensus/types/src/deposit_data.rs @@ -15,7 +15,7 @@ use tree_hash_derive::TreeHash; pub struct DepositData { pub pubkey: PublicKeyBytes, pub withdrawal_credentials: Hash256, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub amount: u64, pub signature: SignatureBytes, } diff --git a/consensus/types/src/deposit_message.rs b/consensus/types/src/deposit_message.rs index 92f6b66bf..d1f245bc9 100644 --- a/consensus/types/src/deposit_message.rs +++ b/consensus/types/src/deposit_message.rs @@ -15,7 +15,7 @@ use tree_hash_derive::TreeHash; pub struct DepositMessage { pub pubkey: PublicKeyBytes, pub withdrawal_credentials: Hash256, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub amount: u64, } diff --git a/consensus/types/src/enr_fork_id.rs b/consensus/types/src/enr_fork_id.rs index 008b7933f..0fe929a1e 100644 --- a/consensus/types/src/enr_fork_id.rs +++ b/consensus/types/src/enr_fork_id.rs @@ -15,9 +15,9 @@ use tree_hash_derive::TreeHash; Debug, Clone, PartialEq, Default, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom, )] pub struct EnrForkId { - #[serde(with = "serde_utils::bytes_4_hex")] + #[serde(with = "eth2_serde_utils::bytes_4_hex")] pub fork_digest: [u8; 4], - #[serde(with = "serde_utils::bytes_4_hex")] + #[serde(with = "eth2_serde_utils::bytes_4_hex")] pub next_fork_version: [u8; 4], pub next_fork_epoch: Epoch, } diff --git a/consensus/types/src/eth1_data.rs b/consensus/types/src/eth1_data.rs index e3b74cc49..4fd7d3373 100644 --- a/consensus/types/src/eth1_data.rs +++ b/consensus/types/src/eth1_data.rs @@ -26,7 +26,7 @@ use tree_hash_derive::TreeHash; )] pub struct Eth1Data { pub deposit_root: Hash256, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub deposit_count: u64, pub block_hash: Hash256, } diff --git a/consensus/types/src/fork.rs b/consensus/types/src/fork.rs index b129271ba..44b8a1663 100644 --- a/consensus/types/src/fork.rs +++ b/consensus/types/src/fork.rs @@ -24,9 +24,9 @@ use tree_hash_derive::TreeHash; TestRandom, )] pub struct Fork { - #[serde(with = "serde_utils::bytes_4_hex")] + #[serde(with = "eth2_serde_utils::bytes_4_hex")] pub previous_version: [u8; 4], - #[serde(with = "serde_utils::bytes_4_hex")] + #[serde(with = "eth2_serde_utils::bytes_4_hex")] pub current_version: [u8; 4], pub epoch: Epoch, } diff --git a/consensus/types/src/fork_data.rs b/consensus/types/src/fork_data.rs index 092102f77..be13f71e4 100644 --- a/consensus/types/src/fork_data.rs +++ b/consensus/types/src/fork_data.rs @@ -14,7 +14,7 @@ use tree_hash_derive::TreeHash; Debug, Clone, PartialEq, Default, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom, )] pub struct ForkData { - #[serde(with = "serde_utils::bytes_4_hex")] + #[serde(with = "eth2_serde_utils::bytes_4_hex")] pub current_version: [u8; 4], pub genesis_validators_root: Hash256, } diff --git a/consensus/types/src/free_attestation.rs b/consensus/types/src/free_attestation.rs index 79bc149e4..81a778d84 100644 --- a/consensus/types/src/free_attestation.rs +++ b/consensus/types/src/free_attestation.rs @@ -9,6 +9,6 @@ use serde_derive::Serialize; pub struct FreeAttestation { pub data: AttestationData, pub signature: Signature, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub validator_index: u64, } diff --git a/consensus/types/src/graffiti.rs b/consensus/types/src/graffiti.rs index af7ea9b13..cecd6c201 100644 --- a/consensus/types/src/graffiti.rs +++ b/consensus/types/src/graffiti.rs @@ -27,7 +27,7 @@ impl Graffiti { impl fmt::Display for Graffiti { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", serde_utils::hex::encode(&self.0)) + write!(f, "{}", eth2_serde_utils::hex::encode(&self.0)) } } @@ -96,7 +96,7 @@ pub mod serde_graffiti { where S: Serializer, { - serializer.serialize_str(&serde_utils::hex::encode(bytes)) + serializer.serialize_str(ð2_serde_utils::hex::encode(bytes)) } pub fn deserialize<'de, D>(deserializer: D) -> Result<[u8; GRAFFITI_BYTES_LEN], D::Error> @@ -105,7 +105,7 @@ pub mod serde_graffiti { { let s: String = Deserialize::deserialize(deserializer)?; - let bytes = serde_utils::hex::decode(&s).map_err(D::Error::custom)?; + let bytes = eth2_serde_utils::hex::decode(&s).map_err(D::Error::custom)?; if bytes.len() != GRAFFITI_BYTES_LEN { return Err(D::Error::custom(format!( diff --git a/consensus/types/src/indexed_attestation.rs b/consensus/types/src/indexed_attestation.rs index a1976853b..32271cfa9 100644 --- a/consensus/types/src/indexed_attestation.rs +++ b/consensus/types/src/indexed_attestation.rs @@ -63,9 +63,9 @@ impl Hash for IndexedAttestation { mod quoted_variable_list_u64 { use super::*; use crate::Unsigned; + use eth2_serde_utils::quoted_u64_vec::{QuotedIntVecVisitor, QuotedIntWrapper}; use serde::ser::SerializeSeq; use serde::{Deserializer, Serializer}; - use serde_utils::quoted_u64_vec::{QuotedIntVecVisitor, QuotedIntWrapper}; pub fn serialize(value: &VariableList, serializer: S) -> Result where diff --git a/consensus/types/src/pending_attestation.rs b/consensus/types/src/pending_attestation.rs index f4b0fd9b1..df6f47955 100644 --- a/consensus/types/src/pending_attestation.rs +++ b/consensus/types/src/pending_attestation.rs @@ -13,9 +13,9 @@ use tree_hash_derive::TreeHash; pub struct PendingAttestation { pub aggregation_bits: BitList, pub data: AttestationData, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub inclusion_delay: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub proposer_index: u64, } diff --git a/consensus/types/src/preset.rs b/consensus/types/src/preset.rs index fcb550b81..030c12340 100644 --- a/consensus/types/src/preset.rs +++ b/consensus/types/src/preset.rs @@ -12,71 +12,71 @@ use serde_derive::{Deserialize, Serialize}; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] #[serde(rename_all = "UPPERCASE")] pub struct BasePreset { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub max_committees_per_slot: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub target_committee_size: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub max_validators_per_committee: u64, - #[serde(with = "serde_utils::quoted_u8")] + #[serde(with = "eth2_serde_utils::quoted_u8")] pub shuffle_round_count: u8, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub hysteresis_quotient: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub hysteresis_downward_multiplier: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub hysteresis_upward_multiplier: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub safe_slots_to_update_justified: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub min_deposit_amount: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub max_effective_balance: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub effective_balance_increment: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub min_attestation_inclusion_delay: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub slots_per_epoch: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub min_seed_lookahead: Epoch, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub max_seed_lookahead: Epoch, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub epochs_per_eth1_voting_period: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub slots_per_historical_root: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub min_epochs_to_inactivity_penalty: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub epochs_per_historical_vector: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub epochs_per_slashings_vector: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub historical_roots_limit: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub validator_registry_limit: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub base_reward_factor: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub whistleblower_reward_quotient: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub proposer_reward_quotient: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub inactivity_penalty_quotient: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub min_slashing_penalty_quotient: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub proportional_slashing_multiplier: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub max_proposer_slashings: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub max_attester_slashings: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub max_attestations: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub max_deposits: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub max_voluntary_exits: u64, } @@ -123,17 +123,17 @@ impl BasePreset { #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] #[serde(rename_all = "UPPERCASE")] pub struct AltairPreset { - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub inactivity_penalty_quotient_altair: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub min_slashing_penalty_quotient_altair: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub proportional_slashing_multiplier_altair: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub sync_committee_size: u64, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub epochs_per_sync_committee_period: Epoch, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub min_sync_committee_participants: u64, } diff --git a/consensus/types/src/slot_epoch.rs b/consensus/types/src/slot_epoch.rs index 3a4060acc..e68055d34 100644 --- a/consensus/types/src/slot_epoch.rs +++ b/consensus/types/src/slot_epoch.rs @@ -27,12 +27,12 @@ use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, Sub, SubAssi #[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))] #[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] #[serde(transparent)] -pub struct Slot(#[serde(with = "serde_utils::quoted_u64")] u64); +pub struct Slot(#[serde(with = "eth2_serde_utils::quoted_u64")] u64); #[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))] #[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] #[serde(transparent)] -pub struct Epoch(#[serde(with = "serde_utils::quoted_u64")] u64); +pub struct Epoch(#[serde(with = "eth2_serde_utils::quoted_u64")] u64); impl_common!(Slot); impl_common!(Epoch); diff --git a/consensus/types/src/subnet_id.rs b/consensus/types/src/subnet_id.rs index 8bdcdb1c3..046ed8f33 100644 --- a/consensus/types/src/subnet_id.rs +++ b/consensus/types/src/subnet_id.rs @@ -20,7 +20,7 @@ lazy_static! { #[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(transparent)] -pub struct SubnetId(#[serde(with = "serde_utils::quoted_u64")] u64); +pub struct SubnetId(#[serde(with = "eth2_serde_utils::quoted_u64")] u64); pub fn subnet_id_to_string(i: u64) -> &'static str { if i < MAX_SUBNET_ID as u64 { diff --git a/consensus/types/src/sync_committee_contribution.rs b/consensus/types/src/sync_committee_contribution.rs index ae92df672..c79ceb92f 100644 --- a/consensus/types/src/sync_committee_contribution.rs +++ b/consensus/types/src/sync_committee_contribution.rs @@ -21,7 +21,7 @@ pub enum Error { pub struct SyncCommitteeContribution { pub slot: Slot, pub beacon_block_root: Hash256, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub subcommittee_index: u64, pub aggregation_bits: BitVector, pub signature: AggregateSignature, diff --git a/consensus/types/src/sync_committee_message.rs b/consensus/types/src/sync_committee_message.rs index 7a2f7193f..21dfd9c28 100644 --- a/consensus/types/src/sync_committee_message.rs +++ b/consensus/types/src/sync_committee_message.rs @@ -13,7 +13,7 @@ use tree_hash_derive::TreeHash; pub struct SyncCommitteeMessage { pub slot: Slot, pub beacon_block_root: Hash256, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub validator_index: u64, // Signature by the validator over `beacon_block_root`. pub signature: Signature, diff --git a/consensus/types/src/sync_duty.rs b/consensus/types/src/sync_duty.rs index e3ffe62bf..bdb078459 100644 --- a/consensus/types/src/sync_duty.rs +++ b/consensus/types/src/sync_duty.rs @@ -7,9 +7,9 @@ use std::collections::HashSet; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct SyncDuty { pub pubkey: PublicKeyBytes, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub validator_index: u64, - #[serde(with = "serde_utils::quoted_u64_vec")] + #[serde(with = "eth2_serde_utils::quoted_u64_vec")] pub validator_sync_committee_indices: Vec, } diff --git a/consensus/types/src/sync_subnet_id.rs b/consensus/types/src/sync_subnet_id.rs index b15e49ed9..9babe3239 100644 --- a/consensus/types/src/sync_subnet_id.rs +++ b/consensus/types/src/sync_subnet_id.rs @@ -22,7 +22,7 @@ lazy_static! { #[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(transparent)] -pub struct SyncSubnetId(#[serde(with = "serde_utils::quoted_u64")] u64); +pub struct SyncSubnetId(#[serde(with = "eth2_serde_utils::quoted_u64")] u64); pub fn sync_subnet_id_to_string(i: u64) -> &'static str { if i < SYNC_COMMITTEE_SUBNET_COUNT { diff --git a/consensus/types/src/validator.rs b/consensus/types/src/validator.rs index b27bc90e3..21a6b39b6 100644 --- a/consensus/types/src/validator.rs +++ b/consensus/types/src/validator.rs @@ -14,7 +14,7 @@ use tree_hash_derive::TreeHash; pub struct Validator { pub pubkey: PublicKeyBytes, pub withdrawal_credentials: Hash256, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub effective_balance: u64, pub slashed: bool, pub activation_eligibility_epoch: Epoch, diff --git a/consensus/types/src/voluntary_exit.rs b/consensus/types/src/voluntary_exit.rs index c33ea7e79..66d2f0094 100644 --- a/consensus/types/src/voluntary_exit.rs +++ b/consensus/types/src/voluntary_exit.rs @@ -16,7 +16,7 @@ use tree_hash_derive::TreeHash; pub struct VoluntaryExit { /// Earliest epoch when voluntary exit can be processed. pub epoch: Epoch, - #[serde(with = "serde_utils::quoted_u64")] + #[serde(with = "eth2_serde_utils::quoted_u64")] pub validator_index: u64, } diff --git a/crypto/bls/Cargo.toml b/crypto/bls/Cargo.toml index 163f5c802..92d1f530b 100644 --- a/crypto/bls/Cargo.toml +++ b/crypto/bls/Cargo.toml @@ -5,15 +5,15 @@ authors = ["Paul Hauner "] edition = "2018" [dependencies] -eth2_ssz = "0.1.2" -tree_hash = "0.1.1" +eth2_ssz = "0.3.0" +tree_hash = "0.3.0" milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.4.2", optional = true } rand = "0.7.3" serde = "1.0.116" serde_derive = "1.0.116" -serde_utils = { path = "../../consensus/serde_utils" } +eth2_serde_utils = "0.1.0" hex = "0.4.2" -eth2_hashing = "0.1.0" +eth2_hashing = "0.2.0" ethereum-types = "0.11.0" arbitrary = { version = "0.4.6", features = ["derive"], optional = true } zeroize = { version = "1.1.1", features = ["zeroize_derive"] } diff --git a/crypto/bls/src/generic_aggregate_signature.rs b/crypto/bls/src/generic_aggregate_signature.rs index ecffc22bc..5db81f04d 100644 --- a/crypto/bls/src/generic_aggregate_signature.rs +++ b/crypto/bls/src/generic_aggregate_signature.rs @@ -4,9 +4,9 @@ use crate::{ generic_signature::{GenericSignature, TSignature}, Error, Hash256, INFINITY_SIGNATURE, SIGNATURE_BYTES_LEN, }; +use eth2_serde_utils::hex::encode as hex_encode; use serde::de::{Deserialize, Deserializer}; use serde::ser::{Serialize, Serializer}; -use serde_utils::hex::encode as hex_encode; use ssz::{Decode, Encode}; use std::fmt; use std::marker::PhantomData; diff --git a/crypto/bls/src/generic_public_key.rs b/crypto/bls/src/generic_public_key.rs index 0976f5c82..d3c004787 100644 --- a/crypto/bls/src/generic_public_key.rs +++ b/crypto/bls/src/generic_public_key.rs @@ -1,8 +1,8 @@ use crate::generic_public_key_bytes::GenericPublicKeyBytes; use crate::Error; +use eth2_serde_utils::hex::encode as hex_encode; use serde::de::{Deserialize, Deserializer}; use serde::ser::{Serialize, Serializer}; -use serde_utils::hex::encode as hex_encode; use ssz::{Decode, Encode}; use std::fmt; use std::hash::{Hash, Hasher}; diff --git a/crypto/bls/src/generic_public_key_bytes.rs b/crypto/bls/src/generic_public_key_bytes.rs index a60065bbc..e8d24f9d4 100644 --- a/crypto/bls/src/generic_public_key_bytes.rs +++ b/crypto/bls/src/generic_public_key_bytes.rs @@ -2,9 +2,9 @@ use crate::{ generic_public_key::{GenericPublicKey, TPublicKey}, Error, PUBLIC_KEY_BYTES_LEN, }; +use eth2_serde_utils::hex::encode as hex_encode; use serde::de::{Deserialize, Deserializer}; use serde::ser::{Serialize, Serializer}; -use serde_utils::hex::encode as hex_encode; use ssz::{Decode, Encode}; use std::convert::TryInto; use std::fmt; diff --git a/crypto/bls/src/generic_signature.rs b/crypto/bls/src/generic_signature.rs index cce17fd2f..a167da424 100644 --- a/crypto/bls/src/generic_signature.rs +++ b/crypto/bls/src/generic_signature.rs @@ -2,9 +2,9 @@ use crate::{ generic_public_key::{GenericPublicKey, TPublicKey}, Error, Hash256, }; +use eth2_serde_utils::hex::encode as hex_encode; use serde::de::{Deserialize, Deserializer}; use serde::ser::{Serialize, Serializer}; -use serde_utils::hex::encode as hex_encode; use ssz::{Decode, Encode}; use std::fmt; use std::marker::PhantomData; diff --git a/crypto/bls/src/generic_signature_bytes.rs b/crypto/bls/src/generic_signature_bytes.rs index bc7e7f111..c6edece9e 100644 --- a/crypto/bls/src/generic_signature_bytes.rs +++ b/crypto/bls/src/generic_signature_bytes.rs @@ -3,9 +3,9 @@ use crate::{ generic_signature::{GenericSignature, TSignature}, Error, INFINITY_SIGNATURE, SIGNATURE_BYTES_LEN, }; +use eth2_serde_utils::hex::encode as hex_encode; use serde::de::{Deserialize, Deserializer}; use serde::ser::{Serialize, Serializer}; -use serde_utils::hex::encode as hex_encode; use ssz::{Decode, Encode}; use std::convert::TryInto; use std::fmt; diff --git a/crypto/eth2_hashing/Cargo.toml b/crypto/eth2_hashing/Cargo.toml index 2e29f69d8..1eeaff54b 100644 --- a/crypto/eth2_hashing/Cargo.toml +++ b/crypto/eth2_hashing/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eth2_hashing" -version = "0.1.1" +version = "0.2.0" authors = ["Paul Hauner "] edition = "2018" license = "Apache-2.0" diff --git a/crypto/eth2_keystore/Cargo.toml b/crypto/eth2_keystore/Cargo.toml index 865c528a5..b064798c5 100644 --- a/crypto/eth2_keystore/Cargo.toml +++ b/crypto/eth2_keystore/Cargo.toml @@ -18,7 +18,7 @@ serde = "1.0.116" serde_repr = "0.1.6" hex = "0.4.2" bls = { path = "../bls" } -eth2_ssz = "0.1.2" +eth2_ssz = "0.3.0" serde_json = "1.0.58" eth2_key_derivation = { path = "../eth2_key_derivation" } unicode-normalization = "0.1.16" diff --git a/lcli/Cargo.toml b/lcli/Cargo.toml index f9ccfbebc..1e172e2ca 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -18,7 +18,7 @@ serde_yaml = "0.8.13" simple_logger = "1.10.0" types = { path = "../consensus/types" } state_processing = { path = "../consensus/state_processing" } -eth2_ssz = "0.1.2" +eth2_ssz = "0.3.0" regex = "1.3.9" futures = "0.3.7" environment = { path = "../lighthouse/environment" } @@ -26,7 +26,7 @@ eth2_network_config = { path = "../common/eth2_network_config" } dirs = "3.0.1" genesis = { path = "../beacon_node/genesis" } deposit_contract = { path = "../common/deposit_contract" } -tree_hash = "0.1.1" +tree_hash = "0.3.0" tokio = { version = "1.10.0", features = ["full"] } clap_utils = { path = "../common/clap_utils" } eth2_libp2p = { path = "../beacon_node/eth2_libp2p" } diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index 7d8662277..108e4e6de 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -24,7 +24,7 @@ slog = { version = "2.5.2", features = ["max_level_trace"] } sloggers = "1.0.1" types = { "path" = "../consensus/types" } bls = { path = "../crypto/bls" } -eth2_hashing = "0.1.0" +eth2_hashing = "0.2.0" clap = "2.33.3" env_logger = "0.9.0" logging = { path = "../common/logging" } diff --git a/scripts/ci/publish.sh b/scripts/ci/publish.sh new file mode 100755 index 000000000..bd146a639 --- /dev/null +++ b/scripts/ci/publish.sh @@ -0,0 +1,109 @@ +#!/usr/bin/env bash + +# Based on: https://github.com/tokio-rs/tokio/blob/master/bin/publish + +set -e +USAGE="Publish a new release of a lighthouse crate +USAGE: + $(basename "$0") [OPTIONS] [CRATE_PATH] [CRATE] [TAG] +OPTIONS: + -v, --verbose Use verbose Cargo output + -d, --dry-run Perform a dry run (do not publish the release) + -h, --help Show this help text and exit + --allow-dirty Allow dirty working directories to be packaged" + +DRY_RUN="" +DIRTY="" +VERBOSE="" + +verify() { + echo "Verifying if $CRATE v$VERSION can be released" + + # `cargo pkgid` has different formats based on whether the `[lib]` name and `[package]` name + # are the same, necessitating the following logic. + # + # Try to match on `#` + ACTUAL=$(cargo pkgid | sed -n 's/.*#\([0-9]\)/\1/p' ) + if [ -z "$ACTUAL" ]; then + # Match on the final `:` + ACTUAL=$(cargo pkgid | sed -n 's/.*:\(.*\)/\1/p') + fi + + if [ "$ACTUAL" != "$VERSION" ]; then + echo "expected to release version $VERSION, but Cargo.toml contained $ACTUAL" + exit 1 + fi +} + +release() { + echo "Releasing $CRATE v$VERSION" + cargo package $VERBOSE $DIRTY + cargo publish $VERBOSE $DRY_RUN $DIRTY +} + +while [[ $# -gt 0 ]] +do + +case "$1" in + -h|--help) + echo "$USAGE" + exit 0 + ;; + -v|--verbose) + VERBOSE="--verbose" + set +x + shift + ;; + --allow-dirty) + DIRTY="--allow-dirty" + shift + ;; + -d|--dry-run) + DRY_RUN="--dry-run" + shift + ;; + -*) + echo "unknown flag \"$1\"" + echo "$USAGE" + exit 1 + ;; + *) # crate, crate path, or version + if [ -z "$CRATE_PATH" ]; then + CRATE_PATH="$1" + elif [ -z "$CRATE" ]; then + CRATE="$1" + elif [ -z "$TAG" ]; then + TAG="$1" + VERSION=$(sed -e 's#.*-v\([0-9]\)#\1#' <<< "$TAG") + else + echo "unknown positional argument \"$1\"" + echo "$USAGE" + exit 1 + fi + shift + ;; +esac +done +# set -- "${POSITIONAL[@]}" + +if [ -z "$VERSION" ]; then + echo "no version specified!" + HELP=1 +fi + +if [ -z "$CRATE" ]; then + echo "no crate specified!" + HELP=1 +fi + +if [ -n "$HELP" ]; then + echo "$USAGE" + exit 1 +fi + +if [ -d "$CRATE_PATH" ]; then + (cd "$CRATE_PATH" && verify && release ) +else + echo "no such dir \"$CRATE_PATH\"" + exit 1 +fi diff --git a/slasher/Cargo.toml b/slasher/Cargo.toml index 4d165b5a3..ebb858a17 100644 --- a/slasher/Cargo.toml +++ b/slasher/Cargo.toml @@ -7,8 +7,8 @@ edition = "2018" [dependencies] bincode = "1.3.1" byteorder = "1.3.4" -eth2_ssz = { path = "../consensus/ssz" } -eth2_ssz_derive = { path = "../consensus/ssz_derive" } +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" flate2 = { version = "1.0.14", features = ["zlib"], default-features = false } lazy_static = "1.4.0" lighthouse_metrics = { path = "../common/lighthouse_metrics" } @@ -22,8 +22,8 @@ serde = "1.0" serde_derive = "1.0" slog = "2.5.2" sloggers = "*" -tree_hash = { path = "../consensus/tree_hash" } -tree_hash_derive = { path = "../consensus/tree_hash_derive" } +tree_hash = "0.3.0" +tree_hash_derive = "0.3.1" types = { path = "../consensus/types" } [dev-dependencies] diff --git a/testing/ef_tests/Cargo.toml b/testing/ef_tests/Cargo.toml index 193a9120b..9123fcf34 100644 --- a/testing/ef_tests/Cargo.toml +++ b/testing/ef_tests/Cargo.toml @@ -22,10 +22,10 @@ serde = "1.0.116" serde_derive = "1.0.116" serde_repr = "0.1.6" serde_yaml = "0.8.13" -eth2_ssz = "0.1.2" -eth2_ssz_derive = "0.1.0" -tree_hash = "0.1.1" -tree_hash_derive = "0.2.0" +eth2_ssz = "0.3.0" +eth2_ssz_derive = "0.2.1" +tree_hash = "0.3.0" +tree_hash_derive = "0.3.1" cached_tree_hash = { path = "../../consensus/cached_tree_hash" } state_processing = { path = "../../consensus/state_processing" } swap_or_not_shuffle = { path = "../../consensus/swap_or_not_shuffle" } diff --git a/testing/state_transition_vectors/Cargo.toml b/testing/state_transition_vectors/Cargo.toml index 2fd5e9102..08154e473 100644 --- a/testing/state_transition_vectors/Cargo.toml +++ b/testing/state_transition_vectors/Cargo.toml @@ -9,6 +9,6 @@ edition = "2018" [dependencies] state_processing = { path = "../../consensus/state_processing" } types = { path = "../../consensus/types" } -eth2_ssz = "0.1.2" +eth2_ssz = "0.3.0" beacon_chain = { path = "../../beacon_node/beacon_chain" } lazy_static = "1.4.0" diff --git a/validator_client/Cargo.toml b/validator_client/Cargo.toml index b82b60682..7bc049824 100644 --- a/validator_client/Cargo.toml +++ b/validator_client/Cargo.toml @@ -13,9 +13,9 @@ tokio = { version = "1.10.0", features = ["time", "rt-multi-thread", "macros"] } deposit_contract = { path = "../common/deposit_contract" } [dependencies] -eth2_ssz = "0.1.2" +eth2_ssz = "0.3.0" eth2_config = { path = "../common/eth2_config" } -tree_hash = "0.1.1" +tree_hash = "0.3.0" clap = "2.33.3" eth2_interop_keypairs = { path = "../common/eth2_interop_keypairs" } slashing_protection = { path = "./slashing_protection" } @@ -41,7 +41,7 @@ parking_lot = "0.11.0" exit-future = "0.2.0" filesystem = { path = "../common/filesystem" } libc = "0.2.79" -eth2_ssz_derive = "0.1.0" +eth2_ssz_derive = "0.2.1" hex = "0.4.2" deposit_contract = { path = "../common/deposit_contract" } bls = { path = "../crypto/bls" } @@ -56,7 +56,7 @@ lighthouse_version = { path = "../common/lighthouse_version" } warp_utils = { path = "../common/warp_utils" } warp = { git = "https://github.com/paulhauner/warp ", branch = "cors-wildcard" } hyper = "0.14.4" -serde_utils = { path = "../consensus/serde_utils" } +eth2_serde_utils = "0.1.0" libsecp256k1 = "0.6.0" ring = "0.16.19" rand = "0.7.3" diff --git a/validator_client/slashing_protection/Cargo.toml b/validator_client/slashing_protection/Cargo.toml index 62fc7fc19..04c21cbcb 100644 --- a/validator_client/slashing_protection/Cargo.toml +++ b/validator_client/slashing_protection/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] tempfile = "3.1.0" types = { path = "../../consensus/types" } -tree_hash = "0.1.1" +tree_hash = "0.3.0" rusqlite = { version = "0.25.3", features = ["bundled"] } r2d2 = "0.8.9" r2d2_sqlite = "0.18.0" @@ -15,7 +15,7 @@ parking_lot = "0.11.0" serde = "1.0.116" serde_derive = "1.0.116" serde_json = "1.0.58" -serde_utils = { path = "../../consensus/serde_utils" } +eth2_serde_utils = "0.1.0" filesystem = { path = "../../common/filesystem" } [dev-dependencies] diff --git a/validator_client/slashing_protection/src/interchange.rs b/validator_client/slashing_protection/src/interchange.rs index faddd788e..0d8d0869f 100644 --- a/validator_client/slashing_protection/src/interchange.rs +++ b/validator_client/slashing_protection/src/interchange.rs @@ -8,7 +8,7 @@ use types::{Epoch, Hash256, PublicKeyBytes, Slot}; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct InterchangeMetadata { - #[serde(with = "serde_utils::quoted_u64::require_quotes")] + #[serde(with = "eth2_serde_utils::quoted_u64::require_quotes")] pub interchange_format_version: u64, pub genesis_validators_root: Hash256, } @@ -24,7 +24,7 @@ pub struct InterchangeData { #[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct SignedBlock { - #[serde(with = "serde_utils::quoted_u64::require_quotes")] + #[serde(with = "eth2_serde_utils::quoted_u64::require_quotes")] pub slot: Slot, #[serde(skip_serializing_if = "Option::is_none")] pub signing_root: Option, @@ -33,9 +33,9 @@ pub struct SignedBlock { #[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct SignedAttestation { - #[serde(with = "serde_utils::quoted_u64::require_quotes")] + #[serde(with = "eth2_serde_utils::quoted_u64::require_quotes")] pub source_epoch: Epoch, - #[serde(with = "serde_utils::quoted_u64::require_quotes")] + #[serde(with = "eth2_serde_utils::quoted_u64::require_quotes")] pub target_epoch: Epoch, #[serde(skip_serializing_if = "Option::is_none")] pub signing_root: Option, diff --git a/validator_client/src/beacon_node_fallback.rs b/validator_client/src/beacon_node_fallback.rs index 0616eb2f4..153e88028 100644 --- a/validator_client/src/beacon_node_fallback.rs +++ b/validator_client/src/beacon_node_fallback.rs @@ -355,7 +355,7 @@ impl BeaconNodeFallback { // status of nodes that were previously not-synced. if candidate.status(RequireSynced::Yes).await.is_err() { // There exists a race-condition that could result in `refresh_status` being called - // when the status does not require refreshing anymore. This deemed is an + // when the status does not require refreshing anymore. This is deemed an // acceptable inefficiency. futures.push(candidate.refresh_status( self.slot_clock.as_ref(), diff --git a/validator_client/src/http_api/api_secret.rs b/validator_client/src/http_api/api_secret.rs index f75a048be..53a907848 100644 --- a/validator_client/src/http_api/api_secret.rs +++ b/validator_client/src/http_api/api_secret.rs @@ -57,7 +57,7 @@ impl ApiSecret { fs::write( &sk_path, - serde_utils::hex::encode(&sk.serialize()).as_bytes(), + eth2_serde_utils::hex::encode(&sk.serialize()).as_bytes(), ) .map_err(|e| e.to_string())?; fs::write( @@ -65,7 +65,7 @@ impl ApiSecret { format!( "{}{}", PK_PREFIX, - serde_utils::hex::encode(&pk.serialize_compressed()[..]) + eth2_serde_utils::hex::encode(&pk.serialize_compressed()[..]) ) .as_bytes(), ) @@ -75,7 +75,7 @@ impl ApiSecret { let sk = fs::read(&sk_path) .map_err(|e| format!("cannot read {}: {}", SK_FILENAME, e)) .and_then(|bytes| { - serde_utils::hex::decode(&String::from_utf8_lossy(&bytes)) + eth2_serde_utils::hex::decode(&String::from_utf8_lossy(&bytes)) .map_err(|_| format!("{} should be 0x-prefixed hex", PK_FILENAME)) }) .and_then(|bytes| { @@ -99,7 +99,7 @@ impl ApiSecret { let hex = String::from_utf8(bytes).map_err(|_| format!("{} is not utf8", SK_FILENAME))?; if let Some(stripped) = hex.strip_prefix(PK_PREFIX) { - serde_utils::hex::decode(stripped) + eth2_serde_utils::hex::decode(stripped) .map_err(|_| format!("{} should be 0x-prefixed hex", SK_FILENAME)) } else { Err(format!("unable to parse {}", SK_FILENAME)) @@ -138,7 +138,7 @@ impl ApiSecret { /// Returns the public key of `self` as a 0x-prefixed hex string. fn pubkey_string(&self) -> String { - serde_utils::hex::encode(&self.pk.serialize_compressed()[..]) + eth2_serde_utils::hex::encode(&self.pk.serialize_compressed()[..]) } /// Returns the API token. @@ -178,7 +178,7 @@ impl ApiSecret { let message = Message::parse_slice(digest(&SHA256, input).as_ref()).expect("sha256 is 32 bytes"); let (signature, _) = libsecp256k1::sign(&message, &sk); - serde_utils::hex::encode(signature.serialize_der().as_ref()) + eth2_serde_utils::hex::encode(signature.serialize_der().as_ref()) } } } diff --git a/validator_client/src/http_api/create_validator.rs b/validator_client/src/http_api/create_validator.rs index 30625d9f4..c2b50c864 100644 --- a/validator_client/src/http_api/create_validator.rs +++ b/validator_client/src/http_api/create_validator.rs @@ -152,7 +152,7 @@ pub async fn create_validators, T: 'static + SlotClock, E: EthSpe description: request.description.clone(), graffiti: request.graffiti.clone(), voting_pubkey, - eth1_deposit_tx_data: serde_utils::hex::encode(ð1_deposit_data.rlp), + eth1_deposit_tx_data: eth2_serde_utils::hex::encode(ð1_deposit_data.rlp), deposit_gwei: request.deposit_gwei, }); } diff --git a/validator_client/src/http_api/tests.rs b/validator_client/src/http_api/tests.rs index f77225805..ebb011671 100644 --- a/validator_client/src/http_api/tests.rs +++ b/validator_client/src/http_api/tests.rs @@ -334,7 +334,7 @@ impl ApiTester { let withdrawal_keypair = keypairs.withdrawal.decrypt_keypair(PASSWORD_BYTES).unwrap(); let deposit_bytes = - serde_utils::hex::decode(&response[i].eth1_deposit_tx_data).unwrap(); + eth2_serde_utils::hex::decode(&response[i].eth1_deposit_tx_data).unwrap(); let (deposit_data, _) = decode_eth1_tx_data(&deposit_bytes, E::default_spec().max_effective_balance)