Skip to content

Commit

Permalink
Squerge in #1335
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 9d9b357
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 24 10:40:06 2020 +1000

    Address clippy lints

commit 1e60f79
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 24 09:10:18 2020 +1000

    Rename SecretHash -> ZeroizeHash

commit 85ed2ae
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 24 09:01:01 2020 +1000

    Add "secure" to random keygen comments

commit f69f2b4
Merge: af9e63e 23a8f31
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 24 08:56:48 2020 +1000

    Merge branch 'master' into multi-bls

commit af9e63e
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 20 16:33:44 2020 +1000

    Fix bls features

commit 0ae278a
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 20 16:26:09 2020 +1000

    Rename to AggregateSignature::infinity

commit 43b9ac6
Merge: 8f06c0e b885d79
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 20 15:53:24 2020 +1000

    Merge branch 'master' into multi-bls

commit 8f06c0e
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 20 15:50:12 2020 +1000

    Add milagro to ef_tests

commit 6324d21
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 20 14:31:40 2020 +1000

    Remove opt-level restriction

commit acd4184
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 20 14:21:17 2020 +1000

    Add test comments

commit 54fa3fd
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 20 14:20:08 2020 +1000

    Add signature set testing

commit 30094a6
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 20 11:52:08 2020 +1000

    Remove `GenericAggregatePublicKey`

commit d4ef68f
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 20 11:34:33 2020 +1000

    Fix ssz round trip issue with agg sig

commit 6c7b5e1
Author: Paul Hauner <[email protected]>
Date:   Sun Jul 19 18:14:27 2020 +1000

    Improve tests, add TODO to unsafe code

commit d6df596
Author: Paul Hauner <[email protected]>
Date:   Sun Jul 19 17:44:55 2020 +1000

    Change how blst and milagro get infinity keys

commit d44723d
Author: Paul Hauner <[email protected]>
Date:   Sun Jul 19 17:36:13 2020 +1000

    Remove unnecessary casts

commit ad2b3f8
Author: Paul Hauner <[email protected]>
Date:   Sun Jul 19 17:24:28 2020 +1000

    Fix zero/infinity mixup

commit 8105af8
Author: Paul Hauner <[email protected]>
Date:   Sun Jul 19 16:43:29 2020 +1000

    Add some partial eq tests

commit 8eb77e0
Author: Paul Hauner <[email protected]>
Date:   Sun Jul 19 16:32:13 2020 +1000

    Add more comments, tests

commit 2e08dd8
Author: Paul Hauner <[email protected]>
Date:   Sun Jul 19 16:25:29 2020 +1000

    Add more testing

commit 872e5e3
Author: Paul Hauner <[email protected]>
Date:   Sat Jul 18 17:00:22 2020 +1000

    Start adding tests

commit c8717bd
Author: Paul Hauner <[email protected]>
Date:   Sat Jul 18 15:15:58 2020 +1000

    Add special-case for infinity point

commit 7387542
Author: Paul Hauner <[email protected]>
Date:   Sat Jul 18 15:15:29 2020 +1000

    Fix cargo.toml git mistake

commit 044f740
Author: Paul Hauner <[email protected]>
Date:   Sat Jul 18 14:25:19 2020 +1000

    Fix supranational typo

commit 717cb51
Author: Paul Hauner <[email protected]>
Date:   Sat Jul 18 14:23:06 2020 +1000

    Remove build.rs

commit abb81a4
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 16:18:13 2020 +1000

    Loose Eq constraints

commit b7daf5e
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 16:18:04 2020 +1000

    Update BLS library target

commit d33d84f
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 16:06:35 2020 +1000

    Refactor blst signature set verification

commit fb28192
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 15:35:12 2020 +1000

    Export generic structs

commit 4432051
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 15:28:02 2020 +1000

    Shift around impls mod

commit cd465f8
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 15:25:13 2020 +1000

    Rename generic files, fix some missed structs

commit e6409f9
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 15:18:19 2020 +1000

    Fix clippy errors

commit 4a56954
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 15:07:35 2020 +1000

    Finish adding Generic prefix

commit 9e765f2
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 15:00:15 2020 +1000

    Start adding Generic prefix

commit 55e2a98
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 14:40:23 2020 +1000

    Fix random secret key gen for BLST

commit ef209aa
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 14:18:22 2020 +1000

    Remove legacy key upgrading

commit f749a18
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 14:11:06 2020 +1000

    Remove some unused functions

commit 1b57083
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 13:51:36 2020 +1000

    Fix double 0x serialization

commit 55d50bc
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 13:42:14 2020 +1000

    Add comments, tidy

commit ad92f1c
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 11:45:38 2020 +1000

    Add more comments

commit daaac86
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 11:30:34 2020 +1000

    Start tidying, adding comments

commit 5f662b9
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 10:34:03 2020 +1000

    Fix test compile error

commit d298c8e
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 10:28:21 2020 +1000

    Swap from format! to to_hex_string

commit 7575623
Merge: 8085a35 fc5e6cb
Author: Paul Hauner <[email protected]>
Date:   Fri Jul 17 10:03:47 2020 +1000

    Merge branch 'master' into multi-bls

commit 8085a35
Author: Paul Hauner <[email protected]>
Date:   Thu Jul 16 17:20:03 2020 +1000

    Update main docs

commit 1dc4bf5
Author: Paul Hauner <[email protected]>
Date:   Thu Jul 16 16:21:55 2020 +1000

    Update Cargo.lock

commit 5682ce7
Merge: 1e8862b 4a01f44
Author: Paul Hauner <[email protected]>
Date:   Thu Jul 16 16:09:42 2020 +1000

    Merge branch 'master' into multi-bls

commit 1e8862b
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 17:17:32 2020 +1000

    Update cargo.lock

commit f7e68a8
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 17:17:11 2020 +1000

    Use supranational by defualt

commit 974986f
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 17:16:58 2020 +1000

    Switch to sigp blst repo

commit 7a08ddf
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 17:16:31 2020 +1000

    Small cosmetic changes

commit af35587
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 17:16:06 2020 +1000

    Change profile version

commit 2805cd8
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 13:03:11 2020 +1000

    Fix blst agg sig zero

commit 304cee3
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 12:46:54 2020 +1000

    Add zero support to blst agg sig

commit a98229e
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 12:46:41 2020 +1000

    Check for empty lists

commit 7c72eba
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 11:57:29 2020 +1000

    Reduce code duplication

commit 4d0a90e
Author: Paul Hauner <[email protected]>
Date:   Wed Jul 8 11:53:27 2020 +1000

    Add partial eq, clone to blst

commit 241e648
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 18:34:04 2020 +1000

    Start integrating blst

commit cab9b60
Merge: b47a0d7 f500b24
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 17:25:20 2020 +1000

    Merge branch 'master' into multi-bls

commit b47a0d7
Merge: 413d4c8 5977c00
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 17:06:06 2020 +1000

    Merge branch 'master' into multi-bls

commit 413d4c8
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 17:03:50 2020 +1000

    Remove commented-out code

commit 2616ab4
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 17:03:13 2020 +1000

    Remove keypair serialization

commit d44d37e
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 17:01:38 2020 +1000

    Fix some failing tests

commit 609b024
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 16:34:09 2020 +1000

    Integrate into tests

commit f0657e5
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 15:52:53 2020 +1000

    Update fake-crypto, features

commit 28ba558
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 13:02:39 2020 +1000

    Fix some failing ef_tests

commit 8886ca3
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 11:21:15 2020 +1000

    Fix secret key byte len issue

commit 2239f3c
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 10:36:32 2020 +1000

    Make ef tests pass

commit a05ccc1
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 10:18:13 2020 +1000

    Allow for compile up to ef_tests

