Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PeerDAS #1

Draft
wants to merge 74 commits into
base: temp-das-start
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
78911c1
Skip EL part of graffiti when EL info not available (#8175)
zilm13 Apr 9, 2024
3172d2f
Adopt new c-kzg 'das' branch
Nashatyrev Apr 9, 2024
4603466
Disable negative test which segfaults
Nashatyrev Apr 9, 2024
bf17838
Add sanity CKZG4844JNI test
Nashatyrev Apr 9, 2024
6a5b007
Block publishing performance (#8181)
tbenr Apr 10, 2024
2c2249a
Cleanup on block performance (#8184)
tbenr Apr 10, 2024
008ab85
Implement new KZG methods
Nashatyrev Apr 10, 2024
91b4e3d
Electra spec config and builder (#8183)
rolfyone Apr 10, 2024
514539b
Added a timeout to state regeneration (#8097)
rolfyone Apr 11, 2024
c4b9a7a
Don't encode ids array comma separators in getStateValidator request …
zilm13 Apr 11, 2024
ad5e63f
Disable requirement for EIP-7251 configuration in Electra config (#8188)
zilm13 Apr 11, 2024
8ac4353
Electra MaxEB state changes (#8186)
rolfyone Apr 11, 2024
220d422
Add DAS Ssz data structures and config constants (#12)
Nashatyrev Apr 12, 2024
139edad
Add config options to set extra DAS subnets and advertise it with ENR…
Nashatyrev Apr 12, 2024
45559ca
Merge remote-tracking branch 'refs/remotes/Consensys/master' into das
Nashatyrev Apr 12, 2024
63ff01c
Add DATA_COLUMN_SIDECAR_SUBNET_COUNT to yaml configs
Nashatyrev Apr 12, 2024
8a7a866
Add SpecConfigElectra.getDataColumnSidecarSubnetCount()
Nashatyrev Apr 12, 2024
ce351f5
Add data_column_sidecar_ gossip topics
Nashatyrev Apr 12, 2024
4374c71
Add DataColumnSidecarSchema spec definitions
Nashatyrev Apr 12, 2024
4cd8af2
Add DataColumnSidecarGossipManager and DataColumnSidecarGossipChannel
Nashatyrev Apr 12, 2024
b37374e
Add DataColumn to GossipForkManager
Nashatyrev Apr 12, 2024
ace797f
Add DataColumnSidecarSubnetSubscriptions
Nashatyrev Apr 15, 2024
25cb4cd
Add DataColumnSidecar support to GossipForkSubscriptions
Nashatyrev Apr 15, 2024
1350793
Update Eth2P2PNetworkBuilder
Nashatyrev Apr 15, 2024
27ad225
Merge remote-tracking branch 'refs/remotes/Nashatyrev/das' into das
Nashatyrev Apr 15, 2024
5ea4f8d
Fix copy/paste artifacts
Nashatyrev Apr 16, 2024
47c94a4
Merge pull request #14 from Nashatyrev/das-pr/gossip-2
Nashatyrev Apr 16, 2024
b96f8b1
Gossip (part 2) (#15)
Nashatyrev Apr 16, 2024
6b50aeb
spotless apply (#16)
zilm13 Apr 18, 2024
6dc808b
More codestyle fixes
zilm13 Apr 18, 2024
db62b9a
Merge pull request #18 from zilm13/more-codestyle
Nashatyrev Apr 19, 2024
c3a2ca4
Central DAS interfaces sketches and some Custody implementation (#17)
Nashatyrev Apr 19, 2024
6c40e3c
PeerDAS Database part1 (#19)
zilm13 Apr 19, 2024
294661b
Peerdas db part2 (#20)
zilm13 Apr 22, 2024
ad67fca
Some more DAS core interfaces and some draft implementations (#21)
Nashatyrev Apr 23, 2024
67b4d56
DataColumnSidecars database tests (#22)
zilm13 Apr 24, 2024
1d1f478
Integrate DAS column subnets to peer scoring (#23)
Nashatyrev Apr 25, 2024
a5b32f3
Add rpc byRoot method for DataColumnSidecar (#24)
zilm13 Apr 26, 2024
6886173
Extract NodeIdToDataColumnSidecarSubnetsCalculator (#25)
Nashatyrev Apr 26, 2024
6444f9c
Remove Electra stuff (#26)
zilm13 Apr 30, 2024
f28054f
Update DataColumnSidecar kzg verification + proof verification (#27)
zilm13 Apr 30, 2024
29eb79f
Merge pull request #28
zilm13 May 1, 2024
b3e8079
Merge pull request #29
zilm13 May 1, 2024
2a12f22
Create DataColumnSidecars on block production and publish it (#31)
zilm13 May 1, 2024
3d6e1fe
Fix the DataColumnSidecars construction (#32)
Nashatyrev May 3, 2024
2cf41a1
Speedup block production (via Stream.parallel()) (#33)
Nashatyrev May 3, 2024
7097eab
Disable BlobSidecars availability check in the post Deneb milestones …
Nashatyrev May 3, 2024
3ac6cc5
Integrate DataColumnSidecarCustody for storing gossip inbound/outboun…
Nashatyrev May 3, 2024
3c38ebc
Reference tests for EIP-7594 + utils implementation (#36)
zilm13 May 7, 2024
dedcd96
Ref tests 1.5.0.alpha.2 + jc-kzg usage update (#37)
zilm13 May 7, 2024
8a76b25
Expose discovery NodeId to DiscoveryPeer and LibP2PPeer (#38)
Nashatyrev May 9, 2024
9e71e72
Add Eth2Peer.getAvailableDataColumnSidecarsRequestCount() (#39)
Nashatyrev May 9, 2024
a2c5ac4
DasPeerManagerImpl and DAS req/resp initial drafts (#40)
Nashatyrev May 9, 2024
23f1416
First efforts to launch DasCustodySync (#41)
Nashatyrev May 9, 2024
b7ae7b9
Fixes to make sync working (#42)
Nashatyrev May 9, 2024
1575fda
Spotless (#43)
Nashatyrev May 9, 2024
8696e58
Track extra subnet count by gossip subscriptions (#44)
Nashatyrev May 10, 2024
0e64217
DataColumnSidecars by Range RPC (#45)
zilm13 May 13, 2024
adfb089
Read numberOfColumns from config instead of calculating (#46)
zilm13 May 14, 2024
63ab9aa
Reduce RPC column request limit (#47)
Nashatyrev May 14, 2024
48edab4
Add some logs
Nashatyrev May 14, 2024
fc23e9f
Some patch for Kurtosis (#48)
zilm13 May 14, 2024
1aca86c
Fix compiler warning
Nashatyrev May 14, 2024
f9d21fb
More intensive DAS logging
Nashatyrev May 14, 2024
a2731ab
Extra custody command line option (#49)
zilm13 May 15, 2024
7dcf5b3
Enable all custody subnets with all subnets subscribed (#51)
zilm13 May 15, 2024
7ff3722
Fix: 'complete' slot in DAS DB should be finalized (#50)
Nashatyrev May 15, 2024
94b147a
das-pr/3-peers-milestone (#52)
Nashatyrev May 15, 2024
7d4d65a
Better logging for disconnection reasons (#53)
zilm13 May 16, 2024
0625472
Fix remote subnet tracking, other stuff (#54)
Nashatyrev May 16, 2024
9fd3f7b
Switch from extra subnet count in discovery to total subnet count lik…
zilm13 May 16, 2024
4abba1f
move all custody subnets to separate option (#56)
zilm13 May 16, 2024
bc33599
Implement long polling req/resp getDataColumnByRoot() method (#57)
Nashatyrev May 17, 2024
0295ebd
Build fix + minor name fixes
zilm13 May 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.Locale;
import org.apache.tuweni.bytes.Bytes32;
import org.junit.jupiter.api.Test;
import tech.pegasys.teku.api.schema.bellatrix.SignedBeaconBlockBellatrix;
import tech.pegasys.teku.api.schema.eip7594.SignedBeaconBlockEip7594;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.teku.test.acceptance.dsl.GenesisGenerator.InitialStateData;
Expand All @@ -45,7 +45,10 @@ void shouldHaveCorrectFeeRecipientAndGraffiti() throws Exception {
createGenesisGenerator()
.network(networkName)
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ONE)
.withCapellaEpoch(UInt64.valueOf(2))
.withDenebEpoch(UInt64.valueOf(3))
.withEip7594Epoch(UInt64.valueOf(4))
.validatorKeys(validatorKeystores, validatorKeystores)
.generate();

Expand All @@ -58,8 +61,14 @@ void shouldHaveCorrectFeeRecipientAndGraffiti() throws Exception {
.withJwtSecretFile(JWT_FILE)
.withNetwork(networkName)
.withInitialState(genesis)
.withRealNetwork()
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ONE)
.withCapellaEpoch(UInt64.valueOf(2))
.withDenebEpoch(UInt64.valueOf(3))
.withEip7594Epoch(UInt64.valueOf(4))
.withTotalTerminalDifficulty(0)
.withTrustedSetupFromClasspath("mainnet-trusted-setup.txt")
.withValidatorProposerDefaultFeeRecipient(defaultFeeRecipient)
.build());
final TekuValidatorNode validatorClient =
Expand All @@ -76,14 +85,15 @@ void shouldHaveCorrectFeeRecipientAndGraffiti() throws Exception {
beaconNode.start();
validatorClient.start();

beaconNode.waitForEpochAtOrAbove(4);
beaconNode.waitForBlockSatisfying(
block -> {
assertThat(block).isInstanceOf(SignedBeaconBlockBellatrix.class);
final SignedBeaconBlockBellatrix bellatrixBlock = (SignedBeaconBlockBellatrix) block;
assertThat(block).isInstanceOf(SignedBeaconBlockEip7594.class);
final SignedBeaconBlockEip7594 eip7594Block = (SignedBeaconBlockEip7594) block;
assertThat(
bellatrixBlock.getMessage().getBody().executionPayload.feeRecipient.toHexString())
eip7594Block.getMessage().getBody().executionPayload.feeRecipient.toHexString())
.isEqualTo(defaultFeeRecipient.toLowerCase(Locale.ROOT));
final Bytes32 graffiti = bellatrixBlock.getMessage().getBody().graffiti;
final Bytes32 graffiti = eip7594Block.getMessage().getBody().graffiti;
final String graffitiMessage =
new String(
Arrays.copyOfRange(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ public GenesisGenerator withCapellaEpoch(final UInt64 capellaForkEpoch) {
return this;
}

public GenesisGenerator withDenebEpoch(final UInt64 denebForkEpoch) {
specConfigModifier =
specConfigModifier.andThen(
specConfigBuilder ->
specConfigBuilder.denebBuilder(
denebBuilder -> denebBuilder.denebForkEpoch(denebForkEpoch)));
return this;
}

public GenesisGenerator withEip7594Epoch(final UInt64 eip7594ForkEpoch) {
specConfigModifier =
specConfigModifier.andThen(
specConfigBuilder ->
specConfigBuilder.eip7594Builder(
eip7594Builder -> eip7594Builder.eip7594ForkEpoch(eip7594ForkEpoch)));
return this;
}

public GenesisGenerator withTotalTerminalDifficulty(final long totalTerminalDifficulty) {
return withTotalTerminalDifficulty(UInt256.valueOf(totalTerminalDifficulty));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,19 @@ public TekuNodeConfigBuilder withDenebEpoch(final UInt64 denebForkEpoch) {
return this;
}

public TekuNodeConfigBuilder withEip7594Epoch(final UInt64 eip7594ForkEpoch) {

mustBe(NodeType.BEACON_NODE);
LOG.debug("Xnetwork-das-fork-epoch={}", eip7594ForkEpoch);
configMap.put("Xnetwork-das-fork-epoch", eip7594ForkEpoch.toString());
specConfigModifier =
specConfigModifier.andThen(
specConfigBuilder ->
specConfigBuilder.eip7594Builder(
eip7594Builder -> eip7594Builder.eip7594ForkEpoch(eip7594ForkEpoch)));
return this;
}

public TekuNodeConfigBuilder withTotalTerminalDifficulty(final long totalTerminalDifficulty) {
return withTotalTerminalDifficulty(UInt256.valueOf(totalTerminalDifficulty));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,20 @@ public SyncSource getOrCreateSyncSource(final Eth2Peer peer, final Spec spec) {
final int maxBlocksPerMinute = this.maxBlocksPerMinute - batchSize - 1;
final Optional<Integer> maxBlobSidecarsPerMinute =
spec.getMaxBlobsPerBlock().map(maxBlobsPerBlock -> maxBlocksPerMinute * maxBlobsPerBlock);
final Optional<Integer> maxDataColumnSidecarsPerMinute =
spec.getNumberOfDataColumns()
.map(dataColumnsPerBlock -> maxBlocksPerMinute * dataColumnsPerBlock.intValue());

return syncSourcesByPeer.computeIfAbsent(
peer,
source ->
new ThrottlingSyncSource(
asyncRunner, timeProvider, source, maxBlocksPerMinute, maxBlobSidecarsPerMinute));
asyncRunner,
timeProvider,
source,
maxBlocksPerMinute,
maxBlobSidecarsPerMinute,
maxDataColumnSidecarsPerMinute));
}

public void onPeerDisconnected(final Eth2Peer peer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package tech.pegasys.teku.beacon.sync.forward.multipeer.chains;

import java.time.Duration;
import java.util.List;
import java.util.Optional;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -27,6 +28,7 @@
import tech.pegasys.teku.networking.p2p.reputation.ReputationAdjustment;
import tech.pegasys.teku.networking.p2p.rpc.RpcResponseListener;
import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSidecar;
import tech.pegasys.teku.spec.datastructures.blobs.versions.eip7594.DataColumnSidecar;
import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock;

public class ThrottlingSyncSource implements SyncSource {
Expand All @@ -38,21 +40,35 @@ public class ThrottlingSyncSource implements SyncSource {

private final RateTracker blocksRateTracker;
private final RateTracker blobSidecarsRateTracker;
private final RateTracker dataColumnSidecarsRateTracker;

public ThrottlingSyncSource(
final AsyncRunner asyncRunner,
final TimeProvider timeProvider,
final SyncSource delegate,
final int maxBlocksPerMinute,
final Optional<Integer> maybeMaxBlobSidecarsPerMinute) {
final Optional<Integer> maybeMaxBlobSidecarsPerMinute,
final Optional<Integer> maybeMaxDataColumnSidecarsPerMinute) {
this.asyncRunner = asyncRunner;
this.delegate = delegate;
this.blocksRateTracker = RateTracker.create(maxBlocksPerMinute, TIME_OUT, timeProvider);
this.blocksRateTracker =
RateTracker.create(maxBlocksPerMinute, TIME_OUT, timeProvider, "throttling-blocks");
this.blobSidecarsRateTracker =
maybeMaxBlobSidecarsPerMinute
.map(
maxBlobSidecarsPerMinute ->
RateTracker.create(maxBlobSidecarsPerMinute, TIME_OUT, timeProvider))
RateTracker.create(
maxBlobSidecarsPerMinute, TIME_OUT, timeProvider, "throttling-blobs"))
.orElse(RateTracker.NOOP);
this.dataColumnSidecarsRateTracker =
maybeMaxDataColumnSidecarsPerMinute
.map(
maxDataColumnSidecarsPerMinute ->
RateTracker.create(
maxDataColumnSidecarsPerMinute,
TIME_OUT,
timeProvider,
"throttling-dataColumn"))
.orElse(RateTracker.NOOP);
}

Expand Down Expand Up @@ -82,6 +98,22 @@ public SafeFuture<Void> requestBlobSidecarsByRange(
}
}

@Override
public SafeFuture<Void> requestDataColumnSidecarsByRange(
final UInt64 startSlot,
final UInt64 count,
final List<UInt64> columns,
final RpcResponseListener<DataColumnSidecar> listener) {
if (dataColumnSidecarsRateTracker.approveObjectsRequest(count.longValue()).isPresent()) {
LOG.debug("Sending request for {} data column sidecars on {} columns", count, columns.size());
return delegate.requestDataColumnSidecarsByRange(startSlot, count, columns, listener);
} else {
return asyncRunner.runAfterDelay(
() -> requestDataColumnSidecarsByRange(startSlot, count, columns, listener),
PEER_REQUEST_DELAY);
}
}

@Override
public SafeFuture<Void> disconnectCleanly(final DisconnectReason reason) {
return delegate.disconnectCleanly(reason);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class ThrottlingSyncSourceTest {
timeProvider,
delegate,
MAX_BLOCKS_PER_MINUTE,
Optional.of(MAX_BLOB_SIDECARS_PER_MINUTE));
Optional.of(MAX_BLOB_SIDECARS_PER_MINUTE),
Optional.empty());

@Test
void shouldDelegateDisconnectImmediately() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
import tech.pegasys.teku.beacon.sync.events.SyncState;
import tech.pegasys.teku.beacon.sync.events.SyncStateProvider;
import tech.pegasys.teku.beacon.sync.events.SyncStateTracker;
import tech.pegasys.teku.ethereum.performance.trackers.BlockProductionPerformanceFactory;
import tech.pegasys.teku.ethereum.performance.trackers.BlockProductionAndPublishingPerformanceFactory;
import tech.pegasys.teku.infrastructure.async.SafeFuture;
import tech.pegasys.teku.infrastructure.metrics.StubMetricsSystem;
import tech.pegasys.teku.infrastructure.metrics.Validator.ValidatorDutyMetricUtils;
import tech.pegasys.teku.infrastructure.time.SystemTimeProvider;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.networking.eth2.gossip.BlobSidecarGossipChannel;
import tech.pegasys.teku.networking.eth2.gossip.BlockGossipChannel;
import tech.pegasys.teku.networking.eth2.gossip.DataColumnSidecarGossipChannel;
import tech.pegasys.teku.networking.eth2.gossip.subnets.AttestationTopicSubscriber;
import tech.pegasys.teku.networking.eth2.gossip.subnets.SyncCommitteeSubscriptionManager;
import tech.pegasys.teku.spec.Spec;
Expand Down Expand Up @@ -84,6 +85,8 @@ public class ValidatorApiHandlerIntegrationTest {
mock(BlockBlobSidecarsTrackersPool.class);
private final BlobSidecarGossipChannel blobSidecarGossipChannel =
mock(BlobSidecarGossipChannel.class);
private final DataColumnSidecarGossipChannel dataColumnSidecarGossipChannel =
mock(DataColumnSidecarGossipChannel.class);
private final ChainDataProvider chainDataProvider = mock(ChainDataProvider.class);
private final NodeDataProvider nodeDataProvider = mock(NodeDataProvider.class);
private final ForkChoiceTrigger forkChoiceTrigger = mock(ForkChoiceTrigger.class);
Expand All @@ -109,6 +112,7 @@ public class ValidatorApiHandlerIntegrationTest {
blockGossipChannel,
blockBlobSidecarsTrackersPool,
blobSidecarGossipChannel,
dataColumnSidecarGossipChannel,
attestationPool,
attestationManager,
attestationTopicSubscriber,
Expand All @@ -121,7 +125,8 @@ public class ValidatorApiHandlerIntegrationTest {
syncCommitteeMessagePool,
syncCommitteeContributionPool,
syncCommitteeSubscriptionManager,
new BlockProductionPerformanceFactory(new SystemTimeProvider(), true, 0));
new BlockProductionAndPublishingPerformanceFactory(
new SystemTimeProvider(), __ -> UInt64.ZERO, true, 0, 0));

@BeforeEach
public void setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class DepositProviderBenchmark {
new DepositProvider(
metricsSystem,
mock(RecentChainData.class),
new Eth1DataCache(spec, metricsSystem, new Eth1VotingPeriod(spec)),
new Eth1DataCache(metricsSystem, new Eth1VotingPeriod(spec)),
mock(StorageUpdateChannel.class),
mock(Eth1DepositStorageChannel.class),
spec,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import org.apache.tuweni.bytes.Bytes32;
import tech.pegasys.teku.bls.BLSSignature;
import tech.pegasys.teku.ethereum.performance.trackers.BlockProductionPerformance;
import tech.pegasys.teku.ethereum.performance.trackers.BlockPublishingPerformance;
import tech.pegasys.teku.infrastructure.async.SafeFuture;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.Blob;
import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSidecar;
import tech.pegasys.teku.spec.datastructures.blobs.versions.eip7594.DataColumnSidecar;
import tech.pegasys.teku.spec.datastructures.blocks.SignedBeaconBlock;
import tech.pegasys.teku.spec.datastructures.blocks.SignedBlockContainer;
import tech.pegasys.teku.spec.datastructures.metadata.BlockContainerAndMetaData;
Expand All @@ -37,7 +40,12 @@ SafeFuture<BlockContainerAndMetaData> createUnsignedBlock(
Optional<UInt64> requestedBuilderBoostFactor,
BlockProductionPerformance blockProductionPerformance);

SafeFuture<SignedBeaconBlock> unblindSignedBlockIfBlinded(SignedBeaconBlock maybeBlindedBlock);
SafeFuture<SignedBeaconBlock> unblindSignedBlockIfBlinded(
SignedBeaconBlock maybeBlindedBlock, BlockPublishingPerformance blockPublishingPerformance);

List<BlobSidecar> createBlobSidecars(SignedBlockContainer blockContainer);
List<BlobSidecar> createBlobSidecars(
SignedBlockContainer blockContainer, BlockPublishingPerformance blockPublishingPerformance);

List<DataColumnSidecar> createDataColumnSidecars(
SignedBlockContainer blockContainer, List<Blob> blobs);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.apache.tuweni.bytes.Bytes32;
import tech.pegasys.teku.bls.BLSSignature;
import tech.pegasys.teku.ethereum.performance.trackers.BlockProductionPerformance;
import tech.pegasys.teku.ethereum.performance.trackers.BlockPublishingPerformance;
import tech.pegasys.teku.infrastructure.async.SafeFuture;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.Spec;
Expand Down Expand Up @@ -70,8 +71,12 @@ public SafeFuture<BlockContainerAndMetaData> createUnsignedBlock(
}

@Override
public List<BlobSidecar> createBlobSidecars(final SignedBlockContainer blockContainer) {
return operationSelector.createBlobSidecarsSelector().apply(blockContainer);
public List<BlobSidecar> createBlobSidecars(
final SignedBlockContainer blockContainer,
final BlockPublishingPerformance blockPublishingPerformance) {
return operationSelector
.createBlobSidecarsSelector(blockPublishingPerformance)
.apply(blockContainer);
}

private BlockContents createBlockContents(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright Consensys Software Inc., 2023
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

package tech.pegasys.teku.validator.coordinator;

import java.util.List;
import tech.pegasys.teku.kzg.KZG;
import tech.pegasys.teku.spec.Spec;
import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.Blob;
import tech.pegasys.teku.spec.datastructures.blobs.versions.eip7594.DataColumnSidecar;
import tech.pegasys.teku.spec.datastructures.blocks.SignedBlockContainer;
import tech.pegasys.teku.spec.logic.versions.eip7594.helpers.MiscHelpersEip7594;

public class BlockFactoryEip7594 extends BlockFactoryDeneb {
private final KZG kzg;

public BlockFactoryEip7594(
final Spec spec, final BlockOperationSelectorFactory operationSelector, final KZG kzg) {
super(spec, operationSelector);
this.kzg = kzg;
}

@Override
public List<DataColumnSidecar> createDataColumnSidecars(
final SignedBlockContainer blockContainer, List<Blob> blobs) {
final MiscHelpersEip7594 miscHelpersEip7594 =
MiscHelpersEip7594.required(spec.atSlot(blockContainer.getSlot()).miscHelpers());
return miscHelpersEip7594.constructDataColumnSidecars(
blockContainer.getSignedBlock(), blobs, kzg);
}
}
Loading