Skip to content

Comments

Integrating das branch into master#9458

Merged
lucassaldanha merged 30 commits intoConsensys:masterfrom
lucassaldanha:master-das
May 29, 2025
Merged

Integrating das branch into master#9458
lucassaldanha merged 30 commits intoConsensys:masterfrom
lucassaldanha:master-das

Conversation

@lucassaldanha
Copy link
Member

PR Description

Integrating das branch into master.

Fixed Issue(s)

N/A

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@lucassaldanha lucassaldanha added the DO NOT MERGE Not ready to merge label May 22, 2025
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@lucassaldanha
Copy link
Member Author

Everything that was mapped as TODO-fulu has now a ticket to make sure we don't miss anything. All tickets are linked as sub-tasks on our PeerDAS cleanup epic (#9434).

@zilm13
Copy link
Contributor

zilm13 commented May 23, 2025

We should add this to commit comment if squash-merged

Co-authored-by: Dmitrii Shmatko <zilm@zilm.net>
Co-authored-by: Anton Nashatyrev <anton.nashatyrev@gmail.com>
Co-authored-by: Jeroen Ost <jeroen.ost2@sony.com>
Co-authored-by: Ekaterina Riazantseva <sibkatya@gmail.com>

@zilm13
Copy link
Contributor

zilm13 commented May 24, 2025

I've completed first round of review comparing it to das, looks good, nothing lost except #9408, which I guess, was not cherry-picked yet
Next round is casual review

jeroost and others added 8 commits May 26, 2025 10:08
also fixed `initDasCustody` a bit
 - missing finals
 - random anonymous code segments

Signed-off-by: Paul Harris <paul.harris@consensys.net>
Signed-off-by: Paul Harris <paul.harris@consensys.net>
start on some of the codeql comments

Signed-off-by: Paul Harris <paul.harris@consensys.net>
Signed-off-by: Paul Harris <paul.harris@consensys.net>
Comment on lines +245 to +254
final List<TestPeer> testNodes =
craftNodeIds()
.map(
nodeId ->
new TestPeer(stubAsyncRunner, nodeId, Duration.ofMillis(100))
.currentRequestLimit(1000))
.limit(128)
.peek(node -> custodyCountSupplier.setCustomCount(node.getNodeId(), columnCount))
.peek(testPeerManager::connectPeer)
.toList();

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'List testNodes' is never read.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zilm13 this unit test performanceTest() seems a bit odd. Help me understand what we are doing here?

rolfyone and others added 4 commits May 26, 2025 10:51
Signed-off-by: Paul Harris <paul.harris@consensys.net>
Signed-off-by: Paul Harris <paul.harris@consensys.net>
Copy link
Contributor

@zilm13 zilm13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First half of the review

