mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-24 04:27:22 +00:00
tx.receive takes its trace_id from txID[0:16]. A parent and its child share one trace. The peer's span is therefore a parent only when the peer's trace_id is that same txID[0:16]. Add isSameTraceId() to TraceContextValidation.h. txReceiveSpan() uses the peer's span_id as the parent when the trace_ids match. It starts a root span in the txID trace otherwise. Peers running this code relay the hash-derived tx.process context, so their relays keep the parent link. Add isSameTraceId() cases: an equal id, a different first byte, a different last byte, an absent id, and ids one byte longer and one byte shorter. The relay test whose peer sends another trace_id now expects a root tx.receive in the txID trace. It is renamed to say so. The same-trace relay test is unchanged and still expects the sender's span as parent.