Rework same-chain from abusing DoS banning, to explicit checks #10512

pull luke-jr wants to merge 8 commits into bitcoin:master from luke-jr:samechain_rework changing 6 files +156 −63
  1. luke-jr commented at 10:05 PM on June 2, 2017: member

    This fixes bugs where we end up banning peers running different consensus rules (including old nodes following a softfork). Since we rely on having peers enforcing the same rules as us, it also enforces that outbound non-feeler connections must have and maintain the same tip block; if they diverge from us, we disconnect them (and find a replacement).

  2. validation: Combine all 3 block-invalidation logics into one function c64fb2381f
  3. Bugfix: Exclude known-invalid blocks from pindexBestHeader de5f9fb348
  4. Bugfix: Do not DoS-ban for invalid prev block, since old nodes may forward such in the event of a softfork 7a73c44d17
  5. Bugfix: Don't ban peers just because they have header chains we consider invalid d8bab24adf
  6. gmaxwell commented at 8:22 PM on June 5, 2017: contributor

    bleh please don't use reject for this.

  7. laanwj added the label P2P on Jun 6, 2017
  8. laanwj added the label Validation on Jun 6, 2017
  9. luke-jr commented at 6:42 AM on June 8, 2017: member

    @gmaxwell Do you have a better solution? It doesn't seem like we have any other way to determine that case?

  10. luke-jr force-pushed on Jun 9, 2017
  11. Require outbound non-feeler connections use the same tip block as us 6b85ced449
  12. If an outbound-and-not-feeler peer rejects a block we send them, they presumably are on a different tip, and therefore we disconnect them 0d5d631270
  13. net: Log unmatching-tip disconnections 39ce020c2f
  14. net: Tolerate unmatching tips on whitelisted and addnode'd peers 4c322c8964
  15. luke-jr commented at 6:32 AM on June 13, 2017: member

    This breaks because compact blocks allows relaying invalid blocks without penalty, but there is no indication at all even later, whether the peer sending you the compact block has accepted it himself or not... so basically we can almost never know if a compact-block peer is on a different tip than us.

    Ideas for how to solve this?

  16. luke-jr force-pushed on Jun 13, 2017
  17. luke-jr closed this on Jun 14, 2017

  18. luke-jr commented at 9:43 PM on June 14, 2017: member

    Closed due to impracticality, and superceded by #10593

  19. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me