Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
test_address_resolution test_compute_share_target \
test_utxo test_dgb_subsidy test_dgb_coinbase_value dgb_share_test dgb_redistribute_test dgb_block_assembly_test dgb_header_sample_build_test dgb_header_ingest_test dgb_mempool_ingest_test \
dgb_gentx_coinbase_test dgb_connection_coinbase_test dgb_pplns_payout_split_test nmc_auxpow_merkle_test nmc_template_builder_test nmc_auxpow_wire_test nmc_reconstruct_won_block_test dgb_gentx_share_path_test dgb_conn_pplns_producer_test dgb_other_tx_resolver_test \
dgb_other_tx_assembler_test dgb_reconstruct_won_block_test dgb_reconstruct_closure_test dgb_gentx_unpack_test dgb_work_source_test dgb_template_builder_test dgb_embedded_coin_node_test dgb_embedded_tx_select_test dgb_template_other_txs_test dgb_coinbase_value_parity_test dgb_submit_classify_test dgb_aux_parent_coinbase_parity_test dgb_template_capture_test dgb_aux_doge_db_commitment_bind_test dgb_aux_doge_dc_proof_test \
dgb_other_tx_assembler_test dgb_reconstruct_won_block_test dgb_reconstruct_closure_test dgb_gentx_unpack_test dgb_work_source_test dgb_template_builder_test dgb_embedded_coin_node_test dgb_embedded_tx_select_test dgb_template_other_txs_test dgb_coinbase_value_parity_test dgb_submit_classify_test dgb_aux_parent_coinbase_parity_test dgb_template_capture_test dgb_aux_doge_db_commitment_bind_test dgb_aux_doge_dc_proof_test dgb_aux_doge_bind_parsers_test \
rpc_request_test softfork_check_test genesis_check_test algo_select_test digishield_walk_test header_chain_test \
dgb_coin_node_seam_test dgb_block_broadcast_test dgb_won_block_dispatch_test dgb_forced_won_share_dualpath_test dgb_scrypt_pow_test dgb_nonce_grinder_test dgb_regrind_block_test dgb_won_block_finalize_test dgb_share_target_genesis_test dgb_pool_msg_wire_test dgb_get_shares_walk_test dgb_download_stops_test dgb_think_p1_walk_bounds_test dgb_think_p1_desired_emit_test dgb_think_p6_desired_cutoff_test dgb_think_p4_head_keys_test dgb_think_p3_best_head_test dgb_g1_oracle_byte_parity_test dgb_think_p2_walk_bounds_test dgb_expected_time_to_block_test dgb_pool_efficiency_test dgb_think_p5_best_share_punish_test v37_test \
-j$(nproc)
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
test_address_resolution test_compute_share_target \
test_utxo test_dgb_subsidy test_dgb_coinbase_value dgb_share_test dgb_redistribute_test dgb_block_assembly_test dgb_header_sample_build_test dgb_header_ingest_test dgb_mempool_ingest_test \
dgb_gentx_coinbase_test dgb_connection_coinbase_test dgb_pplns_payout_split_test nmc_auxpow_merkle_test nmc_template_builder_test nmc_auxpow_wire_test nmc_reconstruct_won_block_test dgb_gentx_share_path_test dgb_conn_pplns_producer_test dgb_other_tx_resolver_test \
dgb_other_tx_assembler_test dgb_reconstruct_won_block_test dgb_reconstruct_closure_test dgb_gentx_unpack_test dgb_work_source_test dgb_template_builder_test dgb_embedded_coin_node_test dgb_embedded_tx_select_test dgb_template_other_txs_test dgb_coinbase_value_parity_test dgb_submit_classify_test dgb_aux_parent_coinbase_parity_test dgb_template_capture_test dgb_aux_doge_db_commitment_bind_test dgb_aux_doge_dc_proof_test \
dgb_other_tx_assembler_test dgb_reconstruct_won_block_test dgb_reconstruct_closure_test dgb_gentx_unpack_test dgb_work_source_test dgb_template_builder_test dgb_embedded_coin_node_test dgb_embedded_tx_select_test dgb_template_other_txs_test dgb_coinbase_value_parity_test dgb_submit_classify_test dgb_aux_parent_coinbase_parity_test dgb_template_capture_test dgb_aux_doge_db_commitment_bind_test dgb_aux_doge_dc_proof_test dgb_aux_doge_bind_parsers_test \
rpc_request_test softfork_check_test genesis_check_test algo_select_test digishield_walk_test header_chain_test \
dgb_coin_node_seam_test dgb_block_broadcast_test dgb_won_block_dispatch_test dgb_forced_won_share_dualpath_test dgb_scrypt_pow_test dgb_nonce_grinder_test dgb_regrind_block_test dgb_won_block_finalize_test dgb_share_target_genesis_test dgb_pool_msg_wire_test dgb_get_shares_walk_test dgb_download_stops_test dgb_think_p1_walk_bounds_test dgb_think_p1_desired_emit_test dgb_think_p6_desired_cutoff_test dgb_think_p4_head_keys_test dgb_think_p3_best_head_test dgb_g1_oracle_byte_parity_test dgb_think_p2_walk_bounds_test dgb_expected_time_to_block_test dgb_pool_efficiency_test dgb_think_p5_best_share_punish_test test_coin_broadcaster test_multiaddress_pplns test_pplns_stress \
v37_test \
Expand Down
74 changes: 58 additions & 16 deletions src/impl/dgb/coin/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@
#ifdef AUX_DOGE
// DOGE merged-mining aux module (STRETCH; -DAUX_DOGE=ON only). dgb CONSUMES the
// shared aux types; ltc-doge owns and is the sole modifier of src/impl/doge/coin/aux_*.
// Forward declaration only at slice #3 -- the real
// <impl/doge/coin/aux_chain_embedded.hpp> include lands with the
// bind_aux_doge_parsers() body at M3.
namespace doge { namespace coin { class AuxChainEmbedded; } }
// M3: the REAL shared-module includes that let bind_aux_doge_parsers() instantiate
// the structured AuxPoW parser with the DGB parent coinbase type. Pulling these in
// here (under AUX_DOGE only) is what ODR-USES the DGB-parent template emissions
// (parse_aux_header<dgb::coin::MutableTransaction> / CAuxPow<dgb::coin::Mutable-
// Transaction>) inside the PRODUCTION dgb object library, not merely in fixtures.
#include <functional>

