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

Finalized transitioned anchor #8850

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

Conversation

gfukushima
Copy link
Contributor

PR Description

PR based on top of with some extra test coverage for the changes made in RecentChain and AttestationStateSelector

Fixed Issue(s)

Fixes #7956

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 and others added 28 commits February 22, 2024 09:11
Signed-off-by: Gabriel Fukushima <[email protected]>
… the state transitioned scenario

Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
# Conflicts:
#	CHANGELOG.md
#	beacon/validator/src/test/java/tech/pegasys/teku/validator/coordinator/DepositProviderTest.java
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
@gfukushima gfukushima marked this pull request as draft November 26, 2024 10:13
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
@gfukushima gfukushima marked this pull request as ready for review November 28, 2024 02:00
private static final byte[] SEED = new byte[] {0x11, 0x03, 0x04};

@Test
@SuppressWarnings("DoNotCreateSecureRandomDirectly")
Copy link
Contributor

Choose a reason for hiding this comment

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

we are probably better off using DataStructureUtil to get random objects rather than referencing rnd unless there's a really good reason?

@@ -88,6 +88,7 @@ public SafeFuture<Optional<BeaconState>> getStateToValidate(
// If the attestation is within the lookahead period for the finalized state, use that
// If the target block doesn't descend from finalized the attestation is invalid
final BeaconState finalizedState = recentChainData.getStore().getLatestFinalized().getState();
// TODO: Test
Copy link
Contributor

Choose a reason for hiding this comment

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

todo..

chainUpdater2.initializeGenesis(false);
chainUpdater2.updateBestBlock(chainUpdater2.advanceChain(11));

// chainUpdater2.updateBestBlock(chainUpdater.advanceChain(11));
Copy link
Contributor

Choose a reason for hiding this comment

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

extras..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Comment on lines 332 to 333
public void warnFailedToLoadInitialState(final Throwable throwable) {
log.warn("Failed to load initial state", throwable);
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't really want the stack trace if we can avoid it, do we jsut want the throwable.getMessage?

STATUS_LOG.warnFailedToLoadInitialState(e.getMessage());
STATUS_LOG.warnFailedToLoadInitialState(ex);
Copy link
Contributor

Choose a reason for hiding this comment

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

would prefer no stacktrace on status log...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed the method to only print the log the message but the param we're passing could remain the throwable I think

@@ -466,6 +468,7 @@ public Checkpoint getFinalizedCheckpoint() {
}
}

// TODO: Test me
Copy link
Contributor

Choose a reason for hiding this comment

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

todos in this file

// blockRoot should be from last non-empty block
assertThat(recentChainData.getChainHead().map(MinimalBeaconBlockSummary::getRoot))
.contains(anchorPoint.getRoot());
// head should be
Copy link
Contributor

Choose a reason for hiding this comment

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

expand comments to be readable or remove...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed comment

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.

Checkpoint sync is not working when finalized state is transitioned with empty slots
4 participants