Commit Graph

982 Commits

Author SHA1 Message Date
Ayaz Salikhov
0b15620d87 chore: Use libxrpl 3.3.0-rc1 (#3144) 2026-07-20 20:19:16 +01:00
Ayaz Salikhov
50f9bc2bea style: Unify style for all Doxygen comments (#3142) 2026-07-13 12:45:05 +01:00
Bryan
52d28f8389 feat: Add ETL Indexing for mpt_issuance_history (#3104)
## 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>
2026-07-07 08:40:06 -07:00
Alex Kremer
92bd0963e3 fix: Shared SSL context (#3137) 2026-07-07 16:12:40 +01:00
Ayaz Salikhov
bc556fa0e7 build: Use apple-clang 21; remove SourceLocation stub (#3123) 2026-06-30 18:13:03 +01:00
Ayaz Salikhov
30732882f1 fix: Make Loan and LoanBroker filterable in account_objects/ledger_data (#3124) 2026-06-29 17:34:38 +01:00
Ayaz Salikhov
36ec74415a chore: Update tidy with new v22 checks (#3119) 2026-06-29 11:57:24 +01:00
Sergey Kuznetsov
87f0b480bf fix: Don't cache requests with params (#3113)
`ResponseExpirationCache` is using only `method` (or `command`) as a
key, but responses might be different with different params. This may
lead to a client getting incorrect response because of caching. This PR
fixes it by caching only requests without any additional params.
2026-06-26 12:33:27 +01:00
Sergey Kuznetsov
0b20dc728a chore: Don't include fwd headers (#3117) 2026-06-25 16:06:13 +01:00
Sergey Kuznetsov
9b04d64a0e chore: Update libxrpl to 3.2.0 (#3114) 2026-06-25 11:19:12 +01:00
Ayaz Salikhov
373a883840 fix: Add pragma once checker (#3111) 2026-06-19 17:23:03 +01:00
Ayaz Salikhov
52af23fe77 chore: Fixes after tidy v22 update (#3108) 2026-06-17 11:33:39 +01:00
Ayaz Salikhov
fa057bd876 ci: Use Nix-based images for all workflows except pre-commit (#3098) 2026-06-16 22:50:43 +01:00
Bryan
e24216c8a9 feat: Add storage and backend for mpt_issuance_history (#3091)
Why
This is the first PR in the broader `mptoken_issuance_history` plan. It
lands the additive schema/backend layer first so later PRs can safely
add live ETL indexing, historical backfill, and finally the RPC handler
gated on backfill completion. Keeping this step dark avoids exposing
partial history while still making the stack reviewable in small pieces.

Summary
Adds the storage and backend primitives for MPT transaction-history
filtering.

- Adds Cassandra tables:

  - mpt_transactions

  - account_mpt_transactions
- Adds MPTTransactionsData and backend interface methods for
writing/fetching both MPT index shapes.
Implements Cassandra write/fetch paths with forward/reverse pagination,
raw-page cursor behavior, and case-insensitive tx_type filtering before
transaction hydration.
- Adds MockBackend coverage for the new pure-virtual methods.
- Adds Cassandra integration tests for round-trip behavior, ordering,
pagination, missing transaction blobs, sparse tx_type filtering, account
fanout, and account-side filtering.
2026-06-16 12:15:45 -07:00
Shawn Xie
0aa7ed4919 feat: Update MPToken ETL to support all transactions types (#3102)
## Summary

Fixes incomplete MPT holder indexing in ETL.

Previously, Clio only indexed MPT holders when an `ltMPTOKEN` ledger
node was created by an `MPTokenAuthorize` transaction. However, with
future amendments, XRPL can also create `ltMPTOKEN` nodes as part of
other successful transactions, such as `Payment`, when a holder receives
an MPT. Those holders were silently skipped and therefore missing from
the `mpt_holders` RPC results.

This change makes MPT holder indexing metadata-driven instead of
transaction-type-driven. ETL now scans successful transaction metadata
for newly created `ltMPTOKEN` nodes and writes every holder it finds.

## What Changed

- MPT holder extraction now works for any successful transaction that
creates an `ltMPTOKEN`.
- Multiple MPT holders created in a single transaction are all indexed.
- The `mpt_holders` table is kept consistent with ledger metadata
instead of relying on assumptions about which transaction types can
create holder nodes.
- Added regression coverage for MPT holders created by a `Payment`
transaction.

## Testing

- `build/clio_tests '--gtest_filter=MPTExtTests.*'`
- `clang-tidy -p build src/etl/MPTHelpers.cpp src/etl/MPTHelpers.hpp
src/etl/impl/ext/MPT.cpp tests/unit/etl/ext/MPTTests.cpp`
2026-06-15 11:46:55 +01:00
Alex Kremer
cc4f204d9e style: More clang-tidy identifier renaming (#3076) 2026-05-19 15:25:47 +01:00
Alex Kremer
dbc98894ba refactor: Rename static constants (#3073) 2026-05-13 12:09:06 +01:00
Sergey Kuznetsov
a1112bf318 chore: Update libxrpl to 3.1.3 (#3070) 2026-05-11 14:13:22 +01:00
Sergey Kuznetsov
e974e1899f fix: Don't cache responses to admin's requests (#3058) 2026-05-05 17:00:59 +01:00
Alex Kremer
51244feb4a chore: Enable more clang-tidy checks (#3054) 2026-05-01 15:31:45 +01:00
Ayaz Salikhov
32aeda0ce7 chore: Fix clang-tidy 21 issues (#3052) 2026-04-29 16:17:32 +01:00
Sergey Kuznetsov
f1460de5d3 feat: Optional log rotation (#3016)
This PR adds an option to disable log rotation.
2026-04-27 15:30:53 +01:00
Sergey Kuznetsov
fe0bf736fb refactor: Use error code in make_address() calls (#3044)
Function `ip::make_address()` throws an exception on an invalid IP.
Refactor to a better error handling without exceptions.
2026-04-27 11:32:07 +01:00
Sergey Kuznetsov
d7bcf6e726 fix: Client IP resolving when proxy reusing TCP connection (#3043)
Proxy may reuse TCP connections to send HTTP requests from different
clients. This PR fixes bug when Clio resolves client IP only once per
connection.
2026-04-22 16:01:18 +01:00
Alex Kremer
4b37493bc0 fix: Forwarded stream ignores specified api_version (#3010) 2026-03-24 15:34:44 +00:00
Alex Kremer
7238cc8799 fix: Allow deleted libXRPL amendments to still be queried via feature (#3011) 2026-03-24 15:34:02 +00:00
Alex Kremer
4e85398aed chore: Remove more copyrights from code (#3012)
More copyrights detected following #2975
2026-03-24 15:33:12 +00:00
Alex Kremer
21066d16e9 chore: Remove copyright from all source files (#2975) 2026-03-24 15:25:32 +00:00
Sergey Kuznetsov
d3381a1dab fix: Resolve proxy ip before processing any request (#3006) 2026-03-19 15:34:53 +00:00
Sergey Kuznetsov
2316cced64 feat: Recover from fallback writer state (#3000)
Add a timer and new `FallbackRecovery` state to try to recover from
`Fallback` writer state every hour.
Fixes #2997
2026-03-16 14:09:26 +00:00
github-actions[bot]
4f0a983195 style: clang-tidy auto fixes (#2999) 2026-03-10 10:11:29 +00:00
Ayaz Salikhov
2b8a7b95e4 chore: Remove explicit accountNotFound message (#2978)
I searched rippled code, and there is no `accountNotFound` anywhere.
So, we should probably stick to the default, it looks reasonable
2026-03-09 17:17:09 +00:00
Sergey Kuznetsov
fbdd6d6105 feat: Limit cache loading in cluster (#2985)
This PR adds an option to limit simultaneous cache loading in a cluster
to one node at a time.
Fixes #2707
2026-03-09 17:11:20 +00:00
Sergey Kuznetsov
05e52ee7a4 fix: Start without cache file (#2976)
#2830 introduced a bug that clio couldn't start without having a cache
file. This PR fixes the problem.
2026-03-06 15:59:27 +00:00
Ayaz Salikhov
43e8c8cddb style: Unify style for 'not expectedLgrInfo.has_value()' (#2977) 2026-03-06 12:27:54 +00:00
Ayaz Salikhov
9cbc99651c style: Unify style for 'not expectedNext.has_value()' (#2979) 2026-03-06 12:21:53 +00:00
Ayaz Salikhov
967590e639 style: Use gersemi instead of ancient cmake-format (#2980) 2026-03-06 12:21:01 +00:00
github-actions[bot]
395e87b9c5 style: clang-tidy auto fixes (#2982) 2026-03-06 10:10:16 +00:00
Ayaz Salikhov
6d56ed5ccf chore: Move sharedPtrBackend (#2974) 2026-03-05 19:01:57 +00:00
github-actions[bot]
a4d6caf8a7 style: Update pre-commit hooks (#2968)
Co-authored-by: mathbunnyru <12270691+mathbunnyru@users.noreply.github.com>
2026-03-03 15:58:30 +00:00
Ayaz Salikhov
1220d632b5 style: Fix lint comments due to style changes (#2963) 2026-02-23 16:24:27 +00:00
Ayaz Salikhov
e9052bcd80 style: Remove readability-identifier-naming where not needed (#2962) 2026-02-23 14:43:19 +00:00
Ayaz Salikhov
c1f6a6eb31 chore: Fix compilation due to use of std::ranges::mismatch (#2960) 2026-02-23 14:32:07 +00:00
github-actions[bot]
af736717fc style: clang-tidy auto fixes (#2958)
Co-authored-by: godexsoft <385326+godexsoft@users.noreply.github.com>
2026-02-23 13:54:07 +00:00
Sergey Kuznetsov
2d6f82c27f feat: Metrics for requested ledger age (#2947)
Adding metrics to be able to analyse requested ledger age distribution.

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-20 18:01:15 +00:00
Ayaz Salikhov
6ba58f42f0 style: Set clang-format width 100 (#2953) 2026-02-20 15:56:03 +00:00
Ayaz Salikhov
480264ff8f perf: Use string_view in AccountInfo (#2951) 2026-02-18 17:11:31 +00:00
Ayaz Salikhov
584d2bb5f2 feat: Support Lending Protocol (#2945) 2026-02-17 22:54:24 +00:00
emrearıyürek
9d3dbce73b fix: Remove RpcEntryNotFound from ClioError (#2661)
Since rippled has its own error codes, all occurrences have been
replaced except for [PR2549](https://github.com/XRPLF/clio/pull/2549),
and the entry has also been removed entirely from Clio’s error enum.
This modification follows the feedback provided in this comment:
https://github.com/XRPLF/clio/pull/2549#discussion_r2394840688

Pending compatible libxrpl — temporarily on hold

---------

Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
Co-authored-by: Alex Kremer <akremer@ripple.com>
2026-02-06 15:33:18 +00:00
Alex Kremer
9fd15eb08b chore: Enable TSAN without ignoring errors (#2828) 2026-01-30 19:14:36 +00:00