File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
services/beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain
storage/src/main/java/tech/pegasys/teku/storage/client Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,7 @@ public class BeaconChainController extends Service implements BeaconChainControl
327
327
protected volatile AttestationManager attestationManager ;
328
328
protected volatile SignatureVerificationService signatureVerificationService ;
329
329
protected volatile CombinedChainDataClient combinedChainDataClient ;
330
+ protected volatile EarliestAvailableBlockSlot earliestAvailableBlockSlot ;
330
331
protected volatile Eth1DataCache eth1DataCache ;
331
332
protected volatile SlotProcessor slotProcessor ;
332
333
protected volatile OperationPool <AttesterSlashing > attesterSlashingPool ;
@@ -1182,7 +1183,7 @@ private boolean getLivenessTrackingEnabled(final BeaconChainConfiguration beacon
1182
1183
1183
1184
protected void initCombinedChainDataClient () {
1184
1185
LOG .debug ("BeaconChainController.initCombinedChainDataClient()" );
1185
- final EarliestAvailableBlockSlot earliestAvailableBlockSlot =
1186
+ earliestAvailableBlockSlot =
1186
1187
new EarliestAvailableBlockSlot (
1187
1188
storageQueryChannel ,
1188
1189
timeProvider ,
@@ -1585,10 +1586,7 @@ protected void initP2PNetwork() {
1585
1586
recentChainData ,
1586
1587
throttlingStorageQueryChannel ,
1587
1588
spec ,
1588
- new EarliestAvailableBlockSlot (
1589
- throttlingStorageQueryChannel ,
1590
- timeProvider ,
1591
- beaconConfig .storeConfig ().getEarliestAvailableBlockSlotFrequency ())));
1589
+ earliestAvailableBlockSlot ));
1592
1590
}
1593
1591
1594
1592
this .p2pNetwork =
Original file line number Diff line number Diff line change @@ -28,9 +28,8 @@ public class EarliestAvailableBlockSlot {
28
28
29
29
private final int earliestAvailableBlockSlotFrequency ;
30
30
31
- private UInt64 queryTime = UInt64 .ZERO ;
32
-
33
- private SafeFuture <Optional <UInt64 >> earliestAvailableBlockSlotFuture =
31
+ private volatile UInt64 queryTime = UInt64 .ZERO ;
32
+ private volatile SafeFuture <Optional <UInt64 >> earliestAvailableBlockSlotFuture =
34
33
SafeFuture .completedFuture (Optional .empty ());
35
34
36
35
public EarliestAvailableBlockSlot (
@@ -64,10 +63,7 @@ private synchronized SafeFuture<Optional<UInt64>> actuallyGetEarliestBlockSlot()
64
63
} else {
65
64
return earliestAvailableBlockSlotFuture ;
66
65
}
67
- if (!earliestAvailableBlockSlotFuture .isDone ()) {
68
- // if the current query is not done, we should just return the same future
69
- return earliestAvailableBlockSlotFuture ;
70
- }
66
+
71
67
LOG .trace ("Fetching earliestBlockSlot..." );
72
68
earliestAvailableBlockSlotFuture = historicalChainData .getEarliestAvailableBlockSlot ();
73
69
return earliestAvailableBlockSlotFuture ;
You can’t perform that action at this time.
0 commit comments