-
Notifications
You must be signed in to change notification settings - Fork 867
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
retry block processing #4600
retry block processing #4600
Conversation
Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Justin Florentine <justin+github@florentine.us>
…creator Signed-off-by: Justin Florentine <justin+github@florentine.us>
...merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java
Fixed
Show fixed
Hide fixed
...merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java
Fixed
Show fixed
Hide fixed
This pull request introduces 1 alert when merging e8f8efc into 0287ec5 - view on LGTM.com new alerts:
|
Signed-off-by: Justin Florentine <justin+github@florentine.us>
This pull request introduces 1 alert when merging 6239984 into 0287ec5 - view on LGTM.com new alerts:
|
…nator Signed-off-by: Justin Florentine <justin+github@florentine.us>
This pull request introduces 1 alert when merging 78dea2e into fcf640a - view on LGTM.com new alerts:
|
Signed-off-by: Justin Florentine <justin+github@florentine.us>
...merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java
Fixed
Show fixed
Hide fixed
...merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java
Fixed
Show fixed
Hide fixed
This pull request introduces 1 alert when merging 654e4c2 into fcf640a - view on LGTM.com new alerts:
|
Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Justin Florentine <justin+github@florentine.us>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but before shipping I have some questions and suggestions
...merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BadBlockManager.java
Show resolved
Hide resolved
...e/src/test/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinatorTest.java
Show resolved
Hide resolved
.../org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadTest.java
Outdated
Show resolved
Hide resolved
@Test | ||
public void shouldNotReturnInvalidOnThrownMerkleTrieException() { | ||
BlockHeader mockHeader = createBlockHeader(); | ||
when(blockchain.getBlockByHash(mockHeader.getHash())).thenReturn(Optional.empty()); | ||
when(blockchain.getBlockHeader(mockHeader.getParentHash())) | ||
.thenReturn(Optional.of(mock(BlockHeader.class))); | ||
when(mergeCoordinator.getLatestValidAncestor(any(BlockHeader.class))) | ||
.thenReturn(Optional.of(mockHash)); | ||
when(mergeCoordinator.latestValidAncestorDescendsFromTerminal(any(BlockHeader.class))) | ||
.thenReturn(true); | ||
when(mergeCoordinator.rememberBlock(any())).thenThrow(new MerkleTrieException("missing leaf")); | ||
|
||
var resp = resp(mockPayload(mockHeader, Collections.emptyList())); | ||
|
||
verify(engineCallListener, times(1)).executionEngineCalled(); | ||
verify(mergeCoordinator, never()).addBadBlock(any(), any()); | ||
// verify mainnetBlockValidator does not add to bad block manager | ||
|
||
fromErrorResp(resp); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's me or this seems equals to the previous test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous test was covering that the exception had been caught, and wrapped into a Result. This is the case where it is not handled, and the exception is thrown upward of rememberBlock().
} | ||
badBlockManager.addBadBlock(invalidBlock, result.causedBy()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before an internal error did not cause the block to be added to the bad list, now it is always added, is this wanted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filtering out of badBlocks with a causedBy that is internal is now handled inside the badBlockManager
@@ -78,4 +83,12 @@ public void addLatestValidHash(final Hash blockHash, final Hash latestValidHash) | |||
public Optional<Hash> getLatestValidHash(final Hash blockHash) { | |||
return Optional.ofNullable(latestValidHashes.getIfPresent(blockHash)); | |||
} | |||
|
|||
public boolean isInternalError(final Throwable causedBy) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private?
Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Justin Florentine <justin+github@florentine.us>
* aggresively seeking out other places to defend from this Signed-off-by: Justin Florentine <justin+github@florentine.us> Co-authored-by: Justin Florentine <justin+github@florentine.us> Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
* aggresively seeking out other places to defend from this Signed-off-by: Justin Florentine <justin+github@florentine.us> Co-authored-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Justin Florentine justin+github@florentine.us
Documentation
doc-change-required
label to this PR ifupdates are required.
Changelog