Skip to content

Conversation

@gfukushima
Copy link
Contributor

@gfukushima gfukushima commented Feb 10, 2023

Signed-off-by: Gabriel Fukushima [email protected]

PR description

This PR uses a new parameter to distinguish between bad imported blocks vs bad proposed blocks.
Main objective is stop adding proposed bad blocks to the badBlockManager.

Tested on local devnet beku + txfuzzer

Tested on sepolia + teku w/ validators proposing blocks (20/02)

Fixed Issue(s)

Fixes #5058

Documentation

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

Acceptance Tests (Non Mainnet)

  • I have considered running ./gradlew acceptanceTestNonMainnet locally if my PR affects non-mainnet modules.

Changelog

@gfukushima gfukushima changed the title [WIP] Add flag to distinguish when bad block is a proposed block [WIP] Add param to distinguish when bad block is a proposed block Feb 15, 2023
@gfukushima gfukushima marked this pull request as ready for review February 15, 2023 05:20
@gfukushima gfukushima changed the title [WIP] Add param to distinguish when bad block is a proposed block Differentiate proposed bad blocks from imported bad block Feb 15, 2023
Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

LGTM but I'm too close to this, would like someone else to approve

}

@Test
public void shouldNotRecordProposedBadBlockToBadBlockManager()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a test already to ensure that an invalid block we received does get added to the bad blocks?

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.

LGTM. some suggestions on test names

@fab-10
Copy link
Contributor

fab-10 commented Feb 16, 2023

pining @jflo since he worked on this before

@gfukushima gfukushima changed the title Differentiate proposed bad blocks from imported bad block Stop adding bad proposed block to bad block manager Feb 19, 2023
@gfukushima gfukushima enabled auto-merge (squash) February 22, 2023 00:06
@gfukushima gfukushima merged commit 66521cb into hyperledger:main Feb 22, 2023
ensi321 pushed a commit to ensi321/besu that referenced this pull request Mar 6, 2023
* Add flag to distinguish when bad block is a proposed block

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add flag to distinguish when bad block is a proposed block

Signed-off-by: Gabriel Fukushima <[email protected]>

* javadoc

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add shouldRecordBadBlock flag to stop adding proposed bad blocks to the bad block manager

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add overload to validateAndProcessBlock with shouldRecordBadBlock flag

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add unit test to ensure flag is being used to add blocks to bad block manager

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add unit test to ensure we don't add our own proposed bad block to the bad block manager

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add debug log when badBlock is not added

Signed-off-by: Gabriel Fukushima <[email protected]>

* Undo change done in the first approach

Signed-off-by: Gabriel Fukushima <[email protected]>

* Improve log

Signed-off-by: Gabriel Fukushima <[email protected]>

* Improve test names

Signed-off-by: Gabriel Fukushima <[email protected]>

* Improve javadoc of validateProposedBlock method

Signed-off-by: Gabriel Fukushima <[email protected]>

* Remove method from interface

Signed-off-by: Gabriel Fukushima <[email protected]>

* Change validateProposedBlock access modifier to private

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>
@gfukushima gfukushima deleted the dont-report-proposed-bad-blocks branch March 23, 2023 22:58
elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
* Add flag to distinguish when bad block is a proposed block

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add flag to distinguish when bad block is a proposed block

Signed-off-by: Gabriel Fukushima <[email protected]>

* javadoc

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add shouldRecordBadBlock flag to stop adding proposed bad blocks to the bad block manager

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add overload to validateAndProcessBlock with shouldRecordBadBlock flag

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add unit test to ensure flag is being used to add blocks to bad block manager

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add unit test to ensure we don't add our own proposed bad block to the bad block manager

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add debug log when badBlock is not added

Signed-off-by: Gabriel Fukushima <[email protected]>

* Undo change done in the first approach

Signed-off-by: Gabriel Fukushima <[email protected]>

* Improve log

Signed-off-by: Gabriel Fukushima <[email protected]>

* Improve test names

Signed-off-by: Gabriel Fukushima <[email protected]>

* Improve javadoc of validateProposedBlock method

Signed-off-by: Gabriel Fukushima <[email protected]>

* Remove method from interface

Signed-off-by: Gabriel Fukushima <[email protected]>

* Change validateProposedBlock access modifier to private

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[email protected]>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
* Add flag to distinguish when bad block is a proposed block

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add flag to distinguish when bad block is a proposed block

Signed-off-by: Gabriel Fukushima <[email protected]>

* javadoc

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add shouldRecordBadBlock flag to stop adding proposed bad blocks to the bad block manager

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add overload to validateAndProcessBlock with shouldRecordBadBlock flag

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add unit test to ensure flag is being used to add blocks to bad block manager

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add unit test to ensure we don't add our own proposed bad block to the bad block manager

Signed-off-by: Gabriel Fukushima <[email protected]>

* Add debug log when badBlock is not added

Signed-off-by: Gabriel Fukushima <[email protected]>

* Undo change done in the first approach

Signed-off-by: Gabriel Fukushima <[email protected]>

* Improve log

Signed-off-by: Gabriel Fukushima <[email protected]>

* Improve test names

Signed-off-by: Gabriel Fukushima <[email protected]>

* Improve javadoc of validateProposedBlock method

Signed-off-by: Gabriel Fukushima <[email protected]>

* Remove method from interface

Signed-off-by: Gabriel Fukushima <[email protected]>

* Change validateProposedBlock access modifier to private

Signed-off-by: Gabriel Fukushima <[email protected]>

---------

Signed-off-by: Gabriel Fukushima <[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.

Don't Record Bad Block When Proposing

6 participants