fix(telemetry): Hash the MPT issuance id in the path-find span

An MPT issuance id is a sequence concatenated with the issuer's account id, so
emitting it whole put an account on a span in the clear, while the Issue arm
beside it redacts its issuer. The collector hashes only the two account
attributes, so nothing downstream caught it.

Hash the whole id: one stable token per asset, no issuer. The comment claiming
the id carries no address was wrong and is corrected.
This commit is contained in:
Pratik Mankawde
2026-09-23 14:29:19 +01:00
parent a7b3a0df6e
commit adfd9900a7

View File

@@ -784,8 +784,9 @@ PathRequest::doUpdate(
// the issuer as a plaintext Base58 address, so it cannot be emitted
// as-is: every account reaching a span is hashed first. Redact just the
// issuer and keep the currency, which is what this attribute is for. An
// MPT asset renders as its issuance ID and carries no address, so it
// needs no redaction.
// MPT issuance id ends with the issuer's account id, so hash the whole
// id: that still gives one stable token per asset, without publishing
// the issuer.
span.setAttribute(
pathfind_span::attr::destCurrency,
saDstAmount_.asset().visit(
@@ -794,7 +795,7 @@ PathRequest::doUpdate(
? to_string(issue.currency)
: redactAccount(toBase58(issue.account)) + "/" + to_string(issue.currency);
},
[](MPTIssue const& mpt) { return to_string(mpt.getMptID()); }));
[](MPTIssue const& mpt) { return redactAccount(to_string(mpt.getMptID())); }));
}
JLOG(journal_.debug()) << iIdentifier_ << " update " << (fast ? "fast" : "normal");