3333#ifdef AUX_DOGE
3434// DOGE merged-mining aux module (STRETCH; -DAUX_DOGE=ON only). dgb CONSUMES the
3535// shared aux types; ltc-doge owns and is the sole modifier of src/impl/doge/coin/aux_*.
36- // Forward declaration only at slice #3 -- the real
37- // <impl/doge/coin/aux_chain_embedded.hpp> include lands with the
38- // bind_aux_doge_parsers() body at M3.
39- namespace doge { namespace coin { class AuxChainEmbedded ; } }
36+ // M3: the REAL shared-module includes that let bind_aux_doge_parsers() instantiate
37+ // the structured AuxPoW parser with the DGB parent coinbase type. Pulling these in
38+ // here (under AUX_DOGE only) is what ODR-USES the DGB-parent template emissions
39+ // (parse_aux_header<dgb::coin::MutableTransaction> / CAuxPow<dgb::coin::Mutable-
40+ // Transaction>) inside the PRODUCTION dgb object library, not merely in fixtures.
41+ #include < functional>
42+
43+ #include < core/pack.hpp> // PackStream (the byte stream the parser reads)
44+ #include < impl/doge/coin/auxpow.hpp> // shared SSOT: CAuxPow<>, parse_aux_header<>, CPureBlockHeader
45+ #include < impl/dgb/coin/transaction.hpp> // dgb::coin::MutableTransaction (the DGB parent coinbase type)
46+ #include < impl/dgb/coin/aux_doge_parent_traits.hpp> // doge::coin::parent_coinbase_no_witness<dgb::coin::MutableTransaction>
4047#endif
4148
4249namespace dgb
@@ -47,14 +54,27 @@ namespace coin
4754
4855#ifdef AUX_DOGE
4956// ---------------------------------------------------------------------------
50- // DOGE merged-mining aux seam -- header-only type alias (slice #3, option b per
51- // integrator UID-904). Names the shared src/impl/doge aux-module backend that
52- // bind_aux_doge_parsers() wires onto the (M3) coin P2P layer. No new TU; no
53- // effect on the default Scrypt-only standalone build (which never defines
54- // AUX_DOGE). The structured parsers consumed at M3 bind time are the free
55- // functions doge::coin::parse_doge_header / parse_doge_headers_message /
56- // parse_doge_block (auxpow_header.hpp). Parity: p2pool-merged-v36.
57- using AuxChainBackend = ::doge::coin::AuxChainEmbedded; // IAuxChainBackend impl
57+ // DOGE merged-mining aux seam (M3 body; -DAUX_DOGE=ON only). The DGB-as-parent
58+ // structured AuxPoW parse contract, bound onto the production dgb object lib by
59+ // bind_aux_doge_parsers(). The shared module's parser is templated on the parent
60+ // coinbase type; here we pin it to dgb::coin::MutableTransaction so the DGB-parent
61+ // CAuxPow<> / parse_aux_header<> template instantiations are emitted and ODR-used
62+ // in production (not only in test fixtures). Parity: p2pool-merged-v36.
63+ //
64+ // AuxDogeParse: the result of feeding a (possibly AuxPoW-extended) DOGE header
65+ // blob through the DGB-parent parser -- the 80-byte child header, the structured
66+ // CAuxPow<dgb> proof, and whether an aux proof was present.
67+ struct AuxDogeParse
68+ {
69+ ::doge::coin::CPureBlockHeader m_header; // 80-byte child header
70+ ::doge::coin::CAuxPow<dgb::coin::MutableTransaction> m_aux; // structured DGB-parent proof
71+ bool m_has_aux{}; // AuxPoW version-bit present
72+ };
73+
74+ // The bound parser callable: consumes bytes from a PackStream and yields the
75+ // DGB-parent parse. std::function so bind_aux_doge_parsers() can ASSIGN it (real,
76+ // callable binding -- never a no-op), forcing ODR-use of the templated parser.
77+ using AuxDogeParserFn = std::function<AuxDogeParse(PackStream&)>;
5878#endif
5979
6080template <typename ConfigType>
@@ -88,10 +108,32 @@ class Node : public dgb::interfaces::Node
88108 NodeRPC* rpc () { return m_rpc.get (); }
89109
90110#ifdef AUX_DOGE
91- // DOGE merged-mining aux seam (STRETCH; -DAUX_DOGE=ON only). Binds the shared
92- // src/impl/doge aux module's parsers onto the (M3) coin P2P layer. Declaration
93- // only -- no body until NodeP2P is ported. Parity: p2pool-merged-v36.
94- void bind_aux_doge_parsers ();
111+ // DOGE merged-mining aux seam (STRETCH; -DAUX_DOGE=ON only). The DGB-parent
112+ // structured AuxPoW parser, bound by bind_aux_doge_parsers(). Unbound until
113+ // bind is called. Parity: p2pool-merged-v36.
114+ AuxDogeParserFn m_aux_doge_parser;
115+
116+ // Binds the shared src/impl/doge aux module's structured parser onto the dgb
117+ // node, pinned to the DGB parent coinbase type. The body is a genuine callable
118+ // binding (NOT a no-op): it assigns m_aux_doge_parser to a lambda that drives
119+ // bytes through doge::coin::parse_aux_header<dgb::coin::MutableTransaction>().
120+ // Inline (the class is templated; an out-of-line def would need explicit
121+ // instantiation) -- matches the existing inline run(). This is what ODR-USES /
122+ // emits the DGB-parent CAuxPow<> + parse_aux_header<> instantiations in the
123+ // production dgb object library. NodeP2P (not yet ported) will route relayed
124+ // DOGE headers through m_aux_doge_parser at M3 live-dispatch time.
125+ void bind_aux_doge_parsers ()
126+ {
127+ m_aux_doge_parser = [](PackStream& s) -> AuxDogeParse {
128+ AuxDogeParse out;
129+ out.m_header = ::doge::coin::parse_aux_header<PackStream, dgb::coin::MutableTransaction>(
130+ s, out.m_aux , out.m_has_aux );
131+ return out;
132+ };
133+ }
134+
135+ // Accessor for the bound parser (test surface + future NodeP2P dispatch).
136+ const AuxDogeParserFn& aux_doge_parser () const { return m_aux_doge_parser; }
95137#endif
96138};
97139
0 commit comments