feat: Add ETL Indexing for mpt_issuance_history#3104
Conversation
6e3d1b9 to
8031c6b
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3104 +/- ##
===========================================
+ Coverage 82.61% 82.65% +0.04%
===========================================
Files 397 397
Lines 16034 16110 +76
Branches 8399 8441 +42
===========================================
+ Hits 13246 13316 +70
- Misses 1667 1670 +3
- Partials 1121 1124 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9af68a0 to
a5c11bf
Compare
PeterChen13579
left a comment
There was a problem hiding this comment.
There is also Codecov that shows you some lines from source file that are missing tests. Please cover them.
godexsoft
left a comment
There was a problem hiding this comment.
Looks fine to me from Clio/code perspective 👍
Would be nice to get answer for @PeterChen13579 's question just to make sure.
There was a problem hiding this comment.
Pull request overview
Adds live ETL indexing support for MPToken issuance history by extracting issuance references from transactions/metadata and writing them through the existing MPT ETL extension, with new unit coverage and shared test fixtures.
Changes:
- Introduces
etl::getMPTokenIssuanceTxsFromTxto extract and deduplicate per-issuance transaction index records (including affected-accounts fanout). - Extends
etl::impl::MPTExtto writemptoken_issuance_transactions+account_mptoken_issuance_transactions, emit a Prometheus counter, and warn on unexpectedly large per-tx fanout. - Adds unit tests and common test helpers for constructing MPToken / MPTokenIssuance affected nodes.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/etl/MPTHelpersTests.cpp | Adds focused unit coverage for issuance-tx extraction, deduping, and deterministic ordering. |
| tests/unit/etl/ext/MPTTests.cpp | Extends MPTExt unit tests to assert issuance-index writes, dedup/fanout behavior, and “no-op” cases. |
| tests/unit/CMakeLists.txt | Registers the new MPTHelpers unit test file in the unit test target. |
| tests/common/util/MPTokenTestObjects.hpp | Declares reusable helpers to construct MPT-related metadata nodes for tests. |
| tests/common/util/MPTokenTestObjects.cpp | Implements reusable helpers to construct MPToken / MPTokenIssuance nodes. |
| tests/common/CMakeLists.txt | Adds new MPToken test helper implementation to the common test utilities target. |
| src/etl/MPTHelpers.hpp | Declares the new issuance-transaction extraction helper API with documentation. |
| src/etl/MPTHelpers.cpp | Implements issuance-transaction extraction by scanning affected nodes and tx fields. |
| src/etl/impl/ext/MPT.hpp | Adds a Prometheus counter member and renames private write helper to reflect expanded responsibilities. |
| src/etl/impl/ext/MPT.cpp | Writes issuance transaction index rows (and per-account fanout) alongside existing holder indexing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mathbunnyru
left a comment
There was a problem hiding this comment.
LGTM, if we could switch to std::flat_set in a separate PR when we merge this, it would be great 👍
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
getMPTokenIssuanceTxsFromTxto extract issuance transaction index records fromtesSUCCESStransactions.AffectedNodesgenerically forMPTokenandMPTokenIssuanceledger objects instead of relying on a transaction-type allowlist.MPTokenIssuanceobjects withmakeMptID(sequence, issuer), avoiding the hashed ledger-key trap.MPTExtso live and initial ETL data writes:mptoken_issuance_transactionsaccount_mptoken_issuance_transactionsTests
Adds unit coverage for:
MPTokenIssuanceCreate,Destroy,Set, andMPTokenAuthorizePayment,Clawback,OfferCreate, andAMMDeposit