Merge branch 'develop' into FN-36-credential_pins_pseudo_account

This commit is contained in:
Vito Tumas
2026-08-13 22:05:45 +02:00
committed by GitHub
3 changed files with 23 additions and 21 deletions

View File

@@ -2,13 +2,6 @@ ARG BASE_IMAGE=debian:bookworm
FROM ${BASE_IMAGE}
# Packaging runs in a vanilla distro image, so the tooling has to come
# from the distro's archive: debhelper for deb, rpm-build (and the
# systemd / find-debuginfo macros it depends on) for rpm.
# The container also uses git (real history) for
# build_pkg.sh's SOURCE_DATE_EPOCH; otherwise it falls back to a tarball
# download and the timestamp comes from wall-clock time.
COPY package/install-packaging-tools.sh /tmp/install-packaging-tools.sh
RUN /tmp/install-packaging-tools.sh

View File

@@ -22,12 +22,23 @@ case "${ID}" in
;;
esac
# Packaging runs in a vanilla distro image, so the tooling comes from the distro's
# archive rather than from nixpkgs:
#
# - debhelper and dpkg-dev build the DEB
# - rpm-build builds the RPM, with systemd-rpm-macros and redhat-rpm-config
# supplying the systemd and find-debuginfo macros the spec uses
# - git gives build_pkg.sh a real history to read SOURCE_DATE_EPOCH from;
# without one the timestamp falls back to the wall clock
# - curl uploads the finished packages in publish_pkg.sh
# - ca-certificates lets curl and git verify TLS
function install() {
case "${ID}" in
debian | ubuntu)
apt-get update -y
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
debhelper \
debhelper-compat \
dpkg-dev \
@@ -36,6 +47,7 @@ function install() {
rhel | centos | rocky | almalinux)
dnf install -y --setopt=install_weak_deps=False \
curl-minimal \
git \
rpm-build \
redhat-rpm-config \

View File

@@ -28,7 +28,6 @@
#include <xrpl/basics/Slice.h>
#include <xrpl/basics/base_uint.h>
#include <xrpl/basics/random.h>
#include <xrpl/beast/net/IPAddress.h>
#include <xrpl/beast/net/IPEndpoint.h>
#include <xrpl/beast/unit_test/suite.h>
@@ -53,6 +52,7 @@
#include <xrpl.pb.h>
#include <algorithm>
#include <atomic>
#include <cassert>
#include <chrono>
#include <cstddef>
@@ -402,7 +402,7 @@ public:
enum class PeerSetBehavior {
Good,
Drop50,
DropAlternate,
DropAll,
DropSkipListReply,
DropLedgerDeltaReply,
@@ -445,17 +445,13 @@ struct TestPeerSet : public PeerSet
protocol::MessageType type,
std::shared_ptr<Peer> const& peer) override
{
int dropRate = 0;
if (behavior == PeerSetBehavior::Drop50)
{
dropRate = 50;
}
else if (behavior == PeerSetBehavior::DropAll)
{
dropRate = 100;
}
if (behavior == PeerSetBehavior::DropAll)
return;
if (randInt(1, 100) <= dropRate)
// Drop every other message deterministically. Alternating drops
// still exercise the timeout/retry path while guaranteeing every
// subtask eventually gets a reply.
if (behavior == PeerSetBehavior::DropAlternate && sendCount++ % 2 == 0)
return;
switch (type)
@@ -500,6 +496,7 @@ struct TestPeerSet : public PeerSet
LedgerReplayMsgHandler& remote;
std::shared_ptr<TestPeer> dummyPeer;
PeerSetBehavior behavior;
std::atomic<int> sendCount{0};
};
/**
@@ -1397,7 +1394,7 @@ struct LedgerReplayer_test : public beast::unit_test::Suite
case PeerSetBehavior::Good:
testcase("good network");
break;
case PeerSetBehavior::Drop50:
case PeerSetBehavior::DropAlternate:
testcase("network drops 50% messages");
break;
case PeerSetBehavior::Repeat:
@@ -1613,7 +1610,7 @@ struct LedgerReplayer_test : public beast::unit_test::Suite
testAllInboundLedgers(4);
testPeerSetBehavior(PeerSetBehavior::Good, 1);
testPeerSetBehavior(PeerSetBehavior::Good);
testPeerSetBehavior(PeerSetBehavior::Drop50);
testPeerSetBehavior(PeerSetBehavior::DropAlternate);
testPeerSetBehavior(PeerSetBehavior::Repeat);
testStop();
testSkipListBadReply();