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

Caching changes during block production #8773

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

StefanBratanov
Copy link
Contributor

@StefanBratanov StefanBratanov commented Oct 23, 2024

PR Description

Essentially, return the same block if the createBlock endpoint is called twice. This means we no longer require the changes in #8766

Fixed Issue(s)

fixes #8625

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.

@StefanBratanov StefanBratanov marked this pull request as ready for review October 23, 2024 08:05
@StefanBratanov StefanBratanov changed the title Caching changes in ExecutionLayerBlockProductionManager Caching changes during block production Oct 23, 2024
Copy link
Contributor

@tbenr tbenr left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +886 to +892
private boolean isLocallyCreatedBlock(final UInt64 slot) {
final SafeFuture<Optional<BlockContainerAndMetaData>> localBlockProduction =
localBlockProductionBySlotCache.get(slot);
if (localBlockProduction == null) {
return false;
}
return localBlockProduction.isCompletedNormally();
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 keep the blockRoot check here.

like

if (localBlockProduction == null) {
  return false;
}

if(! localBlockProduction.isCompletedNormally()) {
return false;
}
return localBlockProduction.join() .... .equals(.....));

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.

[SSV] Fix cache behaviour when requesting blocks in parallel
2 participants