commit fa749d0
Author: Paul Hauner <[email protected]>
Date:   Tue Jul 7 09:54:47 2020 +1000

    Add progress towards compilation

commit ad52e96
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 6 19:01:12 2020 +1000

    Add aggregates to bls

commit 614cd17
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 6 16:39:16 2020 +1000

    Add progress on fast_agg_verify

commit 158c44a
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 6 16:07:33 2020 +1000

    Add progress on ef_tests

commit bddc83a
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 6 15:11:06 2020 +1000

    Fix `lighthouse` binary compile errors

commit cc57bd4
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 6 14:21:50 2020 +1000

    Add progress on integration

commit 9e25d66
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 6 12:16:20 2020 +1000

    Fix eth2_keystore compile errors

commit 12d0995
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 6 11:25:38 2020 +1000

    Make `bls` compile, start integration

commit 7cd13a3
Merge: 7b2b698 536728b
Author: Paul Hauner <[email protected]>
Date:   Mon Jul 6 10:03:21 2020 +1000

    Merge branch 'master' into multi-bls

commit 7b2b698
Author: Paul Hauner <[email protected]>
Date:   Fri Jun 26 08:50:53 2020 +1000

    Start reviving bls-refactor branch
  • Loading branch information
paulhauner committed Jul 25, 2020
1 parent c065c52 commit b472495
Show file tree
Hide file tree
Showing 117 changed files with 2,988 additions and 2,442 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- uses: actions/checkout@v1
- name: Get latest version of stable Rust
run: rustup update stable
- name: Run eth2.0-spec-tests with and without fake_crypto
- name: Run eth2.0-spec-tests with blst, milagro and fake_crypto
run: make test-ef
dockerfile-ubuntu:
name: dockerfile-ubuntu
Expand Down
30 changes: 26 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ check-benches:
run-ef-tests:
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests"
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests,fake_crypto"
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests,milagro"

# Runs only the tests/state_transition_vectors tests.
run-state-transition-tests:
Expand Down
2 changes: 1 addition & 1 deletion account_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ clap_utils = { path = "../common/clap_utils" }
eth2_wallet = { path = "../crypto/eth2_wallet" }
eth2_wallet_manager = { path = "../common/eth2_wallet_manager" }
rand = "0.7.2"
validator_dir = { path = "../common/validator_dir", features = ["unencrypted_keys"] }
validator_dir = { path = "../common/validator_dir" }
tokio = { version = "0.2.21", features = ["full"] }
eth2_keystore = { path = "../crypto/eth2_keystore" }
account_utils = { path = "../common/account_utils" }
3 changes: 0 additions & 3 deletions account_manager/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
mod common;
pub mod upgrade_legacy_keypairs;
pub mod validator;
pub mod wallet;

Expand All @@ -19,15 +18,13 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.about("Utilities for generating and managing Ethereum 2.0 accounts.")
.subcommand(wallet::cli_app())
.subcommand(validator::cli_app())
.subcommand(upgrade_legacy_keypairs::cli_app())
}

/// Run the account manager, returning an error if the operation did not succeed.
pub fn run<T: EthSpec>(matches: &ArgMatches<'_>, env: Environment<T>) -> Result<(), String> {
match matches.subcommand() {
(wallet::CMD, Some(matches)) => wallet::cli_run(matches)?,
(validator::CMD, Some(matches)) => validator::cli_run(matches, env)?,
(upgrade_legacy_keypairs::CMD, Some(matches)) => upgrade_legacy_keypairs::cli_run(matches)?,
(unknown, _) => {
return Err(format!(
"{} is not a valid {} command. See --help.",
Expand Down
149 changes: 0 additions & 149 deletions account_manager/src/upgrade_legacy_keypairs.rs

This file was deleted.

3 changes: 3 additions & 0 deletions beacon_node/beacon_chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ default = ["participation_metrics"]
write_ssz_files = [] # Writes debugging .ssz files to /tmp during block processing.
participation_metrics = [] # Exposes validator participation metrics to Prometheus.

[dev-dependencies]
int_to_bytes = { path = "../../consensus/int_to_bytes" }

[dependencies]
eth2_config = { path = "../../common/eth2_config" }
merkle_proof = { path = "../../consensus/merkle_proof" }
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/attestation_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ pub fn verify_attestation_signature<T: BeaconChainTypes>(
let _signature_verification_timer =
metrics::start_timer(&metrics::ATTESTATION_PROCESSING_SIGNATURE_TIMES);

if signature_set.is_valid() {
if signature_set.verify() {
Ok(())
} else {
Err(Error::InvalidSignature)
Expand Down Expand Up @@ -589,7 +589,7 @@ pub fn verify_signed_aggregate_signatures<T: BeaconChainTypes>(
.map_err(BeaconChainError::SignatureSetError)?,
];

Ok(verify_signature_sets(signature_sets))
Ok(verify_signature_sets(signature_sets.iter()))
}

/// Assists in readability.
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
root: target_root,
},
},
signature: AggregateSignature::empty_signature(),
signature: AggregateSignature::empty(),
})
}

Expand Down Expand Up @@ -1654,7 +1654,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
},
},
// The block is not signed here, that is the task of a validator client.
signature: Signature::empty_signature(),
signature: Signature::empty(),
};

per_block_processing(
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ fn genesis_block<T: EthSpec>(
message: BeaconBlock::empty(&spec),
// Empty signature, which should NEVER be read. This isn't to-spec, but makes the genesis
// block consistent with every other block.
signature: Signature::empty_signature(),
signature: Signature::empty(),
};
genesis_block.message.state_root = genesis_state
.update_tree_hash_cache()
Expand Down
3 changes: 1 addition & 2 deletions beacon_node/beacon_chain/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::observed_attesters::Error as ObservedAttestersError;
use crate::observed_block_producers::Error as ObservedBlockProducersError;
use operation_pool::OpPoolError;
use safe_arith::ArithError;
use ssz::DecodeError;
use ssz_types::Error as SszTypesError;
use state_processing::{
block_signature_verifier::Error as BlockSignatureVerifierError,
Expand Down Expand Up @@ -69,7 +68,7 @@ pub enum BeaconChainError {
AttestationCacheLockTimeout,
ValidatorPubkeyCacheLockTimeout,
IncorrectStateForAttestation(RelativeEpochError),
InvalidValidatorPubkeyBytes(DecodeError),
InvalidValidatorPubkeyBytes(bls::Error),
ValidatorPubkeyCacheIncomplete(usize),
SignatureSetError(SignatureSetError),
BlockSignatureVerifierError(state_processing::block_signature_verifier::Error),
Expand Down
6 changes: 4 additions & 2 deletions beacon_node/beacon_chain/src/snapshot_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ mod test {
use super::*;
use types::{
test_utils::{generate_deterministic_keypair, TestingBeaconStateBuilder},
BeaconBlock, Epoch, MainnetEthSpec, Signature, SignedBeaconBlock, Slot,
BeaconBlock, Epoch, MainnetEthSpec, SignedBeaconBlock, Slot,
};

const CACHE_SIZE: usize = 4;
Expand All @@ -115,7 +115,9 @@ mod test {
beacon_state_root: Hash256::from_low_u64_be(i),
beacon_block: SignedBeaconBlock {
message: BeaconBlock::empty(&spec),
signature: Signature::new(&[42], &generate_deterministic_keypair(0).sk),
signature: generate_deterministic_keypair(0)
.sk
.sign(Hash256::from_low_u64_be(42)),
},
beacon_block_root: Hash256::from_low_u64_be(i),
}
Expand Down
Loading

0 comments on commit b472495

Please sign in to comment.