Skip to content

Commit f0d872e

Browse files
authored
Revert "Add Single block provider for Fulu (#10169)" (#10235)
This reverts commit 2246ea0.
1 parent 62b21b3 commit f0d872e

20 files changed

Lines changed: 274 additions & 636 deletions

File tree

beacon/sync/src/main/java/tech/pegasys/teku/beacon/sync/DefaultSyncServiceFactory.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import tech.pegasys.teku.statetransition.blobs.BlobSidecarManager;
4343
import tech.pegasys.teku.statetransition.blobs.BlockBlobSidecarsTrackersPool;
4444
import tech.pegasys.teku.statetransition.block.BlockImporter;
45-
import tech.pegasys.teku.statetransition.datacolumns.DasSamplerBasic;
4645
import tech.pegasys.teku.statetransition.util.PendingPool;
4746
import tech.pegasys.teku.statetransition.validation.signatures.SignatureVerificationService;
4847
import tech.pegasys.teku.storage.api.StorageUpdateChannel;
@@ -73,7 +72,6 @@ public class DefaultSyncServiceFactory implements SyncServiceFactory {
7372
private final PendingPool<SignedBeaconBlock> pendingBlocks;
7473
private final PendingPool<ValidatableAttestation> pendingAttestations;
7574
private final BlockBlobSidecarsTrackersPool blockBlobSidecarsTrackersPool;
76-
private final DasSamplerBasic dasBasicSampler;
7775
private final int getStartupTargetPeerCount;
7876
private final AsyncBLSSignatureVerifier signatureVerifier;
7977
private final Duration startupTimeout;
@@ -96,7 +94,6 @@ public DefaultSyncServiceFactory(
9694
final PendingPool<SignedBeaconBlock> pendingBlocks,
9795
final PendingPool<ValidatableAttestation> pendingAttestations,
9896
final BlockBlobSidecarsTrackersPool blockBlobSidecarsTrackersPool,
99-
final DasSamplerBasic dasBasicSampler,
10097
final int getStartupTargetPeerCount,
10198
final SignatureVerificationService signatureVerifier,
10299
final Duration startupTimeout,
@@ -117,7 +114,6 @@ public DefaultSyncServiceFactory(
117114
this.pendingBlocks = pendingBlocks;
118115
this.pendingAttestations = pendingAttestations;
119116
this.blockBlobSidecarsTrackersPool = blockBlobSidecarsTrackersPool;
120-
this.dasBasicSampler = dasBasicSampler;
121117
this.getStartupTargetPeerCount = getStartupTargetPeerCount;
122118
this.signatureVerifier = signatureVerifier;
123119
this.startupTimeout = startupTimeout;
@@ -140,7 +136,6 @@ public SyncService create(final EventChannels eventChannels) {
140136
pendingBlocks,
141137
pendingAttestations,
142138
blockBlobSidecarsTrackersPool,
143-
dasBasicSampler,
144139
forwardSyncService,
145140
fetchTaskFactory);
146141
final RecentBlobSidecarsFetcher recentBlobSidecarsFetcher =

beacon/sync/src/main/java/tech/pegasys/teku/beacon/sync/SyncConfig.java

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import static com.google.common.base.Preconditions.checkNotNull;
1717

1818
import java.util.OptionalInt;
19-
import tech.pegasys.teku.infrastructure.exceptions.InvalidConfigurationException;
2019
import tech.pegasys.teku.networking.eth2.P2PConfig;
2120

2221
public class SyncConfig {
@@ -35,8 +34,6 @@ public class SyncConfig {
3534
/** Aligned with {@link P2PConfig#DEFAULT_PEER_BLOB_SIDECARS_RATE_LIMIT} */
3635
public static final int DEFAULT_FORWARD_SYNC_MAX_BLOB_SIDECARS_PER_MINUTE = 2000;
3736

38-
public static final int DEFAULT_MAX_RECENTLY_SAMPLED_BLOCKS = 64;
39-
4037
private final boolean isEnabled;
4138
private final boolean isMultiPeerSyncEnabled;
4239
private final boolean reconstructHistoricStatesEnabled;
@@ -47,7 +44,6 @@ public class SyncConfig {
4744
private final int forwardSyncMaxBlocksPerMinute;
4845
private final int forwardSyncMaxBlobSidecarsPerMinute;
4946
private final OptionalInt forwardSyncMaxDistanceFromHead;
50-
private final int maxRecentlySampledBlocks;
5147

5248
private SyncConfig(
5349
final boolean isEnabled,
@@ -59,8 +55,7 @@ private SyncConfig(
5955
final int forwardSyncMaxPendingBatches,
6056
final int forwardSyncMaxBlocksPerMinute,
6157
final int forwardSyncMaxBlobSidecarsPerMinute,
62-
final OptionalInt forwardSyncMaxDistanceFromHead,
63-
final int maxRecentlySampledBlocks) {
58+
final OptionalInt forwardSyncMaxDistanceFromHead) {
6459
this.isEnabled = isEnabled;
6560
this.isMultiPeerSyncEnabled = isMultiPeerSyncEnabled;
6661
this.reconstructHistoricStatesEnabled = reconstructHistoricStatesEnabled;
@@ -71,7 +66,6 @@ private SyncConfig(
7166
this.forwardSyncMaxBlocksPerMinute = forwardSyncMaxBlocksPerMinute;
7267
this.forwardSyncMaxBlobSidecarsPerMinute = forwardSyncMaxBlobSidecarsPerMinute;
7368
this.forwardSyncMaxDistanceFromHead = forwardSyncMaxDistanceFromHead;
74-
this.maxRecentlySampledBlocks = maxRecentlySampledBlocks;
7569
}
7670

7771
public static Builder builder() {
@@ -118,10 +112,6 @@ public OptionalInt getForwardSyncMaxDistanceFromHead() {
118112
return forwardSyncMaxDistanceFromHead;
119113
}
120114

121-
public int getMaxRecentlySampledBlocks() {
122-
return maxRecentlySampledBlocks;
123-
}
124-
125115
public static class Builder {
126116
private Boolean isEnabled;
127117
private Boolean isMultiPeerSyncEnabled = DEFAULT_MULTI_PEER_SYNC_ENABLED;
@@ -134,7 +124,6 @@ public static class Builder {
134124
private Integer forwardSyncMaxBlobSidecarsPerMinute =
135125
DEFAULT_FORWARD_SYNC_MAX_BLOB_SIDECARS_PER_MINUTE;
136126
private OptionalInt forwardSyncMaxDistanceFromHead = OptionalInt.empty();
137-
private Integer maxRecentlySampledBlocks = DEFAULT_MAX_RECENTLY_SAMPLED_BLOCKS;
138127

139128
private Builder() {}
140129

@@ -150,8 +139,7 @@ public SyncConfig build() {
150139
forwardSyncMaxPendingBatches,
151140
forwardSyncMaxBlocksPerMinute,
152141
forwardSyncMaxBlobSidecarsPerMinute,
153-
forwardSyncMaxDistanceFromHead,
154-
maxRecentlySampledBlocks);
142+
forwardSyncMaxDistanceFromHead);
155143
}
156144

157145
private void initMissingDefaults() {
@@ -230,15 +218,5 @@ public Builder fetchAllHistoricBlocks(final boolean fetchAllHistoricBlocks) {
230218
this.fetchAllHistoricBlocks = fetchAllHistoricBlocks;
231219
return this;
232220
}
233-
234-
public Builder maxRecentlySampledBlocks(final Integer maxRecentlySampledBlocks) {
235-
checkNotNull(maxRecentlySampledBlocks);
236-
if (maxRecentlySampledBlocks <= 0) {
237-
throw new InvalidConfigurationException(
238-
String.format("Invalid maxRecentlySampledBlocks: %d", maxRecentlySampledBlocks));
239-
}
240-
this.maxRecentlySampledBlocks = maxRecentlySampledBlocks;
241-
return this;
242-
}
243221
}
244222
}

beacon/sync/src/main/java/tech/pegasys/teku/beacon/sync/gossip/blocks/RecentBlocksFetchService.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import tech.pegasys.teku.spec.datastructures.attestation.ValidatableAttestation;
2727
import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock;
2828
import tech.pegasys.teku.statetransition.blobs.BlockBlobSidecarsTrackersPool;
29-
import tech.pegasys.teku.statetransition.datacolumns.DasSamplerBasic;
3029
import tech.pegasys.teku.statetransition.util.PendingPool;
3130

3231
public class RecentBlocksFetchService
@@ -41,7 +40,6 @@ public class RecentBlocksFetchService
4140
private final PendingPool<SignedBeaconBlock> pendingBlockPool;
4241
private final PendingPool<ValidatableAttestation> pendingAttestationsPool;
4342
private final BlockBlobSidecarsTrackersPool blockBlobSidecarsTrackersPool;
44-
private final DasSamplerBasic dasBasicSampler;
4543
private final FetchTaskFactory fetchTaskFactory;
4644
private final Subscribers<BlockSubscriber> blockSubscribers = Subscribers.create(true);
4745

@@ -50,7 +48,6 @@ public class RecentBlocksFetchService
5048
final PendingPool<SignedBeaconBlock> pendingBlockPool,
5149
final PendingPool<ValidatableAttestation> pendingAttestationsPool,
5250
final BlockBlobSidecarsTrackersPool blockBlobSidecarsTrackersPool,
53-
final DasSamplerBasic dasBasicSampler,
5451
final ForwardSync forwardSync,
5552
final FetchTaskFactory fetchTaskFactory,
5653
final int maxConcurrentRequests) {
@@ -59,7 +56,6 @@ public class RecentBlocksFetchService
5956
this.pendingBlockPool = pendingBlockPool;
6057
this.pendingAttestationsPool = pendingAttestationsPool;
6158
this.blockBlobSidecarsTrackersPool = blockBlobSidecarsTrackersPool;
62-
this.dasBasicSampler = dasBasicSampler;
6359
this.fetchTaskFactory = fetchTaskFactory;
6460
}
6561

@@ -68,15 +64,13 @@ public static RecentBlocksFetchService create(
6864
final PendingPool<SignedBeaconBlock> pendingBlocksPool,
6965
final PendingPool<ValidatableAttestation> pendingAttestations,
7066
final BlockBlobSidecarsTrackersPool blockBlobSidecarsTrackersPool,
71-
final DasSamplerBasic dasBasicSampler,
7267
final ForwardSync forwardSync,
7368
final FetchTaskFactory fetchTaskFactory) {
7469
return new RecentBlocksFetchService(
7570
asyncRunner,
7671
pendingBlocksPool,
7772
pendingAttestations,
7873
blockBlobSidecarsTrackersPool,
79-
dasBasicSampler,
8074
forwardSync,
8175
fetchTaskFactory,
8276
MAX_CONCURRENT_REQUESTS);
@@ -112,10 +106,6 @@ public void requestRecentBlock(final Bytes32 blockRoot) {
112106
// We already have this block, waiting for blobs
113107
return;
114108
}
115-
if (dasBasicSampler.containsBlock(blockRoot)) {
116-
// We already have this block in DAS sampler
117-
return;
118-
}
119109
final FetchBlockTask task = createTask(blockRoot);
120110
if (allTasks.putIfAbsent(blockRoot, task) != null) {
121111
// We're already tracking this task

beacon/sync/src/test/java/tech/pegasys/teku/beacon/sync/gossip/blocks/RecentBlocksFetchServiceTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock;
4444
import tech.pegasys.teku.spec.util.DataStructureUtil;
4545
import tech.pegasys.teku.statetransition.blobs.BlockBlobSidecarsTrackersPool;
46-
import tech.pegasys.teku.statetransition.datacolumns.DasSamplerBasicImpl;
4746
import tech.pegasys.teku.statetransition.util.PendingPool;
4847

4948
public class RecentBlocksFetchServiceTest {
@@ -60,7 +59,6 @@ public class RecentBlocksFetchServiceTest {
6059

6160
private final BlockBlobSidecarsTrackersPool blockBlobSidecarsTrackersPool =
6261
mock(BlockBlobSidecarsTrackersPool.class);
63-
private final DasSamplerBasicImpl dasSamplerBasic = mock(DasSamplerBasicImpl.class);
6462

6563
private final FetchTaskFactory fetchTaskFactory = mock(FetchTaskFactory.class);
6664

@@ -83,7 +81,6 @@ public void setup() {
8381
pendingBlockPool,
8482
pendingAttestationsPool,
8583
blockBlobSidecarsTrackersPool,
86-
dasSamplerBasic,
8784
forwardSync,
8885
fetchTaskFactory,
8986
maxConcurrentRequests);

beacon/sync/src/testFixtures/java/tech/pegasys/teku/beacon/sync/SyncingNodeManager.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
import tech.pegasys.teku.statetransition.block.BlockImporter;
6464
import tech.pegasys.teku.statetransition.block.BlockManager;
6565
import tech.pegasys.teku.statetransition.block.ReceivedBlockEventsChannel;
66-
import tech.pegasys.teku.statetransition.datacolumns.DasSamplerBasic;
6766
import tech.pegasys.teku.statetransition.forkchoice.ForkChoice;
6867
import tech.pegasys.teku.statetransition.forkchoice.MergeTransitionBlockValidator;
6968
import tech.pegasys.teku.statetransition.forkchoice.NoopForkChoiceNotifier;
@@ -215,7 +214,6 @@ public static SyncingNodeManager create(
215214
pendingBlocks,
216215
pendingAttestations,
217216
BlockBlobSidecarsTrackersPool.NOOP,
218-
DasSamplerBasic.NOOP,
219217
syncService,
220218
fetchBlockTaskFactory);
221219
recentBlocksFetcher.subscribeBlockFetched(blockManager::importBlock);

eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/forkchoice/ForkChoiceTestExecutor.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
import tech.pegasys.teku.spec.logic.common.statetransition.results.BlockImportResult;
7878
import tech.pegasys.teku.statetransition.datacolumns.CurrentSlotProvider;
7979
import tech.pegasys.teku.statetransition.datacolumns.DasCustodyStand;
80-
import tech.pegasys.teku.statetransition.datacolumns.DasSamplerBasicImpl;
80+
import tech.pegasys.teku.statetransition.datacolumns.DasSamplerBasic;
8181
import tech.pegasys.teku.statetransition.datacolumns.DataColumnSidecarRecoveringCustody;
8282
import tech.pegasys.teku.statetransition.datacolumns.retriever.DataColumnSidecarRetrieverStub;
8383
import tech.pegasys.teku.statetransition.forkchoice.ForkChoice;
@@ -159,8 +159,8 @@ spec, new SignedBlockAndState(anchorBlock, anchorState)),
159159
final StubBlobSidecarManager blobSidecarManager = new StubBlobSidecarManager(kzg);
160160
final CurrentSlotProvider currentSlotProvider =
161161
CurrentSlotProvider.create(spec, recentChainData.getStore());
162-
final DasSamplerBasicImpl dasSampler =
163-
new DasSamplerBasicImpl(
162+
final DasSamplerBasic dasSampler =
163+
new DasSamplerBasic(
164164
spec,
165165
asyncRunnerFactory.create("das", 1),
166166
currentSlotProvider,
@@ -170,9 +170,7 @@ spec, new SignedBlockAndState(anchorBlock, anchorState)),
170170
// using a const for the custody group count here, the test doesn't care
171171
// and fetching from the config would break when not in fulu
172172
DasCustodyStand.createCustodyGroupCountManager(4, 8),
173-
recentChainData,
174-
storageSystem.getMetricsSystem(),
175-
64);
173+
recentChainData);
176174
final StubDataColumnSidecarManager dataColumnSidecarManager =
177175
new StubDataColumnSidecarManager(spec, recentChainData, dasSampler);
178176
// forkChoiceLateBlockReorgEnabled is true here always because this is the reference test

ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/datacolumns/DasPreSampler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private void onNewPreImportBlock(final SignedBeaconBlock block) {
8686
.always(
8787
() ->
8888
sampler
89-
.checkDataAvailability(block)
89+
.checkDataAvailability(block.getSlot(), block.getRoot())
9090
.finish(
9191
succ ->
9292
LOG.debug(

0 commit comments

Comments
 (0)