Skip to content

Conversation

@furszy
Copy link

@furszy furszy commented Jun 29, 2021

Reasons why we are having GA failures in validation_block_tests:

  1. The ASSERT_WITH_MSG is defined as ASSERT_WITH_MSG(validCondition, errorCauseStr) and not ASSERT_WITH_MSG(invalidCondition, errorCauseStr).
  2. CheckBlock is receiving blocks out of order and failing without setting the proper validation state.
    Future: Move tip contextual checks in CheckBlock to Accept/ConnectBlock.

it's `ASSERT_WITH_MSG(validCondition, errorCauseStr)`, and not `ASSERT_WITH_MSG(invalidCondition, errorCauseStr)`
@furszy furszy self-assigned this Jun 29, 2021
@furszy furszy added this to the 6.0.0 milestone Jun 29, 2021
@furszy furszy changed the title [bugFix] Wrong use of ASSERT_WITH_MSG in processnewblock_signals_ordering unit test. [bugFix] Wrong use of ASSERT_WITH_MSG in validation_block_tests and missing validation state set. Jun 30, 2021
@furszy furszy changed the title [bugFix] Wrong use of ASSERT_WITH_MSG in validation_block_tests and missing validation state set. [WIP][bugFix] Wrong use of ASSERT_WITH_MSG in validation_block_tests and missing validation state set. Jun 30, 2021
@furszy
Copy link
Author

furszy commented Jun 30, 2021

Closing this in favor of #2464. This fix is part of it.

@furszy furszy closed this Jun 30, 2021
random-zebra added a commit that referenced this pull request Jul 25, 2021
…ic + BIP61 removal.

8e9f2bc Net_processing: Minimize tier two messages search time and improve code. (furszy)
56a78fc Clean few compiler warnings in blockassembler, validation, rpcwallet and evo_deterministicmns_tests files. (furszy)
c398797 Refactor: Name GetDataMsg enum and replace ppszTypeName array for direct GetCommand call. (furszy)
f99c5ed Move-only: IsTransactionInChain functions moved inside zpivchain.cpp and made static as them are only used there. (furszy)
2e1af2b Remove IsBlockHashInChain function. Only used inside IsTransactionInChain. (furszy)
38d49ea Document 'DisconnectOldProtocol' call rationale in block processing. (furszy)
4f62c04 Remove now unneeded `fAccepted` flag from ProcessNewBlock. (furszy)
0d4ba29 Move block spam filter check to BlockChecked (furszy)
bd85440 Refactor: get rid off the error prone CValidationState argument in ProcessNewBlock. (furszy)
22b1757 validation: Proper validation state set for "out of order" check in CheckBlock. (furszy)
9606474 net_processing: Clean CheckBlockSpam code and add proper cs_main locks in State() call and mapBlockIndex access. (furszy)
e6d2bd6 net_processing: Remove duplicate, and wrong, peer misbehaving due an invalid arriving block. (furszy)
6a5df01 p2p: Remove BIP61 reject messages (furszy)

Pull request description:

  Continuation of #2463. Another error prone topic.

  Essentially focused in the following points:
  * Remove duplicate and incorrect peer misbehaving:
  -1) The peer misbehaving score set for an invalid arriving block is being performed inside `PeerLogicValidation::BlockChecked`.
  -2) The `CValidationState` param in `ProcessNewBlock` does not return the error nor the invalidity reason if the block is marked invalid during the activate best chain process (block connection), an empty `CValidationState` is set. The `BlockChecked` signal is used instead to notify the block invalidity reason.

  * Get rid off `CValidationState` param in `ProcessNewBlock` and use only `BlockChecked` (own version of ae22357)
  * Removal of BIP61 (bitcoin#15437 and bitcoin#18609).
  -- BIP61 could be disabled first by default before its removal like upstream did (or moved to its own standalone PR), but.. i don't think that worth to continue maintaining it, most likely no one is using it and if someone is actually using it, isn't good to have any piece of software depending on it. --
  * Move block spam filter check to `BlockChecked`. Following the same peer-processing-logic / block-connection-logic division. Improves the spam protection as now blocks rejected during the connection process are going to pass through the spam filter check as well (before, only blocks rejected during `AcceptBlock` were passing through it).
  Plus, this improvement let me do some further cleanup and remove the extra `fAccepted` flag from `ProcessNewBlock`.
  * Create `GetDataMsg` enum and replace `ppszTypeName` array for direct `GetCommand` call.
  The array was duplicated with the `NetMsgType` constants

ACKs for top commit:
  random-zebra:
    ACK 8e9f2bc

Tree-SHA512: 362219e995c857ac9ad45119d0cad24b1afcb94c807d5af60d7008dd985c3b324b5f2938d60890f89d610d214f69f6a6d5ef12d2ce4e6016480ad984d00706c4
@furszy furszy deleted the 2021_fix_validation_block_tests branch November 29, 2022 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant