Commit Graph

136 Commits

Author SHA1 Message Date
Ed Hennis
17a970d80c Continue updating LoanBroker tests
- It builds now
2025-05-07 12:11:51 -04:00
Ed Hennis
da10ba6fd0 Start adding tests for LoanBrokerDelete
- Start fixing the inevitable problems found along the way
- Generalize the LoanBroker lifecycle test
2025-05-07 12:11:51 -04:00
Ed Hennis
a8118ff582 Add unit tests for new invariants:
- NoModifiedUnmodifiableFields and ValidPseudoAccounts
- Move the Invariants_test class into the test namespace
2025-05-07 12:11:51 -04:00
Ed Hennis
ed27377435 Add a validity range for sfDebtMaximum
- Fix several test and build errors
2025-05-07 12:11:50 -04:00
Ed Hennis
1db5e9b4d3 Pseudo-account improvements
- Define pseudo-account fields with an sfield flag
- Pseudo-account invariant checks rules whenever a pseudo-account is
  created or modified.
2025-05-07 12:11:50 -04:00
Ed Hennis
1bbe5383ca Reserve a few values between Vault and Lending for future use
- Ledger objects and transactions
2025-05-07 12:11:49 -04:00
Ed Hennis
33e666bfff Enumerate transaction privileges for invariants
- Allows them to be defined in transactions.macro instead of needing to
  scrutinize every existing Invariant class.
- List is not necessarily comprehensive, but does cover every check
  where more than one transaction type is involved.
2025-05-07 12:11:49 -04:00
Ed Hennis
3b59817952 Generalize some of the Invariant checks using macro files
- Valid ledger entry type
- Valid new account root and pseudo account check
2025-05-07 12:11:49 -04:00
Ed Hennis
abf5f08297 Update type of CoverRate fields 2025-05-07 12:11:48 -04:00
Ed Hennis
f8c708f20c Finish LoanBrokerSet
- Update changed field name.
- Modify modifiable fields in an update. Note there are only two.
- Add a node field to dirLink, defaulting sfOwnerNode, so other
  relationships can be updated.
2025-05-07 12:11:47 -04:00
Ed Hennis
24374c548b [WIP] Define remaining transactions, start implementing LoanBrokerSet
- Does not build
- Transactions: LoanDelete, LoanManage, LoanDraw, LoanPay
- LoanBrokerSet creation mostly done. Need update.
- Also added a lookup table for pseudo account fields.
2025-05-07 12:11:47 -04:00
Ed Hennis
34f7bc7502 refactor: Check transaction flags in preflight0
- Adds a flagMask parameter to preflight1 so that it's impossible to
  forget to check flags.
- Also adds a short hash prefix to all Transactor log messages.
2025-05-07 12:11:46 -04:00
Ed Hennis
319e7a6bcb Start adding transaction layouts, flags, and fields
(Does not compile)
2025-05-07 12:11:46 -04:00
Ed Hennis
9d1b98a5a4 Fix some duplicated SField codes, speed up SField by name lookup 2025-05-07 12:11:46 -04:00
Ed Hennis
60a888619b Add Loan Broker and Loan ledger objects:
- Also add new SFields, Keylet functions, and an Invariant to verify no
  illegal field modification