#include <core/pack.hpp> // PackStream (the byte stream the parser reads)
#include <impl/doge/coin/auxpow.hpp> // shared SSOT: CAuxPow<>, parse_aux_header<>, CPureBlockHeader
#include <impl/dgb/coin/transaction.hpp> // dgb::coin::MutableTransaction (the DGB parent coinbase type)
#include <impl/dgb/coin/aux_doge_parent_traits.hpp> // doge::coin::parent_coinbase_no_witness<dgb::coin::MutableTransaction>
#endif

namespace dgb
Expand All @@ -47,14 +54,27 @@ namespace coin

#ifdef AUX_DOGE
// ---------------------------------------------------------------------------
// DOGE merged-mining aux seam -- header-only type alias (slice #3, option b per
// integrator UID-904). Names the shared src/impl/doge aux-module backend that
// bind_aux_doge_parsers() wires onto the (M3) coin P2P layer. No new TU; no
// effect on the default Scrypt-only standalone build (which never defines
// AUX_DOGE). The structured parsers consumed at M3 bind time are the free
// functions doge::coin::parse_doge_header / parse_doge_headers_message /
// parse_doge_block (auxpow_header.hpp). Parity: p2pool-merged-v36.
using AuxChainBackend = ::doge::coin::AuxChainEmbedded; // IAuxChainBackend impl
// DOGE merged-mining aux seam (M3 body; -DAUX_DOGE=ON only). The DGB-as-parent
// structured AuxPoW parse contract, bound onto the production dgb object lib by
// bind_aux_doge_parsers(). The shared module's parser is templated on the parent
// coinbase type; here we pin it to dgb::coin::MutableTransaction so the DGB-parent
// CAuxPow<> / parse_aux_header<> template instantiations are emitted and ODR-used
// in production (not only in test fixtures). Parity: p2pool-merged-v36.
//
// AuxDogeParse: the result of feeding a (possibly AuxPoW-extended) DOGE header
// blob through the DGB-parent parser -- the 80-byte child header, the structured
// CAuxPow<dgb> proof, and whether an aux proof was present.
struct AuxDogeParse
{
::doge::coin::CPureBlockHeader m_header; // 80-byte child header
::doge::coin::CAuxPow<dgb::coin::MutableTransaction> m_aux; // structured DGB-parent proof
bool m_has_aux{}; // AuxPoW version-bit present
};

