mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-10 04:51:22 +00:00
36bd4d87f0
## Issue Addressed Closes #1504 Closes #1505 Replaces #1703 Closes #1707 ## Proposed Changes * Update BLST and Milagro to versions compatible with BLSv4 spec * Update Lighthouse to spec v1.0.0-rc.0, and update EF test vectors * Use the v1.0.0 constants for `MainnetEthSpec`. * Rename `InteropEthSpec` -> `V012LegacyEthSpec` * Change all constants to suit the mainnet `v0.12.3` specification (i.e., Medalla). * Deprecate the `--spec` flag for the `lighthouse` binary * This value is now obtained from the `config_name` field of the `YamlConfig`. * Built in testnet YAML files have been updated. * Ignore the `--spec` value, if supplied, log a warning that it will be deprecated * `lcli` still has the spec flag, that's fine because it's dev tooling. * Remove the `E: EthSpec` from `YamlConfig` * This means we need to deser the genesis `BeaconState` on-demand, but this is fine. * Swap the old "minimal", "mainnet" strings over to the new `EthSpecId` enum. * Always require a `CONFIG_NAME` field in `YamlConfig` (it used to have a default). ## Additional Info Lots of breaking changes, do not merge! ~~We will likely need a Lighthouse v0.4.0 branch, and possibly a long-term v0.3.0 branch to keep Medalla alive~~. Co-authored-by: Kirk Baird <baird.k@outlook.com> Co-authored-by: Paul Hauner <paul@paulhauner.com>
45 lines
1.3 KiB
Rust
45 lines
1.3 KiB
Rust
#![cfg(test)]
|
|
|
|
use environment::EnvironmentBuilder;
|
|
use eth2_testnet_config::Eth2TestnetConfig;
|
|
use std::path::PathBuf;
|
|
use types::{V012LegacyEthSpec, YamlConfig};
|
|
|
|
fn builder() -> EnvironmentBuilder<V012LegacyEthSpec> {
|
|
EnvironmentBuilder::v012_legacy()
|
|
.single_thread_tokio_runtime()
|
|
.expect("should set runtime")
|
|
.null_logger()
|
|
.expect("should set logger")
|
|
}
|
|
|
|
fn eth2_testnet_config() -> Option<Eth2TestnetConfig> {
|
|
Eth2TestnetConfig::hard_coded_default().expect("should decode hard_coded params")
|
|
}
|
|
|
|
mod setup_eth2_config {
|
|
use super::*;
|
|
|
|
#[test]
|
|
fn update_spec_with_yaml_config() {
|
|
if let Some(mut eth2_testnet_config) = eth2_testnet_config() {
|
|
let config_yaml = PathBuf::from("./tests/testnet_dir/config.yaml");
|
|
|
|
eth2_testnet_config.yaml_config = Some(
|
|
YamlConfig::from_file(config_yaml.as_path()).expect("should load yaml config"),
|
|
);
|
|
|
|
let environment = builder()
|
|
.eth2_testnet_config(eth2_testnet_config)
|
|
.expect("should setup eth2_config")
|
|
.build()
|
|
.expect("should build environment");
|
|
|
|
assert_eq!(
|
|
environment.eth2_config.spec.max_committees_per_slot,
|
|
128 // see testnet_dir/config.yaml
|
|
);
|
|
}
|
|
}
|
|
}
|