Add PoA/BFT and experimental P2P routing prototype (feature-flagged) #35953

pull Lamcute-lan wants to merge 2 commits into bitcoin:master from Lamcute-lan:lamcute-lan-poa-bft-prototype changing 6 files +92 −0
  1. Lamcute-lan commented at 6:27 AM on August 12, 2026: none

    Why

    This PR introduces a small, feature-flagged prototype scaffold for Proof-of-Authority (PoA) + lightweight BFT and an experimental P2P routing layer. The goal is to provide a safe place to iterate on PoA/BFT and routing ideas behind a runtime flag (-enable-poa) without changing default behavior for users who do not opt in.

    Summary of approach

    • Add a minimal PoA/BFT module (poa::InitPoA / ShutdownPoA / IsPoAEnabled) and a placeholder experimental P2P routing layer (p2p::InitRouting / ShutdownRouting). These subsystems are initialized at startup only when -enable-poa is set.
    • Hook initialization into src/init.cpp and include the new sources in CMakeLists.txt.
    • Prototype changes include two consensus-impacting edits done during prototyping: src/consensus/amount.h (MAX_MONEY adjusted to allow effectively unlimited supply for experimentation) and src/validation.cpp (simple miner-cooldown check prototype). These are HIGH-RISK consensus changes and are present only for private/test usage/prototyping. They will cause a hard fork if enabled on a public network and require careful review.

    What changed (high level)

    • New files: src/poa/poa.h, src/poa/poa.cpp, src/p2p/routing.h, src/p2p/routing.cpp
    • Modified startup/init to initialize PoA and routing when -enable-poa is set (src/init.cpp)
    • Updated build to compile the prototype sources (src/CMakeLists.txt)
    • Prototype consensus edits for experimentation: src/consensus/amount.h and src/validation.cpp

    Important notes and review requests

    • These edits are explicitly experimental. The PoA/BFT and routing code are scaffolding/placeholders with TODOs for validator registry, signed block proposals, signature aggregation, leader election, and P2P overlay algorithms.
    • The consensus edits are dangerous. Reviewers should flag any unintended consensus changes. If the intent is to keep this PR non-consensus (only scaffolding), the consensus edits must be reverted and moved behind feature-guarding or removed entirely before wider review.
    • No unit or functional tests are included. Adding tests and a test plan (regtest/testnet flows) is required before merging.

    Testing / How to run

    • Build as usual. Run bitcoind/bitcoin-qt locally. To enable the prototype behavior at runtime: bitcoind -enable-poa
    • Exercise on a private regtest/testnet; do NOT enable on mainnet. The consensus edits will change chain rules and can cause forks.

    Follow-ups

    • Implement validator registry (on-disk + on-chain option), robust validator identity (pubkeys), and signed block headers.
    • Replace ad-hoc miner identity heuristic with on-chain-registered validator identity and signed blocks.
    • Add BFT commit layer (threshold signatures / multisig) and leader selection (round-robin or verifiable random) behind feature flag and tests.
    • Design slashing/penalty and migration/upgrade plan; comprehensive security review required.

    If any of the consensus edits should not be included in this PR, say so and I will revert them and push an updated branch.

  2. Add PoA/BFT & P2P routing prototype (feature-flagged)
    Scaffold poa and p2p routing modules; initialize when -enable-poa is set. Add CMake entries and init hooks.
    
    Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
    6769c49181
  3. DrahtBot commented at 6:27 AM on August 12, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35953.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. Revert experimental consensus edits: restore amount.h and validation.cpp to upstream to avoid consensus changes in prototype PR f4c1cd00ef
  5. Lamcute-lan commented at 6:30 AM on August 12, 2026: none

    Update: Reverted the experimental consensus-critical edits (amount.h and validation.cpp) from this branch and restored upstream versions. The PR now contains only PoA/BFT and P2P routing scaffolding and init hooks. This reduces the risk of unintentional consensus changes while we iterate on the prototype. Please let me know if you want the consensus experiments moved to a separate branch.

  6. achow101 closed this on Aug 12, 2026


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-08-21 04:51 UTC

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