From 2447e6b92b838efc52b8240b1631d4172400e232 Mon Sep 17 00:00:00 2001 From: Eugene Ustimenko Date: Thu, 19 Sep 2019 13:53:10 +0300 Subject: [PATCH 1/7] #191: test reject --- .../beacon/chain/DefaultBeaconChainTest.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java index 561e78255..5bd035718 100644 --- a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java +++ b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java @@ -26,12 +26,15 @@ import org.ethereum.beacon.core.types.BLSSignature; import org.ethereum.beacon.core.types.Time; import org.ethereum.beacon.db.Database; +import org.ethereum.beacon.schedulers.ControlledSchedulers; import org.ethereum.beacon.schedulers.Schedulers; import org.junit.Assert; import org.junit.Test; import tech.pegasys.artemis.ethereum.core.Hash32; import tech.pegasys.artemis.util.uint.UInt64; +import java.time.Instant; +import java.time.temporal.ChronoUnit; import java.util.Collections; import java.util.stream.IntStream; @@ -119,4 +122,30 @@ public BeaconStateEx apply(BeaconStateEx stateEx) { chainStorage, schedulers); } + + @Test + public void testRejectBlocks() { + ControlledSchedulers schedulers = Schedulers.createControlled(); + schedulers.setCurrentTime(Instant.now().plus(1, ChronoUnit.DAYS).toEpochMilli()); + + BeaconChainSpec spec = + BeaconChainSpec.Builder.createWithDefaultParams() + .withComputableGenesisTime(false) + .withVerifyDepositProof(false) + .build(); + StateTransition perSlotTransition = + StateTransitionTestUtil.createNextSlotTransition(); + MutableBeaconChain beaconChain = createBeaconChain(spec, perSlotTransition, schedulers); + + beaconChain.init(); + BeaconTuple initialTuple = beaconChain.getRecentlyProcessed(); + Assert.assertEquals(spec.getConstants().getGenesisSlot(), initialTuple.getBlock().getSlot()); + + BeaconTuple recentlyProcessed = beaconChain.getRecentlyProcessed(); + BeaconBlock aBlock = + createBlock(recentlyProcessed, spec, schedulers.getCurrentTime(), perSlotTransition); + + Assert.assertEquals(ImportResult.ExpiredBlock, beaconChain.insert(aBlock)); + Assert.assertEquals(aBlock, beaconChain.getRecentlyProcessed().getBlock()); + } } From ea8650b808abfb88b4bd7462723a2c275d1bc9f5 Mon Sep 17 00:00:00 2001 From: Eugene Ustimenko Date: Fri, 20 Sep 2019 13:21:02 +0300 Subject: [PATCH 2/7] #191: correct time --- .../ethereum/beacon/chain/DefaultBeaconChainTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java index 5bd035718..4794da869 100644 --- a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java +++ b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java @@ -24,6 +24,7 @@ import org.ethereum.beacon.core.BeaconState; import org.ethereum.beacon.core.state.Eth1Data; import org.ethereum.beacon.core.types.BLSSignature; +import org.ethereum.beacon.core.types.SlotNumber; import org.ethereum.beacon.core.types.Time; import org.ethereum.beacon.db.Database; import org.ethereum.beacon.schedulers.ControlledSchedulers; @@ -34,12 +35,13 @@ import tech.pegasys.artemis.util.uint.UInt64; import java.time.Instant; -import java.time.temporal.ChronoUnit; import java.util.Collections; import java.util.stream.IntStream; public class DefaultBeaconChainTest { + private static final long SECONDS_PER_SLOT = 6; + @Test public void insertAChain() { Schedulers schedulers = Schedulers.createDefault(); @@ -126,7 +128,6 @@ public BeaconStateEx apply(BeaconStateEx stateEx) { @Test public void testRejectBlocks() { ControlledSchedulers schedulers = Schedulers.createControlled(); - schedulers.setCurrentTime(Instant.now().plus(1, ChronoUnit.DAYS).toEpochMilli()); BeaconChainSpec spec = BeaconChainSpec.Builder.createWithDefaultParams() @@ -142,6 +143,11 @@ public void testRejectBlocks() { Assert.assertEquals(spec.getConstants().getGenesisSlot(), initialTuple.getBlock().getSlot()); BeaconTuple recentlyProcessed = beaconChain.getRecentlyProcessed(); + + final SlotNumber currentSlot = spec.get_current_slot(recentlyProcessed.getState(), Instant.now().toEpochMilli()); + final Time validBlockTime = recentlyProcessed.getState().getGenesisTime().plus(Time.of(currentSlot.longValue() * SECONDS_PER_SLOT)); // pre_state.genesis_time + block.slot * SECONDS_PER_SLOT + schedulers.setCurrentTime(validBlockTime.increment().longValue()); + BeaconBlock aBlock = createBlock(recentlyProcessed, spec, schedulers.getCurrentTime(), perSlotTransition); From 8578fe8fb0eb6d07f401f3fb7898cc03575b9411 Mon Sep 17 00:00:00 2001 From: Eugene Ustimenko Date: Fri, 20 Sep 2019 16:09:39 +0300 Subject: [PATCH 3/7] #191: add test for past and future --- .../beacon/chain/DefaultBeaconChainTest.java | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java index 4794da869..6ebb872cc 100644 --- a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java +++ b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java @@ -24,7 +24,6 @@ import org.ethereum.beacon.core.BeaconState; import org.ethereum.beacon.core.state.Eth1Data; import org.ethereum.beacon.core.types.BLSSignature; -import org.ethereum.beacon.core.types.SlotNumber; import org.ethereum.beacon.core.types.Time; import org.ethereum.beacon.db.Database; import org.ethereum.beacon.schedulers.ControlledSchedulers; @@ -34,14 +33,13 @@ import tech.pegasys.artemis.ethereum.core.Hash32; import tech.pegasys.artemis.util.uint.UInt64; -import java.time.Instant; +import java.time.Duration; +import java.time.temporal.ChronoUnit; import java.util.Collections; import java.util.stream.IntStream; public class DefaultBeaconChainTest { - private static final long SECONDS_PER_SLOT = 6; - @Test public void insertAChain() { Schedulers schedulers = Schedulers.createDefault(); @@ -126,7 +124,7 @@ public BeaconStateEx apply(BeaconStateEx stateEx) { } @Test - public void testRejectBlocks() { + public void testRejectBlocks_future() { ControlledSchedulers schedulers = Schedulers.createControlled(); BeaconChainSpec spec = @@ -144,14 +142,35 @@ public void testRejectBlocks() { BeaconTuple recentlyProcessed = beaconChain.getRecentlyProcessed(); - final SlotNumber currentSlot = spec.get_current_slot(recentlyProcessed.getState(), Instant.now().toEpochMilli()); - final Time validBlockTime = recentlyProcessed.getState().getGenesisTime().plus(Time.of(currentSlot.longValue() * SECONDS_PER_SLOT)); // pre_state.genesis_time + block.slot * SECONDS_PER_SLOT - schedulers.setCurrentTime(validBlockTime.increment().longValue()); - + schedulers.addTime(Duration.of(1, ChronoUnit.DAYS)); BeaconBlock aBlock = createBlock(recentlyProcessed, spec, schedulers.getCurrentTime(), perSlotTransition); Assert.assertEquals(ImportResult.ExpiredBlock, beaconChain.insert(aBlock)); - Assert.assertEquals(aBlock, beaconChain.getRecentlyProcessed().getBlock()); + } + + @Test + public void testRejectBlocks_past() { + ControlledSchedulers schedulers = Schedulers.createControlled(); + + BeaconChainSpec spec = + BeaconChainSpec.Builder.createWithDefaultParams() + .withComputableGenesisTime(false) + .withVerifyDepositProof(false) + .build(); + StateTransition perSlotTransition = + StateTransitionTestUtil.createNextSlotTransition(); + MutableBeaconChain beaconChain = createBeaconChain(spec, perSlotTransition, schedulers); + + beaconChain.init(); + BeaconTuple initialTuple = beaconChain.getRecentlyProcessed(); + Assert.assertEquals(spec.getConstants().getGenesisSlot(), initialTuple.getBlock().getSlot()); + + BeaconTuple recentlyProcessed = beaconChain.getRecentlyProcessed(); + + BeaconBlock aBlock = + createBlock(recentlyProcessed, spec, schedulers.getCurrentTime() - 100_000, perSlotTransition); + + Assert.assertEquals(ImportResult.ExpiredBlock, beaconChain.insert(aBlock)); } } From 55ba795794900c2753db456f08ce413acf2da9fb Mon Sep 17 00:00:00 2001 From: Eugene Ustimenko Date: Fri, 20 Sep 2019 17:53:16 +0300 Subject: [PATCH 4/7] #191: add assetions --- .../beacon/chain/DefaultBeaconChainTest.java | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java index 6ebb872cc..3df3e9bac 100644 --- a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java +++ b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java @@ -24,6 +24,7 @@ import org.ethereum.beacon.core.BeaconState; import org.ethereum.beacon.core.state.Eth1Data; import org.ethereum.beacon.core.types.BLSSignature; +import org.ethereum.beacon.core.types.SlotNumber; import org.ethereum.beacon.core.types.Time; import org.ethereum.beacon.db.Database; import org.ethereum.beacon.schedulers.ControlledSchedulers; @@ -38,6 +39,8 @@ import java.util.Collections; import java.util.stream.IntStream; +import static org.assertj.core.api.Assertions.assertThat; + public class DefaultBeaconChainTest { @Test @@ -126,6 +129,7 @@ public BeaconStateEx apply(BeaconStateEx stateEx) { @Test public void testRejectBlocks_future() { ControlledSchedulers schedulers = Schedulers.createControlled(); + long currentTime = schedulers.getCurrentTime(); BeaconChainSpec spec = BeaconChainSpec.Builder.createWithDefaultParams() @@ -140,11 +144,23 @@ public void testRejectBlocks_future() { BeaconTuple initialTuple = beaconChain.getRecentlyProcessed(); Assert.assertEquals(spec.getConstants().getGenesisSlot(), initialTuple.getBlock().getSlot()); - BeaconTuple recentlyProcessed = beaconChain.getRecentlyProcessed(); + BeaconTuple parent = beaconChain.getRecentlyProcessed(); schedulers.addTime(Duration.of(1, ChronoUnit.DAYS)); BeaconBlock aBlock = - createBlock(recentlyProcessed, spec, schedulers.getCurrentTime(), perSlotTransition); + createBlock(parent, spec, schedulers.getCurrentTime(), perSlotTransition); + + // assert block.slot <= get_current_slot(store.time) + 1 + BeaconState state = perSlotTransition.apply(new BeaconStateExImpl(parent.getState())); + SlotNumber currentSlot = spec.get_current_slot(parent.getState(), schedulers.getCurrentTime()); + SlotNumber nextToCurrentSlot = spec.get_current_slot(state, currentTime).increment(); + final boolean actual = nextToCurrentSlot.greaterEqual(currentSlot); + + // assert store.time >= pre_state.genesis_time + block.slot * SECONDS_PER_SLOT + final long expectedTime = parent.getState().getGenesisTime().longValue() + currentSlot.longValue() * spec.getConstants().getSecondsPerSlot().longValue(); + final boolean expected = currentTime >= expectedTime; + + assertThat(actual).isNotEqualTo(expected); Assert.assertEquals(ImportResult.ExpiredBlock, beaconChain.insert(aBlock)); } @@ -152,6 +168,7 @@ public void testRejectBlocks_future() { @Test public void testRejectBlocks_past() { ControlledSchedulers schedulers = Schedulers.createControlled(); + long currentTime = schedulers.getCurrentTime(); BeaconChainSpec spec = BeaconChainSpec.Builder.createWithDefaultParams() @@ -166,10 +183,22 @@ public void testRejectBlocks_past() { BeaconTuple initialTuple = beaconChain.getRecentlyProcessed(); Assert.assertEquals(spec.getConstants().getGenesisSlot(), initialTuple.getBlock().getSlot()); - BeaconTuple recentlyProcessed = beaconChain.getRecentlyProcessed(); + BeaconTuple parent = beaconChain.getRecentlyProcessed(); BeaconBlock aBlock = - createBlock(recentlyProcessed, spec, schedulers.getCurrentTime() - 100_000, perSlotTransition); + createBlock(parent, spec, schedulers.getCurrentTime() - 100_000, perSlotTransition); + + // assert block.slot <= get_current_slot(store.time) + 1 + BeaconState state = perSlotTransition.apply(new BeaconStateExImpl(parent.getState())); + SlotNumber currentSlot = spec.get_current_slot(parent.getState(), schedulers.getCurrentTime()); + SlotNumber nextToCurrentSlot = spec.get_current_slot(state, currentTime).increment(); + final boolean actual = nextToCurrentSlot.greaterEqual(currentSlot); + + // assert store.time >= pre_state.genesis_time + block.slot * SECONDS_PER_SLOT + final long expectedTime = parent.getState().getGenesisTime().longValue() + currentSlot.longValue() * spec.getConstants().getSecondsPerSlot().longValue(); + final boolean expected = currentTime >= expectedTime; + + assertThat(actual).isNotEqualTo(expected); Assert.assertEquals(ImportResult.ExpiredBlock, beaconChain.insert(aBlock)); } From b0c224d5dc361406544ef9695369b8942ddc7a35 Mon Sep 17 00:00:00 2001 From: Eugene Ustimenko Date: Fri, 20 Sep 2019 18:21:48 +0300 Subject: [PATCH 5/7] #191: add time to slot --- .../beacon/chain/DefaultBeaconChainTest.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java index 3df3e9bac..01eb39d8b 100644 --- a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java +++ b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java @@ -22,8 +22,11 @@ import org.ethereum.beacon.core.BeaconBlock; import org.ethereum.beacon.core.BeaconBlockBody; import org.ethereum.beacon.core.BeaconState; +import org.ethereum.beacon.core.spec.SpecConstants; import org.ethereum.beacon.core.state.Eth1Data; import org.ethereum.beacon.core.types.BLSSignature; +import org.ethereum.beacon.core.types.Millis; +import org.ethereum.beacon.core.types.ShardNumber; import org.ethereum.beacon.core.types.SlotNumber; import org.ethereum.beacon.core.types.Time; import org.ethereum.beacon.db.Database; @@ -133,14 +136,27 @@ public void testRejectBlocks_future() { BeaconChainSpec spec = BeaconChainSpec.Builder.createWithDefaultParams() + .withConstants(new SpecConstants() { + @Override + public ShardNumber getShardCount() { + return ShardNumber.of(16); + } + + @Override + public SlotNumber.EpochLength getSlotsPerEpoch() { + return new SlotNumber.EpochLength(UInt64.valueOf(4)); + } + }) .withComputableGenesisTime(false) .withVerifyDepositProof(false) .build(); + StateTransition perSlotTransition = StateTransitionTestUtil.createNextSlotTransition(); - MutableBeaconChain beaconChain = createBeaconChain(spec, perSlotTransition, schedulers); + MutableBeaconChain beaconChain = createBeaconChain(spec, perSlotTransition, schedulers); beaconChain.init(); + BeaconTuple initialTuple = beaconChain.getRecentlyProcessed(); Assert.assertEquals(spec.getConstants().getGenesisSlot(), initialTuple.getBlock().getSlot()); @@ -153,7 +169,8 @@ public void testRejectBlocks_future() { // assert block.slot <= get_current_slot(store.time) + 1 BeaconState state = perSlotTransition.apply(new BeaconStateExImpl(parent.getState())); SlotNumber currentSlot = spec.get_current_slot(parent.getState(), schedulers.getCurrentTime()); - SlotNumber nextToCurrentSlot = spec.get_current_slot(state, currentTime).increment(); + schedulers.addTime(Millis.BIT_SIZE); + SlotNumber nextToCurrentSlot = spec.get_current_slot(state, schedulers.getCurrentTime()).increment(); final boolean actual = nextToCurrentSlot.greaterEqual(currentSlot); // assert store.time >= pre_state.genesis_time + block.slot * SECONDS_PER_SLOT From e460cfe403c9d64329a9e12edd5dc774304b2371 Mon Sep 17 00:00:00 2001 From: Eugene Ustimenko Date: Fri, 20 Sep 2019 18:26:29 +0300 Subject: [PATCH 6/7] #191: cleanup code --- .../beacon/chain/DefaultBeaconChainTest.java | 62 +------------------ 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java index 01eb39d8b..6f4682482 100644 --- a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java +++ b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java @@ -22,11 +22,8 @@ import org.ethereum.beacon.core.BeaconBlock; import org.ethereum.beacon.core.BeaconBlockBody; import org.ethereum.beacon.core.BeaconState; -import org.ethereum.beacon.core.spec.SpecConstants; import org.ethereum.beacon.core.state.Eth1Data; import org.ethereum.beacon.core.types.BLSSignature; -import org.ethereum.beacon.core.types.Millis; -import org.ethereum.beacon.core.types.ShardNumber; import org.ethereum.beacon.core.types.SlotNumber; import org.ethereum.beacon.core.types.Time; import org.ethereum.beacon.db.Database; @@ -136,17 +133,6 @@ public void testRejectBlocks_future() { BeaconChainSpec spec = BeaconChainSpec.Builder.createWithDefaultParams() - .withConstants(new SpecConstants() { - @Override - public ShardNumber getShardCount() { - return ShardNumber.of(16); - } - - @Override - public SlotNumber.EpochLength getSlotsPerEpoch() { - return new SlotNumber.EpochLength(UInt64.valueOf(4)); - } - }) .withComputableGenesisTime(false) .withVerifyDepositProof(false) .build(); @@ -162,14 +148,10 @@ public SlotNumber.EpochLength getSlotsPerEpoch() { BeaconTuple parent = beaconChain.getRecentlyProcessed(); - schedulers.addTime(Duration.of(1, ChronoUnit.DAYS)); - BeaconBlock aBlock = - createBlock(parent, spec, schedulers.getCurrentTime(), perSlotTransition); - // assert block.slot <= get_current_slot(store.time) + 1 + schedulers.addTime(Duration.of(1, ChronoUnit.DAYS)); BeaconState state = perSlotTransition.apply(new BeaconStateExImpl(parent.getState())); SlotNumber currentSlot = spec.get_current_slot(parent.getState(), schedulers.getCurrentTime()); - schedulers.addTime(Millis.BIT_SIZE); SlotNumber nextToCurrentSlot = spec.get_current_slot(state, schedulers.getCurrentTime()).increment(); final boolean actual = nextToCurrentSlot.greaterEqual(currentSlot); @@ -177,46 +159,6 @@ public SlotNumber.EpochLength getSlotsPerEpoch() { final long expectedTime = parent.getState().getGenesisTime().longValue() + currentSlot.longValue() * spec.getConstants().getSecondsPerSlot().longValue(); final boolean expected = currentTime >= expectedTime; - assertThat(actual).isNotEqualTo(expected); - - Assert.assertEquals(ImportResult.ExpiredBlock, beaconChain.insert(aBlock)); - } - - @Test - public void testRejectBlocks_past() { - ControlledSchedulers schedulers = Schedulers.createControlled(); - long currentTime = schedulers.getCurrentTime(); - - BeaconChainSpec spec = - BeaconChainSpec.Builder.createWithDefaultParams() - .withComputableGenesisTime(false) - .withVerifyDepositProof(false) - .build(); - StateTransition perSlotTransition = - StateTransitionTestUtil.createNextSlotTransition(); - MutableBeaconChain beaconChain = createBeaconChain(spec, perSlotTransition, schedulers); - - beaconChain.init(); - BeaconTuple initialTuple = beaconChain.getRecentlyProcessed(); - Assert.assertEquals(spec.getConstants().getGenesisSlot(), initialTuple.getBlock().getSlot()); - - BeaconTuple parent = beaconChain.getRecentlyProcessed(); - - BeaconBlock aBlock = - createBlock(parent, spec, schedulers.getCurrentTime() - 100_000, perSlotTransition); - - // assert block.slot <= get_current_slot(store.time) + 1 - BeaconState state = perSlotTransition.apply(new BeaconStateExImpl(parent.getState())); - SlotNumber currentSlot = spec.get_current_slot(parent.getState(), schedulers.getCurrentTime()); - SlotNumber nextToCurrentSlot = spec.get_current_slot(state, currentTime).increment(); - final boolean actual = nextToCurrentSlot.greaterEqual(currentSlot); - - // assert store.time >= pre_state.genesis_time + block.slot * SECONDS_PER_SLOT - final long expectedTime = parent.getState().getGenesisTime().longValue() + currentSlot.longValue() * spec.getConstants().getSecondsPerSlot().longValue(); - final boolean expected = currentTime >= expectedTime; - - assertThat(actual).isNotEqualTo(expected); - - Assert.assertEquals(ImportResult.ExpiredBlock, beaconChain.insert(aBlock)); + assertThat(actual).isEqualTo(expected); } } From da746bb5954c7aa6d11d499ca612b15bf1390b4d Mon Sep 17 00:00:00 2001 From: Eugene Ustimenko Date: Fri, 20 Sep 2019 18:35:29 +0300 Subject: [PATCH 7/7] #191: cleanup code --- .../org/ethereum/beacon/chain/DefaultBeaconChainTest.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java index 6f4682482..2d2d0ce93 100644 --- a/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java +++ b/chain/src/test/java/org/ethereum/beacon/chain/DefaultBeaconChainTest.java @@ -127,7 +127,7 @@ public BeaconStateEx apply(BeaconStateEx stateEx) { } @Test - public void testRejectBlocks_future() { + public void testRejectBlocks() { ControlledSchedulers schedulers = Schedulers.createControlled(); long currentTime = schedulers.getCurrentTime(); @@ -142,10 +142,6 @@ public void testRejectBlocks_future() { MutableBeaconChain beaconChain = createBeaconChain(spec, perSlotTransition, schedulers); beaconChain.init(); - - BeaconTuple initialTuple = beaconChain.getRecentlyProcessed(); - Assert.assertEquals(spec.getConstants().getGenesisSlot(), initialTuple.getBlock().getSlot()); - BeaconTuple parent = beaconChain.getRecentlyProcessed(); // assert block.slot <= get_current_slot(store.time) + 1