// The bound parser callable: consumes bytes from a PackStream and yields the
// DGB-parent parse. std::function so bind_aux_doge_parsers() can ASSIGN it (real,
// callable binding -- never a no-op), forcing ODR-use of the templated parser.
using AuxDogeParserFn = std::function<AuxDogeParse(PackStream&)>;
#endif

template <typename ConfigType>
Expand Down Expand Up @@ -88,10 +108,32 @@ class Node : public dgb::interfaces::Node
NodeRPC* rpc() { return m_rpc.get(); }

#ifdef AUX_DOGE
// DOGE merged-mining aux seam (STRETCH; -DAUX_DOGE=ON only). Binds the shared
// src/impl/doge aux module's parsers onto the (M3) coin P2P layer. Declaration
// only -- no body until NodeP2P is ported. Parity: p2pool-merged-v36.
void bind_aux_doge_parsers();
// DOGE merged-mining aux seam (STRETCH; -DAUX_DOGE=ON only). The DGB-parent
// structured AuxPoW parser, bound by bind_aux_doge_parsers(). Unbound until
// bind is called. Parity: p2pool-merged-v36.
AuxDogeParserFn m_aux_doge_parser;

// Binds the shared src/impl/doge aux module's structured parser onto the dgb
// node, pinned to the DGB parent coinbase type. The body is a genuine callable
// binding (NOT a no-op): it assigns m_aux_doge_parser to a lambda that drives
// bytes through doge::coin::parse_aux_header<dgb::coin::MutableTransaction>().
// Inline (the class is templated; an out-of-line def would need explicit
// instantiation) -- matches the existing inline run(). This is what ODR-USES /
// emits the DGB-parent CAuxPow<> + parse_aux_header<> instantiations in the
// production dgb object library. NodeP2P (not yet ported) will route relayed
// DOGE headers through m_aux_doge_parser at M3 live-dispatch time.
void bind_aux_doge_parsers()
{
m_aux_doge_parser = [](PackStream& s) -> AuxDogeParse {
AuxDogeParse out;
out.m_header = ::doge::coin::parse_aux_header<PackStream, dgb::coin::MutableTransaction>(
s, out.m_aux, out.m_has_aux);
return out;
};
}

// Accessor for the bound parser (test surface + future NodeP2P dispatch).
const AuxDogeParserFn& aux_doge_parser() const { return m_aux_doge_parser; }
#endif
};

Expand Down
18 changes: 18 additions & 0 deletions src/impl/dgb/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,24 @@ if (BUILD_TESTING AND GTest_FOUND)
dgb_coin pool sharechain)
gtest_add_tests(dgb_aux_doge_dc_proof_test "" AUTO)

# --- DGB+DOGE (M3) -- bind_aux_doge_parsers() PRODUCTION-binding KAT --------
# Proves the production dgb node seam coin/node.hpp's bind_aux_doge_parsers()
# is NON-HOLLOW: it instantiates a dgb::coin::Node, calls the (now real) bind
# body, and drives a canonical DGB-parent AuxPoW blob THROUGH the bound member
# -- ODR-USING parse_aux_header<dgb::coin::MutableTransaction> + CAuxPow<dgb::
# coin::MutableTransaction> in the PRODUCTION dgb object library, not merely in
# fixtures. Links the production dgb lib + ltc_coin like the DB/DC siblings --
# the -DAUX_DOGE consumption path legitimately couples to ltc. Test-only;
# consumes the shared module, modifies nothing in src/impl/doge. MUST appear in
# BOTH this registration AND the build.yml --target allowlist (#143 NOT_BUILT).
add_executable(dgb_aux_doge_bind_parsers_test aux_doge_bind_parsers_test.cpp)
target_link_libraries(dgb_aux_doge_bind_parsers_test PRIVATE
GTest::gtest_main GTest::gtest
core dgb ltc_coin
c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage
dgb_coin pool sharechain)
gtest_add_tests(dgb_aux_doge_bind_parsers_test "" AUTO)

# dgb_share_target_genesis_test: FENCED KAT pinning ShareTracker::compute_
# share_target genesis/unknown-prev clamp to [MAX_TARGET/30, MAX_TARGET] vs
# the DGB oracle data.py generate_transaction. Links the same proven set as
Expand Down
Loading
Loading