Skip to content

Commit e127a3f

Browse files
committed
Merge remote-tracking branch 'develop' into feature
2 parents 35e0005 + e718378 commit e127a3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3018
-10
lines changed

Builds/CMake/RippledCore.cmake

+7
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ target_sources (xrpl_core PRIVATE
9898
src/ripple/protocol/impl/STArray.cpp
9999
src/ripple/protocol/impl/STBase.cpp
100100
src/ripple/protocol/impl/STBlob.cpp
101+
src/ripple/protocol/impl/STCurrency.cpp
101102
src/ripple/protocol/impl/STInteger.cpp
102103
src/ripple/protocol/impl/STLedgerEntry.cpp
103104
src/ripple/protocol/impl/STObject.cpp
@@ -553,6 +554,7 @@ target_sources (rippled PRIVATE
553554
src/ripple/app/tx/impl/CreateOffer.cpp
554555
src/ripple/app/tx/impl/CreateTicket.cpp
555556
src/ripple/app/tx/impl/DeleteAccount.cpp
557+
src/ripple/app/tx/impl/DeleteOracle.cpp
556558
src/ripple/app/tx/impl/DepositPreauth.cpp
557559
src/ripple/app/tx/impl/DID.cpp
558560
src/ripple/app/tx/impl/Escrow.cpp
@@ -566,6 +568,7 @@ target_sources (rippled PRIVATE
566568
src/ripple/app/tx/impl/PayChan.cpp
567569
src/ripple/app/tx/impl/Payment.cpp
568570
src/ripple/app/tx/impl/SetAccount.cpp
571+
src/ripple/app/tx/impl/SetOracle.cpp
569572
src/ripple/app/tx/impl/SetRegularKey.cpp
570573
src/ripple/app/tx/impl/SetSignerList.cpp
571574
src/ripple/app/tx/impl/SetTrust.cpp
@@ -721,6 +724,7 @@ target_sources (rippled PRIVATE
721724
src/ripple/rpc/handlers/FetchInfo.cpp
722725
src/ripple/rpc/handlers/GatewayBalances.cpp
723726
src/ripple/rpc/handlers/GetCounts.cpp
727+
src/ripple/rpc/handlers/GetAggregatePrice.cpp
724728
src/ripple/rpc/handlers/LedgerAccept.cpp
725729
src/ripple/rpc/handlers/LedgerCleanerHandler.cpp
726730
src/ripple/rpc/handlers/LedgerClosed.cpp
@@ -840,6 +844,7 @@ if (tests)
840844
src/test/app/NFTokenDir_test.cpp
841845
src/test/app/OfferStream_test.cpp
842846
src/test/app/Offer_test.cpp
847+
src/test/app/Oracle_test.cpp
843848
src/test/app/OversizeMeta_test.cpp
844849
src/test/app/Path_test.cpp
845850
src/test/app/PayChan_test.cpp
@@ -964,6 +969,7 @@ if (tests)
964969
src/test/jtx/impl/AMMTest.cpp
965970
src/test/jtx/impl/Env.cpp
966971
src/test/jtx/impl/JSONRPCClient.cpp
972+
src/test/jtx/impl/Oracle.cpp
967973
src/test/jtx/impl/TestHelpers.cpp
968974
src/test/jtx/impl/WSClient.cpp
969975
src/test/jtx/impl/acctdelete.cpp
@@ -1089,6 +1095,7 @@ if (tests)
10891095
src/test/rpc/DeliveredAmount_test.cpp
10901096
src/test/rpc/Feature_test.cpp
10911097
src/test/rpc/GatewayBalances_test.cpp
1098+
src/test/rpc/GetAggregatePrice_test.cpp
10921099
src/test/rpc/GetCounts_test.cpp
10931100
src/test/rpc/JSONRPC_test.cpp
10941101
src/test/rpc/KeyGeneration_test.cpp

RELEASENOTES.md

+145
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,151 @@ This document contains the release notes for `rippled`, the reference server imp
66

77
Have new ideas? Need help with setting up your node? [Please open an issue here](https://github.com/xrplf/rippled/issues/new/choose).
88

9+
# Introducing XRP Ledger version 2.1.0
10+
11+
Version 2.1.0 of `rippled`, the reference server implementation of the XRP Ledger protocol, is now available. This release adds a bug fix, build improvements, and introduces the `fixNFTokenReserve` and `fixInnerObjTemplate` amendments.
12+
13+
[Sign Up for Future Release Announcements](https://groups.google.com/g/ripple-server)
14+
15+
<!-- BREAK -->
16+
17+
18+
## Action Required
19+
20+
Two new amendments are now open for voting according to the XRP Ledger's [amendment process](https://xrpl.org/amendments.html), which enables protocol changes following two weeks of >80% support from trusted validators.
21+
22+
If you operate an XRP Ledger server, upgrade to version 2.1.0 by March 5, 2024 to ensure service continuity. The exact time that protocol changes take effect depends on the voting decisions of the decentralized network.
23+
24+
## Changelog
25+
26+
### Amendments
27+
(These are changes which may impact or be useful to end users. For example, you may be able to update your code/workflow to take advantage of these changes.)
28+
29+
- **fixNFTokenReserve**: Adds a check to the `NFTokenAcceptOffer` transactor to see if the `OwnerCount` changed. If it did, it checks that the reserve requirement is met. [#4767](https://github.com/XRPLF/rippled/pull/4767)
30+
31+
- **fixInnerObjTemplate**: Adds an `STObject` constructor overload that includes an additional boolean argument to set the inner object template; currently, the inner object template isn't set upon object creation. In some circumstances, this causes a `tefEXCEPTION` error when trying to access the AMM `sfTradingFee` and `sfDiscountedFee` fields in the inner objects of `sfVoteEntry` and `sfAuctionSlot`. [#4906](https://github.com/XRPLF/rippled/pull/4906)
32+
33+
34+
### Bug Fixes and Performance Improvements
35+
(These are behind-the-scenes improvements, such as internal changes to the code, which are not expected to impact end users.)
36+
37+
- Fixed a bug that prevented the gRPC port info from being specified in the `rippled` config file. [#4728](https://github.com/XRPLF/rippled/pull/4728)
38+
39+
40+
### Docs and Build System
41+
42+
- Added unit tests to check that payees and payers aren't the same account. [#4860](https://github.com/XRPLF/rippled/pull/4860)
43+
44+
- Removed a workaround that bypassed Windows CI unit test failures. [#4871](https://github.com/XRPLF/rippled/pull/4871)
45+
46+
- Updated library names to be platform-agnostic in Conan recipes. [#4831](https://github.com/XRPLF/rippled/pull/4831)
47+
48+
- Added headers required in the Conan package to build xbridge witness servers. [#4885](https://github.com/XRPLF/rippled/pull/4885)
49+
50+
- Improved object lifetime management when creating a temporary `Rules` object, fixing a crash in Windows unit tests. [#4917](https://github.com/XRPLF/rippled/pull/4917)
51+
52+
### GitHub
53+
54+
The public source code repository for `rippled` is hosted on GitHub at <https://github.com/XRPLF/rippled>.
55+
56+
We welcome all contributions and invite everyone to join the community of XRP Ledger developers to help build the Internet of Value.
57+
58+
59+
## Credits
60+
61+
The following people contributed directly to this release:
62+
63+
- Bronek Kozicki <[email protected]>
64+
- CJ Cobb <[email protected]>
65+
- Chenna Keshava B S <[email protected]>
66+
- Ed Hennis <[email protected]>
67+
- Elliot Lee <[email protected]>
68+
- Gregory Tsipenyuk <[email protected]>
69+
- John Freeman <[email protected]>
70+
- Michael Legleux <[email protected]>
71+
- Ryan Molley
72+
- Shawn Xie <[email protected]>
73+
74+
75+
Bug Bounties and Responsible Disclosures:
76+
77+
We welcome reviews of the `rippled` code and urge researchers to responsibly disclose any issues they may find.
78+
79+
To report a bug, please send a detailed report to: <[email protected]>
80+
81+
# Introducing XRP Ledger version 2.0.1
82+
83+
Version 2.0.1 of `rippled`, the reference server implementation of the XRP Ledger protocol, is now available. This release includes minor fixes, unit test improvements, and doc updates.
84+
85+
[Sign Up for Future Release Announcements](https://groups.google.com/g/ripple-server)
86+
87+
<!-- BREAK -->
88+
89+
90+
## Action Required
91+
92+
If you operate an XRP Ledger server, upgrade to version 2.0.1 to take advantage of the changes included in this update. Nodes on version 1.12 should upgrade as soon as possible.
93+
94+
95+
## Changelog
96+
97+
98+
### Changes
99+
(These are changes which may impact or be useful to end users. For example, you may be able to update your code/workflow to take advantage of these changes.)
100+
101+
- Updated the `send_queue_limit` to 500 in the default `rippled` config to handle increased transaction loads. [#4867](https://github.com/XRPLF/rippled/pull/4867)
102+
103+
104+
### Bug Fixes and Performance Improvements
105+
(These are behind-the-scenes improvements, such as internal changes to the code, which are not expected to impact end users.)
106+
107+
- Fixed an assertion that occurred when `rippled` was under heavy websocket client load. [#4848](https://github.com/XRPLF/rippled/pull/4848)
108+
109+
- Improved lifetime management of serialized type ledger entries to improve memory usage. [#4822](https://github.com/XRPLF/rippled/pull/4822)
110+
111+
- Fixed a clang warning about deprecated sprintf usage. [#4747](https://github.com/XRPLF/rippled/pull/4747)
112+
113+
114+
### Docs and Build System
115+
116+
- Added `DeliverMax` to more JSONRPC tests. [#4826](https://github.com/XRPLF/rippled/pull/4826)
117+
118+
- Updated the pull request template to include a `Type of Change` checkbox and additional contextual questions. [#4875](https://github.com/XRPLF/rippled/pull/4875)
119+
120+
- Updated help messages for unit tests pattern matching. [#4846](https://github.com/XRPLF/rippled/pull/4846)
121+
122+
- Improved the time it take to generate coverage reports. [#4849](https://github.com/XRPLF/rippled/pull/4849)
123+
124+
- Fixed broken links in the Conan build docs. [#4699](https://github.com/XRPLF/rippled/pull/4699)
125+
126+
- Spurious codecov uploads are now retried if there's an error uploading them the first time. [#4896](https://github.com/XRPLF/rippled/pull/4896)
127+
128+
129+
### GitHub
130+
131+
The public source code repository for `rippled` is hosted on GitHub at <https://github.com/XRPLF/rippled>.
132+
133+
We welcome all contributions and invite everyone to join the community of XRP Ledger developers to help build the Internet of Value.
134+
135+
136+
## Credits
137+
138+
The following people contributed directly to this release:
139+
140+
- Bronek Kozicki <[email protected]>
141+
- Chenna Keshava B S <[email protected]>
142+
- Ed Hennis <[email protected]>
143+
- Elliot Lee <[email protected]>
144+
- Lathan Britz <[email protected]>
145+
- Mark Travis <[email protected]>
146+
- nixer89 <[email protected]>
147+
148+
Bug Bounties and Responsible Disclosures:
149+
150+
We welcome reviews of the `rippled` code and urge researchers to responsibly disclose any issues they may find.
151+
152+
To report a bug, please send a detailed report to: <[email protected]>
153+
9154
# Introducing XRP Ledger version 2.0.0
10155

11156
Version 2.0.0 of `rippled`, the reference server implementation of the XRP Ledger protocol, is now available. This release adds new features and bug fixes, and introduces these amendments:

src/ripple/app/tx/impl/DeleteAccount.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include <ripple/app/tx/impl/DID.h>
2121
#include <ripple/app/tx/impl/DeleteAccount.h>
22+
#include <ripple/app/tx/impl/DeleteOracle.h>
2223
#include <ripple/app/tx/impl/DepositPreauth.h>
2324
#include <ripple/app/tx/impl/SetSignerList.h>
2425
#include <ripple/app/tx/impl/details/NFTokenUtils.h>
@@ -146,6 +147,18 @@ removeDIDFromLedger(
146147
return DIDDelete::deleteSLE(view, sleDel, account, j);
147148
}
148149

150+
TER
151+
removeOracleFromLedger(
152+
Application&,
153+
ApplyView& view,
154+
AccountID const& account,
155+
uint256 const&,
156+
std::shared_ptr<SLE> const& sleDel,
157+
beast::Journal j)
158+
{
159+
return DeleteOracle::deleteOracle(view, sleDel, account, j);
160+
}
161+
149162
// Return nullptr if the LedgerEntryType represents an obligation that can't
150163
// be deleted. Otherwise return the pointer to the function that can delete
151164
// the non-obligation
@@ -166,6 +179,8 @@ nonObligationDeleter(LedgerEntryType t)
166179
return removeNFTokenOfferFromLedger;
167180
case ltDID:
168181
return removeDIDFromLedger;
182+
case ltORACLE:
183+
return removeOracleFromLedger;
169184
default:
170185
return nullptr;
171186
}
+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
//------------------------------------------------------------------------------
2+
/*
3+
This file is part of rippled: https://github.com/ripple/rippled
4+
Copyright (c) 2023 Ripple Labs Inc.
5+
6+
Permission to use, copy, modify, and/or distribute this software for any
7+
purpose with or without fee is hereby granted, provided that the above
8+
copyright notice and this permission notice appear in all copies.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13+
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17+
*/
18+
//==============================================================================
19+
20+
#include <ripple/app/tx/impl/DeleteOracle.h>
21+
#include <ripple/ledger/Sandbox.h>
22+
#include <ripple/ledger/View.h>
23+
#include <ripple/protocol/Feature.h>
24+
#include <ripple/protocol/Rules.h>
25+
#include <ripple/protocol/TxFlags.h>
26+
27+
namespace ripple {
28+
29+
NotTEC
30+
DeleteOracle::preflight(PreflightContext const& ctx)
31+
{
32+
if (!ctx.rules.enabled(featurePriceOracle))
33+
return temDISABLED;
34+
35+
if (auto const ret = preflight1(ctx); !isTesSuccess(ret))
36+
return ret;
37+
38+
if (ctx.tx.getFlags() & tfUniversalMask)
39+
{
40+
JLOG(ctx.j.debug()) << "Oracle Delete: invalid flags.";
41+
return temINVALID_FLAG;
42+
}
43+
44+
return preflight2(ctx);
45+
}
46+
47+
TER
48+
DeleteOracle::preclaim(PreclaimContext const& ctx)
49+
{
50+
if (!ctx.view.exists(keylet::account(ctx.tx.getAccountID(sfAccount))))
51+
return terNO_ACCOUNT;
52+
53+
if (auto const sle = ctx.view.read(keylet::oracle(
54+
ctx.tx.getAccountID(sfAccount), ctx.tx[sfOracleDocumentID]));
55+
!sle)
56+
{
57+
JLOG(ctx.j.debug()) << "Oracle Delete: Oracle does not exist.";
58+
return tecNO_ENTRY;
59+
}
60+
else if (ctx.tx.getAccountID(sfAccount) != sle->getAccountID(sfOwner))
61+
{
62+
// this can't happen because of the above check
63+
JLOG(ctx.j.debug()) << "Oracle Delete: invalid account.";
64+
return tecINTERNAL;
65+
}
66+
return tesSUCCESS;
67+
}
68+
69+
TER
70+
DeleteOracle::deleteOracle(
71+
ApplyView& view,
72+
std::shared_ptr<SLE> const& sle,
73+
AccountID const& account,
74+
beast::Journal j)
75+
{
76+
if (!sle)
77+
return tesSUCCESS;
78+
79+
if (!view.dirRemove(
80+
keylet::ownerDir(account), (*sle)[sfOwnerNode], sle->key(), true))
81+
{
82+
JLOG(j.fatal()) << "Unable to delete Oracle from owner.";
83+
return tefBAD_LEDGER;
84+
}
85+
86+
auto const sleOwner = view.peek(keylet::account(account));
87+
if (!sleOwner)
88+
return tecINTERNAL;
89+
90+
auto const count =
91+
sle->getFieldArray(sfPriceDataSeries).size() > 5 ? -2 : -1;
92+
93+
adjustOwnerCount(view, sleOwner, count, j);
94+
95+
view.erase(sle);
96+
97+
return tesSUCCESS;
98+
}
99+
100+
TER
101+
DeleteOracle::doApply()
102+
{
103+
if (auto sle = ctx_.view().peek(
104+
keylet::oracle(account_, ctx_.tx[sfOracleDocumentID])))
105+
return deleteOracle(ctx_.view(), sle, account_, j_);
106+
107+
return tecINTERNAL;
108+
}
109+
110+
} // namespace ripple

0 commit comments

Comments
 (0)