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

Clean up pivot selector from peers and unit test #8020

Conversation

Matilda-Clerke
Copy link
Contributor

@Matilda-Clerke Matilda-Clerke commented Dec 11, 2024

PR description

Simplify the code in PivotSelectorFromPeers.

Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
…' into clean-up-PivotSelectorFromPeers-and-unit-test
…eers-method

# Conflicts:
#	ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastSyncActions.java
#	ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotBlockConfirmer.java
#	ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromSafeBlock.java
#	ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/FastSyncActionsTest.java
Signed-off-by: Matilda Clerke <[email protected]>
…' into clean-up-PivotSelectorFromPeers-and-unit-test
…ode back separate thread to avoid infinite loop waiting for peers during acceptance tests

Signed-off-by: Matilda Clerke <[email protected]>
…' into clean-up-PivotSelectorFromPeers-and-unit-test
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
…nd-unit-test

# Conflicts:
#	ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/task/AbstractRetryingPeerTask.java
Signed-off-by: Matilda Clerke <[email protected]>
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

just a Q about logging

}

private boolean canPeerDeterminePivotBlock(final EthPeer peer) {
LOG.debug(
Copy link
Contributor

Choose a reason for hiding this comment

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

we're losing this log line, is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not a particularly good log as it doesn't include any context and is likely to end up listing peers. I can look to add something similar if you think it's worthwhile

Copy link
Contributor

Choose a reason for hiding this comment

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

all good just checking it won't be missed

@Matilda-Clerke Matilda-Clerke enabled auto-merge (squash) December 19, 2024 21:10
@Matilda-Clerke Matilda-Clerke merged commit 86fe1ba into hyperledger:main Dec 19, 2024
43 checks passed
garyschulte pushed a commit that referenced this pull request Dec 20, 2024
* 7582: Add waitForPeer method to PeerSelector and EthPeers

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Replace all usages of WaitForPeer[s]Task with new EthPeers.waitForPeer method

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Fix PivotBlockConfirmerTest

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: spotless

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Fix broken PivotBlockRetrieverTest

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Fix broken FastSyncActionsTest

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: spotless

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Simplify PivotSelectorFromPeers.selectNewPivotBlock and add unit tests

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Fix issues after merge

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Put AbstractSyncTargetManager.waitForPeerAndThenSetSyncTarget code back separate thread to avoid infinite loop waiting for peers during acceptance tests

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Remove pivot block checks when waiting for peer in FastSyncActions

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Remove estimated chain height check from PivotBlockConfirmer when waiting for peers

Signed-off-by: Matilda Clerke <[email protected]>

* 7582: Fix broken PivotBlockRetrieverTest

Signed-off-by: Matilda Clerke <[email protected]>

* Fix compile errors

Signed-off-by: Matilda Clerke <[email protected]>

* spotless

Signed-off-by: Matilda Clerke <[email protected]>

* Refactor mockito usage

Signed-off-by: Matilda Clerke <[email protected]>

---------

Signed-off-by: Matilda Clerke <[email protected]>
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.

2 participants