headers.forEach(builder::header);
final Response response = httpClient.newCall(builder.build()).execute();
final ResponseBody body = response.body();
if (!response.isSuccessful()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It's more readable when not inverted


// Check that the sync is done and the peer was not disconnected.
assertThat(syncFuture).isCompleted();
verify(peer, never()).disconnectCleanly(any());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could add disconnectImmediately check if paranoid also


completeRequestWithBlocksAtSlots(blocksRequestFuture, denebSecondSlot, denebPeerSlotsAhead);

verifyBlobSidecarsAddedToPool(denebSecondSlot, slotsPerEpochMinimal, blobSidecarsBySlot);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this test. It delivers last BlobSidecar in a Fulu epoch, which shouldn't happen. Probably it's set with when but it shouldn't be like this anyway. I'd address it in a separate issue

when(recentChainData.getFinalizedEpoch()).thenReturn(denebPeerFinalizedEpoch);

final UInt64 slotsPerEpochMinimal = UInt64.valueOf(8);
final UInt64 denebLastSlot = denebFirstSlot.plus(slotsPerEpochMinimal);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's in FULU, not in deneb, there is even a check below

"Checking if block {} is in historic block roots {} of the state {}",
producedBlock,
state.getBlockRoots(),
state.getBlockRoots().hashTreeRoot(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could remove this parameter completely, not sure it makes any sense

SafeFuture<List<Optional<BlobAndProof>>> engineGetBlobAndProofs(
List<VersionedHash> blobVersionedHashes, UInt64 slot);

SafeFuture<List<BlobAndCellProofs>> engineGetBlobAndCellProofsList(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this interface difference. From the spec we either get all or nothing here. Maybe it should be wrapped with Optional<> too? I'd at least create an issue to revisit

}

@Override
public boolean isDataNotYetAvailable() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need Yet here and previously in BatchImportResult?

import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.Blob;
import tech.pegasys.teku.spec.datastructures.type.SszKZGProof;

public interface BlockContentsWithBlobsSchema<T extends BlockContainer>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BlockContents are always with Blobs, may worth renaming this and Signed container

@MethodSource("getExtendedSampleCountFixtures")
public void getExtendedSampleCountReturnsCorrectValues(
final int allowedFailures, final int numberOfSamples) {
assertThat(miscHelpersFulu.getExtendedSampleCount(UInt64.valueOf(allowedFailures)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd clarify in MiscHelpersFulu that called method that it's not actually used anymore to avoid any confusion. It was designed for lossy sampling which is not a part of the spec anymore. But called helper is still part of the spec surprisingly

Eth2Network.MINIMAL, capellaForkEpoch, denebForkEpoch, electraForkEpoch, fuluForkEpoch);
return create(config, SpecMilestone.FULU);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd restore removed javadoc here and change ELECTRA to FULU:

  // Our current config files contain FULU params.
  // So all specConfigs created from them will be FULU.
  // Here we just want to make sure that a given config supports the given milestone
  // (which useless in theory because they are all FULU)

@lucassaldanha lucassaldanha marked this pull request as ready for review May 26, 2025 21:05
Copy link
Contributor

@zilm13 zilm13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second and final part of the review

  1. I'm not sure on info, warn, error logging downgrade suggestions. If doesn't come to EventLogger, may be we could keep it? I've started commeinting on it but not sure now. There were several other info logs left that I had not commented (for example, in DataColumnSidecarAvailabilityChecker, GossipFailureLogger etc). They should be addressed if we decide to downgrade them all out of info.
  2. We may need to add finals everywhere, especially finals are missing in tests and testFixtures

* The request may complete with this exception when requested column is no more on our local
* canonical chain
*/
class NotOnCanonicalChainException extends RuntimeException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe IllegalStateException is more appropriate for it?

.toList();
}

LOG.info(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not info for production, it happens on every slot

.engineGetBlobAndCellProofsList(versionedHashes, slotAndBlockRoot.getSlot())
.thenAccept(
blobAndCellProofsList -> {
LOG.info("Found {} blobs", blobAndCellProofsList.size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downgrade level please

versionedHashes.size(),
blobAndCellProofsList.size());

LOG.info(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downgrade level please

}

private void logLocalElBlobsLookupFailure(final Throwable error) {
LOG.warn("Local EL blobs lookup failed: {}", getRootCauseMessage(error));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downgrade level please

@@ -61,6 +62,14 @@ public class InteropOptions {
description = "Represents the total number of validators in the network")
private int interopNumberOfValidators = InteropConfig.DEFAULT_INTEROP_NUMBER_OF_VALIDATORS;

@Option(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation of this option was dropped. We could have a separate issue for removal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,5 +1,5 @@
/*
* Copyright Consensys Software Inc., 2025
* Copyright Consensys Software Inc., 2024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional change?

@@ -147,6 +147,8 @@ private static DBOptions createDBOptions(
.setMaxBackgroundJobs(configuration.getMaxBackgroundJobs())
.setDbWriteBufferSize(configuration.getWriteBufferCapacity())
.setMaxOpenFiles(configuration.getMaxOpenFiles())
.setBytesPerSync(1_048_576L) // 1MB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both these settings should be removed as they were intentionally removed from the master and restored here by merge error

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

this.nodeId =
p2pNetwork
.getDiscoveryNodeId()
.orElseThrow(() -> new InvalidConfigurationException("NodeID is required"));
Copy link
Contributor

@zilm13 zilm13 May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something more friendly to user, say "Failed to get NodeId from Discovery System"

import tech.pegasys.teku.storage.client.RecentChainData;
import tech.pegasys.teku.storage.store.UpdatableStore;

public class BlobSidecarsAvailabilityCheckerTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it duplicates ForkChoiceBlobSidecarsAvailabilityCheckerTest. Remove this one, leave ForkChoiceBlobSidecarsAvailabilityCheckerTest

@lucassaldanha lucassaldanha removed the DO NOT MERGE Not ready to merge label May 29, 2025
@lucassaldanha lucassaldanha enabled auto-merge (squash) May 29, 2025 04:35
@lucassaldanha lucassaldanha merged commit 7856340 into Consensys:master May 29, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants