diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e15d54d7e94d9496cf78d84bc02063e08635e3f..5fa20cb22b7a5918672e568c73e17609af6b8350 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,6 +26,7 @@ test-rust-stable: script: - ./scripts/init.sh - ./scripts/build.sh + - cd yamltests && ./scripts/run.sh - time cargo test --all --release --locked - sccache -s only: diff --git a/beacon/src/executive/mod.rs b/beacon/src/executive/mod.rs index 99ce140b6f12d7ab9080687a4a037e5f492468dc..ad7a5202dc9758f3904a7e8e362e68245ce0478d 100644 --- a/beacon/src/executive/mod.rs +++ b/beacon/src/executive/mod.rs @@ -43,10 +43,6 @@ pub struct Executive<'state, 'config, C: Config> { pub enum Strategy { /// The normal execution strategy Full, - /// Execution without verifying the state root - IgnoreStateRoot, - /// Execution without verifying the state root, and without randao - IgnoreRandaoAndStateRoot, } /// Given a block, execute based on a parent state. diff --git a/beacon/src/executive/transition/mod.rs b/beacon/src/executive/transition/mod.rs index 2b07aea3b9ac769876e43e7adcbffed68847bf11..d7130161ebf871be757cc0e7ccdcf7c353c76f6f 100644 --- a/beacon/src/executive/transition/mod.rs +++ b/beacon/src/executive/transition/mod.rs @@ -30,11 +30,10 @@ impl<'state, 'config, C: Config> Executive<'state, 'config, C> { strategy: Strategy, ) -> Result<(), Error> { self.process_slots(block.slot())?; - self.process_block(block, strategy)?; + self.process_block(block)?; match strategy { - Strategy::IgnoreStateRoot | Strategy::IgnoreRandaoAndStateRoot => (), - _ => { + Strategy::Full => { if !(block.state_root() == &H256::from_slice( Digestible::<C::Digest>::hash(self.state).as_slice() )) { diff --git a/beacon/src/executive/transition/per_block/mod.rs b/beacon/src/executive/transition/per_block/mod.rs index fea52af613274c29d380403a61490c83104fbc9c..9c8be2823772946358788a1de76e061abc8117bd 100644 --- a/beacon/src/executive/transition/per_block/mod.rs +++ b/beacon/src/executive/transition/per_block/mod.rs @@ -20,7 +20,7 @@ mod eth1; mod operations; use ssz::Digestible; -use crate::{Config, Error, Executive, Strategy}; +use crate::{Config, Error, Executive}; use crate::types::Block; impl<'state, 'config, C: Config> Executive<'state, 'config, C> { @@ -28,13 +28,9 @@ impl<'state, 'config, C: Config> Executive<'state, 'config, C> { pub fn process_block<B: Block + Digestible<C::Digest>>( &mut self, block: &B, - strategy: Strategy, ) -> Result<(), Error> { self.process_block_header(block)?; - match strategy { - Strategy::IgnoreRandaoAndStateRoot => (), - _ => self.process_randao(block.body())?, - } + self.process_randao(block.body())?; self.process_eth1_data(block.body()); self.process_operations(block.body())?; diff --git a/yamltests/res/spectests b/yamltests/res/spectests index 2e19fddf300433e64923bd6961079c72edac0c1c..c9015f53590ce36de849980a0b6fc77a1a09defc 160000 --- a/yamltests/res/spectests +++ b/yamltests/res/spectests @@ -1 +1 @@ -Subproject commit 2e19fddf300433e64923bd6961079c72edac0c1c +Subproject commit c9015f53590ce36de849980a0b6fc77a1a09defc diff --git a/yamltests/src/main.rs b/yamltests/src/main.rs index b29ec3fe05061b7819d9f72fbc9e666bd5383991..411d086053a321cfd803c7dd42dec8a0b8b46700 100644 --- a/yamltests/src/main.rs +++ b/yamltests/src/main.rs @@ -27,7 +27,7 @@ fn main() { .get_matches(); let file = File::open(matches.value_of("FILE").expect("FILE parameter not found")).expect("Open file failed"); - let mut config = match matches.value_of("CONFIG") { + let config = match matches.value_of("CONFIG") { Some("small") | None => NoVerificationConfig::small(), Some("full") => NoVerificationConfig::full(), _ => panic!("Unknown config"), @@ -42,10 +42,7 @@ fn main() { "voluntary_exit" => run::<VoluntaryExitTest, _>(file, &config), "crosslinks" => run::<CrosslinksTest, _>(file, &config), "registry_updates" => run::<RegistryUpdatesTest, _>(file, &config), - "blocks" => { - config.max_transfers = 1; // Work-around a bug in test https://github.com/ethereum/eth2.0-specs/issues/1147 - run::<BlocksTest, _>(file, &config); - }, + "blocks" => run::<BlocksTest, _>(file, &config), "slots" => run::<SlotsTest, _>(file, &config), _ => panic!("Unsupported runner"), } diff --git a/yamltests/src/sanity.rs b/yamltests/src/sanity.rs index 35b82b6afb09d4aeadfeb2be620b4aabed3f93cf..3e8b67cfeae885857c57cc9f44d40edf3c448b31 100644 --- a/yamltests/src/sanity.rs +++ b/yamltests/src/sanity.rs @@ -21,7 +21,7 @@ impl TestWithBLS for BlocksTest { for block in self.blocks.clone() { let mut executive = Executive { state, config }; - executive.state_transition(&block, Strategy::IgnoreRandaoAndStateRoot)? + executive.state_transition(&block, Strategy::Full)? } Ok(())