mirror of
https://github.com/XRPLF/clio.git
synced 2026-07-23 15:10:23 +00:00
## Summary Adds live ETL indexing for mptoken_issuance_history by extracting MPT issuance references from transaction metadata and transaction fields, then writing both MPT transaction index shapes during the existing MPT ETL pass. Successful transactions are indexed from affected MPT ledger objects; failed transactions are indexed only when they carry an attached MPT issuance reference. ## Changes - Adds `getMPTokenIssuanceTxsFromTx` to extract issuance transaction index records from `tesSUCCESS` transactions. - Scans `AffectedNodes` generically for `MPToken` and `MPTokenIssuance` ledger objects instead of relying on a transaction-type allowlist. - Reconstructs issuance IDs for `MPTokenIssuance` objects with `makeMptID(sequence, issuer)`, avoiding the hashed ledger-key trap. - Deduplicates distinct issuances per transaction and attaches the transaction’s affected accounts for account-level fanout. - Extends `MPTExt` so live and initial ETL data writes: - existing MPT holder index data - `mptoken_issuance_transactions` - `account_mptoken_issuance_transactions` - Adds a Prometheus counter for MPT issuance transaction index rows written by ETL. - Logs unexpectedly large per-transaction fanout. ## Tests Adds unit coverage for: - failed transactions producing no records - `MPTokenIssuanceCreate`, `Destroy`, `Set`, and `MPTokenAuthorize` - generic transaction-type coverage through `Payment`, `Clawback`, `OfferCreate`, and `AMMDeposit` - ID reconstruction from issuance nodes - multi-issuance fanout and deduplication - affected-account propagation - ETL extension writes to both backend index paths while preserving existing holder indexing --------- Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
23 lines
484 B
C++
23 lines
484 B
C++
#pragma once
|
|
|
|
#include <xrpl/basics/base_uint.h>
|
|
#include <xrpl/protocol/SField.h>
|
|
#include <xrpl/protocol/STObject.h>
|
|
|
|
#include <cstdint>
|
|
#include <string_view>
|
|
|
|
namespace util {
|
|
|
|
[[nodiscard]] xrpl::STObject
|
|
createMPTokenNode(
|
|
xrpl::SField const& nodeType,
|
|
xrpl::uint192 const& issuanceID,
|
|
std::string_view holder
|
|
);
|
|
|
|
[[nodiscard]] xrpl::STObject
|
|
createMPTokenIssuanceNode(xrpl::SField const& nodeType, std::uint32_t seq, std::string_view issuer);
|
|
|
|
} // namespace util
|