2025-05-07 12:11:46 -04:00
Ed Hennis
8165f9d5b1 Add the LendingProtocol amendment 2025-05-07 12:11:46 -04:00
Bronek Kozicki
aead1bfb3d Review feedback 2025-05-06 19:06:45 +01:00
Bronek Kozicki
7e5845f209 Merge branch 'develop' into vault 2025-04-28 14:20:54 +01:00
Vlad
fa1e25abef chore: Small clarification to lsfDefaultRipple comment (#5410) 2025-04-25 15:21:27 +00:00
Bronek Kozicki
0ab792263a Code cleanup 2025-04-23 16:13:58 +01:00
Ed Hennis
75375905a4 Merge remote-tracking branch 'upstream/develop' into vault
* upstream/develop:
  fix: `fixPayChanV1` (4717)
2025-04-09 18:26:02 -04:00
Denis Angell
a574ec6023 fix: fixPayChanV1 (#4717)
This change introduces a new fix amendment (`fixPayChanV1`) that prevents the creation of new `PaymentChannelCreate` transaction with a `CancelAfter` time less than the current ledger time. It piggy backs off of fix1571.

Once the amendment is activated, creating a new `PaymentChannel` will require that if you specify the `CancelAfter` time/value, that value must be greater than or equal to the current ledger time.

Currently users can create a payment channel where the `CancelAfter` time is before the current ledger time. This results in the payment channel being immediately closed on the next PaymentChannel transaction.
2025-04-09 22:08:44 +00:00
Bronek Kozicki
f839049de7 Enforce max recursion depth in VaultCreate, improve VaultDeposit checks
Also fix off-by-one error in recursive checks isFrozen and requireAuth
2025-04-07 21:19:06 +01:00
Bronek Kozicki
5f051c53f1 Merge branch 'develop' into vault 2025-04-07 15:39:24 +01:00
Bronek Kozicki
db19760ee8 Both isFrozen and requireAuth are now recursive for vault shares 2025-04-07 15:37:50 +01:00
Bronek Kozicki
442795bfeb Change vault_info to take vault_id or owner&seq 2025-04-07 11:29:55 +01:00
Valentin Balaschenko
e923ec6d36 Fix to correct memory ordering for compare_exchange_weak and wait in the intrusive reference counting logic (#5381)
This change addresses a memory ordering assertion failure observed on one of the Windows test machines during the IntrusiveShared_test suite.
2025-04-04 18:21:17 +00:00
Bronek Kozicki
591437b914 Mark featureSingleAssetVault as Supported::no 2025-04-03 14:13:21 +01:00
Bronek Kozicki
af8ea3fb40 Rename 'share' to 'shares' in vault_info RPC 2025-04-03 11:45:47 +01:00
Bronek Kozicki
85e7d293ca Factor out isPseudoAccount 2025-04-02 19:29:04 +01:00
Bronek Kozicki
5f53e4d1f8 Change output structure of vault_info 2025-04-02 17:09:49 +01:00
Bronek Kozicki
fa0b021fb8 Add RPC vault_info, remove RPC::supplementJson<ltVAULT> 2025-04-02 16:40:37 +01:00
Bronek Kozicki
a1c21a06bc Rename sfMPTokenIssuanceID in Vault to sfShareMPTID 2025-03-31 16:40:46 +01:00
Bronek Kozicki
d3c1d02c72 Return terADDRESS_COLLISION from preclaim if cannot allocate AccountID 2025-03-28 19:49:37 +00:00
Bronek Kozicki
0f99955ae9 Merge branch 'develop' into vault 2025-03-27 13:07:02 +00:00
Bronek Kozicki
7686c3d88d Rename ShareTotal to SharesTotal 2025-03-27 11:50:03 +00:00
Bronek Kozicki
33660eadc6 Add comment on tecNO_ENTRY vs tecOBJECT_NOT_FOUND 2025-03-26 19:43:35 +00:00
Bronek Kozicki
0636d4695d Rename sfAsset... fields to sfAssets... 2025-03-26 19:19:30 +00:00
Bronek Kozicki
dee06df012 Remove tecINVALID_DOMAIN error code
Also remove superflous checks in CredentialHelpers
2025-03-26 17:24:41 +00:00
Bronek Kozicki
3883bafd52 Update transactions.macro comment for ttVAULT_CLAWBACK 2025-03-26 12:29:56 +00:00
Valentin Balaschenko
fc204773d6 Intrusive SHAMap smart pointers for efficient memory use and lock-free synchronization (#5152)
The main goal of this optimisation is memory reduction in SHAMapTreeNodes by introducing intrusive pointers instead of standard std::shared_ptr and std::weak_ptr.
2025-03-25 18:40:25 +00:00
Bronek Kozicki
372555bda8 Rename tecVAULT_ACCOUNT to tecPSEUDO_ACCOUNT 2025-03-25 15:04:30 +00:00
Bronek Kozicki
fbe28f6536 Switch sfAssetTotal sfAssetAvailable and sfLossUnrealized to required 2025-03-25 12:07:48 +00:00
Bronek Kozicki
a173dd20e2 Disallow regular Clawback on Vault accounts 2025-03-24 11:45:50 +00:00
Bronek Kozicki
cc4f87729f Merge branch 'develop' into vault 2025-03-24 11:25:35 +00:00
Bronek Kozicki
58f15307ba Add ShareTotal to ledger_entry output 2025-03-21 16:33:31 +00:00
Bronek Kozicki
3d2102106c Show Share.mpt_issuance_id rather than MPTokenIssuanceID 2025-03-21 13:52:13 +00:00
Alex Kremer
75a20194c5 chore: Update link to ripple-binary-codec (#5355)
The link to ripple-binary-codec's definitions.json appears to be outdated. The updated link is also documented here: https://xrpl.org/docs/references/protocol/binary-format#definitions-file
2025-03-19 17:33:23 -04:00
Bronek Kozicki
6db2144912 Improve checks in VaultSet VaultCreate and VaultDeposit 2025-03-19 16:26:44 +00:00
Bronek Kozicki
8e68838543 Remove lsfMPTDomainCheck flag, delete expired MPToken 2025-03-19 11:51:03 +00:00