Compare commits

..

3 Commits

Author SHA1 Message Date
Michael Legleux
8585055d6e fix output 2026-02-27 17:20:40 -08:00
Michael Legleux
a35308399d readable ui output 2026-02-27 17:16:57 -08:00
Michael Legleux
8068a7b513 Trigger run 2026-02-27 15:57:17 -08:00
13 changed files with 512 additions and 266 deletions

View File

@@ -32,10 +32,13 @@ We will further set additional CMake arguments as follows:
"""
def generate_strategy_matrix(all: bool, config: Config) -> list:
def generate_strategy_matrix(all: bool, config: Config, distro: str = "") -> list:
configurations = []
os_entries = config.os
if distro:
os_entries = [o for o in os_entries if o["distro_name"] == distro]
for architecture, os, build_type, cmake_args in itertools.product(
config.architecture, config.os, config.build_type, config.cmake_args
config.architecture, os_entries, config.build_type, config.cmake_args
):
# The default CMake target is 'all' for Linux and MacOS and 'install'
# for Windows, but it can get overridden for certain configurations.
@@ -223,7 +226,7 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
if (n := os["compiler_version"]) != "":
config_name += f"-{n}"
config_name += (
f"-{architecture['platform'][architecture['platform'].find('/')+1:]}"
f"-{architecture['platform'][architecture['platform'].find('/') + 1 :]}"
)
config_name += f"-{build_type.lower()}"
if "-Dcoverage=ON" in cmake_args:
@@ -313,21 +316,32 @@ if __name__ == "__main__":
required=False,
type=Path,
)
parser.add_argument(
"-d",
"--distro",
help="Filter OS entries to only include those with this distro_name (e.g. 'debian', 'rhel', 'ubuntu').",
required=False,
type=str,
default="",
)
args = parser.parse_args()
matrix = []
if args.config is None or args.config == "":
matrix += generate_strategy_matrix(
args.all, read_config(THIS_DIR / "linux.json")
args.all, read_config(THIS_DIR / "linux.json"), args.distro
)
matrix += generate_strategy_matrix(
args.all, read_config(THIS_DIR / "macos.json")
args.all, read_config(THIS_DIR / "macos.json"), args.distro
)
matrix += generate_strategy_matrix(
args.all, read_config(THIS_DIR / "windows.json")
args.all, read_config(THIS_DIR / "windows.json"), args.distro
)
else:
matrix += generate_strategy_matrix(args.all, read_config(args.config))
matrix += generate_strategy_matrix(
args.all, read_config(args.config), args.distro
)
# Generate the strategy matrix.
print(f"matrix={json.dumps({'include': matrix})}")
# print(json.dumps(matrix, indent=2))

View File

@@ -128,12 +128,23 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [linux, macos, windows]
include:
- os: linux
distro: debian
- os: linux
distro: rhel
- os: linux
distro: ubuntu
- os: macos
distro: ""
- os: windows
distro: ""
with:
# Enable ccache only for events targeting the XRPLF repository, since
# other accounts will not have access to our remote cache storage.
ccache_enabled: ${{ github.repository_owner == 'XRPLF' }}
os: ${{ matrix.os }}
distro: ${{ matrix.distro }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -77,7 +77,17 @@ jobs:
strategy:
fail-fast: ${{ github.event_name == 'merge_group' }}
matrix:
os: [linux, macos, windows]
include:
- os: linux
distro: debian
- os: linux
distro: rhel
- os: linux
distro: ubuntu
- os: macos
distro: ""
- os: windows
distro: ""
with:
# Enable ccache only for events targeting the XRPLF repository, since
# other accounts will not have access to our remote cache storage.
@@ -86,6 +96,7 @@ jobs:
# not identical to a regular compilation.
ccache_enabled: ${{ github.repository_owner == 'XRPLF' && !startsWith(github.ref, 'refs/heads/release') }}
os: ${{ matrix.os }}
distro: ${{ matrix.distro }}
strategy_matrix: ${{ github.event_name == 'schedule' && 'all' || 'minimal' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -26,6 +26,12 @@ on:
type: string
default: "minimal"
distro:
description: 'Filter to only include configs for this distro (e.g. "debian", "rhel", "ubuntu"). Leave empty for no filtering.'
required: false
type: string
default: ""
secrets:
CODECOV_TOKEN:
description: "The Codecov token to use for uploading coverage reports."
@@ -38,9 +44,11 @@ jobs:
with:
os: ${{ inputs.os }}
strategy_matrix: ${{ inputs.strategy_matrix }}
distro: ${{ inputs.distro }}
# Build and test the binary for each configuration.
build-test-config:
name: ${{ matrix.config_name }}
needs:
- generate-matrix
uses: ./.github/workflows/reusable-build-test-config.yml

View File

@@ -13,6 +13,11 @@ on:
required: false
type: string
default: "minimal"
distro:
description: 'Filter to only include configs for this distro (e.g. "debian", "rhel", "ubuntu"). Leave empty for no filtering.'
required: false
type: string
default: ""
outputs:
matrix:
description: "The generated strategy matrix."
@@ -42,4 +47,5 @@ jobs:
env:
GENERATE_CONFIG: ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }}
GENERATE_OPTION: ${{ inputs.strategy_matrix == 'all' && '--all' || '' }}
run: ./generate.py ${GENERATE_OPTION} ${GENERATE_CONFIG} >> "${GITHUB_OUTPUT}"
GENERATE_DISTRO: ${{ inputs.distro != '' && format('--distro={0}', inputs.distro) || '' }}
run: ./generate.py ${GENERATE_OPTION} ${GENERATE_CONFIG} ${GENERATE_DISTRO} >> "${GITHUB_OUTPUT}"

View File

@@ -22,12 +22,6 @@ API version 2 is available in `rippled` version 2.0.0 and later. See [API-VERSIO
This version is supported by all `rippled` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified.
## Unreleased
### Additions and bugfixes
- `book_offers`: the `proof` parameter is removed from both the RPC and CLI versions. It did not do anything.
## XRP Ledger server version 3.1.0
[Version 3.1.0](https://github.com/XRPLF/rippled/releases/tag/3.1.0) was released on Jan 27, 2026.

View File

@@ -483,6 +483,7 @@ JSS(ports); // out: NetworkOPs
JSS(previous); // out: Reservations
JSS(previous_ledger); // out: LedgerPropose
JSS(price); // out: amm_info, AuctionSlot
JSS(proof); // in: BookOffers
JSS(propose_seq); // out: LedgerPropose
JSS(proposers); // out: NetworkOPs, LedgerConsensus
JSS(protocol); // out: NetworkOPs, PeerImp

View File

@@ -149,6 +149,7 @@ public:
std::shared_ptr<ReadView const>& lpLedger,
Book const& book,
AccountID const& uTakerID,
bool const bProof,
unsigned int iLimit,
Json::Value const& jvMarker,
Json::Value& jvResult) = 0;

File diff suppressed because it is too large Load Diff

View File

@@ -347,6 +347,7 @@ public:
std::shared_ptr<ReadView const>& lpLedger,
Book const&,
AccountID const& uTakerID,
bool const bProof,
unsigned int iLimit,
Json::Value const& jvMarker,
Json::Value& jvResult) override;
@@ -4171,6 +4172,7 @@ NetworkOPsImp::getBookPage(
std::shared_ptr<ReadView const>& lpLedger,
Book const& book,
AccountID const& uTakerID,
bool const bProof,
unsigned int iLimit,
Json::Value const& jvMarker,
Json::Value& jvResult)
@@ -4370,6 +4372,7 @@ NetworkOPsImp::getBookPage(
std::shared_ptr<ReadView const> lpLedger,
Book const& book,
AccountID const& uTakerID,
bool const bProof,
unsigned int iLimit,
Json::Value const& jvMarker,
Json::Value& jvResult)

View File

@@ -16,6 +16,7 @@
#include <xrpl/protocol/PublicKey.h>
#include <xrpl/protocol/RPCErr.h>
#include <xrpl/protocol/SystemParameters.h>
#include <xrpl/protocol/UintTypes.h>
#include <xrpl/protocol/jss.h>
#include <boost/algorithm/string/predicate.hpp>
@@ -24,7 +25,7 @@
#include <array>
#include <iostream>
#include <limits>
#include <type_traits>
#include <unordered_map>
namespace xrpl {
@@ -130,41 +131,6 @@ private:
}
}
static std::optional<std::int32_t>
jvParseInt(Json::Value const& param)
{
if (param.isInt())
return param.asInt();
if (param.isUInt() && param.asUInt() <= std::numeric_limits<std::int32_t>::max())
return param.asInt();
if (param.isString())
{
std::int32_t v;
if (beast::lexicalCastChecked(v, param.asString()))
return v;
}
return std::nullopt;
}
static std::optional<std::uint32_t>
jvParseUInt(Json::Value const& param)
{
if (param.isUInt() || (param.isInt() && param.asInt() >= 0))
return param.asUInt();
if (param.isString())
{
std::uint32_t v;
if (beast::lexicalCastChecked(v, param.asString()))
return v;
}
return std::nullopt;
}
static bool
validPublicKey(std::string const& strPk, TokenType type = TokenType::AccountPublic)
{
@@ -293,55 +259,24 @@ private:
}
else
{
std::int32_t ledgerMin = 0,
ledgerMax = 0; // note: these are only used when properly set
if (auto const ledgerMinOpt = jvParseInt(jvParams[1u]))
{
// A value of -1 instructs the server to use the most recent
// validated ledger version available
ledgerMin = *ledgerMinOpt;
}
else
{
return rpcError(rpcINVALID_LGR_RANGE);
}
std::int64_t uLedgerMin = jvParams[1u].asInt();
std::int64_t uLedgerMax = jvParams[2u].asInt();
if (auto const ledgerMaxOpt = jvParseInt(jvParams[2u]))
{
ledgerMax = *ledgerMaxOpt;
}
else
{
return rpcError(rpcINVALID_LGR_RANGE);
}
// `-1` means "most recent validated ledger version available"
static std::int32_t const USE_MOST_RECENT_LEDGER = -1;
if (ledgerMax != USE_MOST_RECENT_LEDGER && ledgerMax < ledgerMin)
if (uLedgerMax != -1 && uLedgerMax < uLedgerMin)
{
if (apiVersion_ == 1)
return rpcError(rpcLGR_IDXS_INVALID);
return rpcError(rpcNOT_SYNCED);
}
jvRequest[jss::ledger_index_min] = ledgerMin;
jvRequest[jss::ledger_index_max] = ledgerMax;
jvRequest[jss::ledger_index_min] = jvParams[1u].asInt();
jvRequest[jss::ledger_index_max] = jvParams[2u].asInt();
if (iParams >= 4)
{
if (auto const limit = jvParseUInt(jvParams[3u]))
jvRequest[jss::limit] = *limit;
else
return RPC::invalid_field_error(jss::limit);
}
jvRequest[jss::limit] = jvParams[3u].asInt();
if (iParams >= 5)
{
if (auto const offset = jvParseInt(jvParams[4u]))
jvRequest[jss::offset] = *offset;
else
return RPC::invalid_field_error(jss::offset);
}
jvRequest[jss::offset] = jvParams[4u].asInt();
}
return jvRequest;
@@ -387,16 +322,35 @@ private:
if (jvParams.size() >= 5)
{
if (auto const limit = jvParseUInt(jvParams[4u]))
try
{
jvRequest[jss::limit] = *limit;
int iLimit = jvParams[4u].asInt();
if (iLimit > 0)
jvRequest[jss::limit] = iLimit;
}
else
catch (std::exception const&)
{
return RPC::invalid_field_error(jss::limit);
}
}
if (jvParams.size() == 6)
jvRequest[jss::marker] = jvParams[5u];
if (jvParams.size() >= 6)
{
try
{
int bProof = jvParams[5u].asInt();
if (bProof)
jvRequest[jss::proof] = true;
}
catch (std::exception const&)
{
return RPC::invalid_field_error(jss::proof);
}
}
if (jvParams.size() == 7)
jvRequest[jss::marker] = jvParams[6u];
return jvRequest;
}
@@ -412,12 +366,7 @@ private:
std::string input = jvParams[0u].asString();
if (input.find_first_not_of("0123456789") == std::string::npos)
{
if (auto const seq = jvParseUInt(jvParams[0u]))
jvRequest["can_delete"] = *seq;
else
return RPC::invalid_field_error(jss::can_delete);
}
jvRequest["can_delete"] = jvParams[0u].asUInt();
else
jvRequest["can_delete"] = input;
@@ -433,10 +382,7 @@ private:
if (jvParams.size() == 2)
{
jvRequest[jss::ip] = ip;
if (auto const port = jvParseUInt(jvParams[1u]))
jvRequest[jss::port] = *port;
else
return RPC::invalid_field_error(jss::port);
jvRequest[jss::port] = jvParams[1u].asUInt();
return jvRequest;
}
@@ -445,12 +391,7 @@ private:
{
std::size_t colon = ip.find_last_of(":");
jvRequest[jss::ip] = std::string{ip, 0, colon};
if (auto const port = jvParseUInt(std::string{ip, colon + 1}))
jvRequest[jss::port] = *port;
else
return RPC::invalid_field_error(jss::port);
jvRequest[jss::port] = Json::Value{std::string{ip, colon + 1}}.asUInt();
return jvRequest;
}
@@ -523,12 +464,7 @@ private:
Json::Value jvRequest(Json::objectValue);
if (jvParams.size())
{
if (auto const minCount = jvParseUInt(jvParams[0u]))
jvRequest[jss::min_count] = *minCount;
else
return RPC::invalid_field_error(jss::min_count);
}
jvRequest[jss::min_count] = jvParams[0u].asUInt();
return jvRequest;
}
@@ -1132,10 +1068,7 @@ private:
{
Json::Value jvRequest{Json::objectValue};
if (auto const start = jvParseUInt(jvParams[0u]))
jvRequest[jss::start] = *start;
else
return RPC::invalid_field_error(jss::start);
jvRequest[jss::start] = jvParams[0u].asUInt();
return jvRequest;
}
@@ -1279,7 +1212,7 @@ public:
{"amm_info", &RPCParser::parseAsIs, 1, 2},
{"vault_info", &RPCParser::parseVault, 1, 2},
{"book_changes", &RPCParser::parseLedgerId, 1, 1},
{"book_offers", &RPCParser::parseBookOffers, 2, 6},
{"book_offers", &RPCParser::parseBookOffers, 2, 7},
{"can_delete", &RPCParser::parseCanDelete, 0, 1},
{"channel_authorize", &RPCParser::parseChannelAuthorize, 3, 4},
{"channel_verify", &RPCParser::parseChannelVerify, 4, 4},

View File

@@ -171,6 +171,8 @@ doBookOffers(RPC::JsonContext& context)
if (auto err = readLimitField(limit, RPC::Tuning::bookOffers, context))
return *err;
bool const bProof(context.params.isMember(jss::proof));
Json::Value const jvMarker(
context.params.isMember(jss::marker) ? context.params[jss::marker]
: Json::Value(Json::nullValue));
@@ -179,6 +181,7 @@ doBookOffers(RPC::JsonContext& context)
lpLedger,
{{pay_currency, pay_issuer}, {get_currency, get_issuer}, domain},
takerID ? *takerID : beast::zero,
bProof,
limit,
jvMarker,
jvResult);

View File

@@ -319,6 +319,7 @@ doSubscribe(RPC::JsonContext& context)
lpLedger,
field == jss::asks ? reversed(book) : book,
takerID ? *takerID : noAccount(),
false,
RPC::Tuning::bookOffers.rDefault,
jvMarker,
jvOffers);