mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-20 19:02:25 +00:00
Compare commits
2 Commits
pratik/fix
...
ximinez/lo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c248f3fe6 | ||
|
|
669617af99 |
@@ -23,6 +23,7 @@ target_compile_definitions(
|
||||
BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
>
|
||||
$<$<NOT:$<BOOL:${boost_show_deprecated}>>:
|
||||
BOOST_COROUTINES2_NO_DEPRECATION_WARNING
|
||||
BOOST_BEAST_ALLOW_DEPRECATED
|
||||
BOOST_FILESYSTEM_DEPRECATED
|
||||
>
|
||||
|
||||
@@ -82,12 +82,5 @@ tools.info.package_id:confs+=["tools.build:cxxflags", "tools.build:exelinkflags"
|
||||
boost/*:without_context=False
|
||||
# Boost stacktrace fails to build with some sanitizers
|
||||
boost/*:without_stacktrace=True
|
||||
{% elif "thread" in sanitizers %}
|
||||
# Build Boost.Context with ucontext backend for TSAN. fcontext (assembly)
|
||||
# has no TSAN annotations, so without this the BOOST_USE_TSAN/BOOST_USE_UCONTEXT
|
||||
# defines in [conf] would be ineffective.
|
||||
boost/*:extra_b2_flags=context-impl=ucontext thread-sanitizer=on define=BOOST_USE_TSAN=1
|
||||
boost/*:without_context=False
|
||||
boost/*:without_stacktrace=True
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -129,8 +129,11 @@ class Xrpl(ConanFile):
|
||||
if self.settings.compiler in ["clang", "gcc"]:
|
||||
self.options["boost"].without_cobalt = True
|
||||
|
||||
# Check if environment variable exists
|
||||
if "SANITIZERS" in os.environ:
|
||||
sanitizers = os.environ["SANITIZERS"]
|
||||
if "address" in sanitizers.lower():
|
||||
self.default_options["fPIC"] = False
|
||||
|
||||
def requirements(self):
|
||||
self.requires("boost/1.90.0", force=True, transitive_headers=True)
|
||||
|
||||
@@ -2,19 +2,17 @@
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
/// Coroutine stack size (1.5 MB). Increased from 1 MB because
|
||||
/// ASAN-instrumented deep call stacks exceeded the original limit.
|
||||
constexpr std::size_t coroStackSize = 1536 * 1024;
|
||||
|
||||
template <class F>
|
||||
JobQueue::Coro::Coro(Coro_create_t, JobQueue& jq, JobType type, std::string const& name, F&& f)
|
||||
: jq_(jq)
|
||||
, type_(type)
|
||||
, name_(name)
|
||||
, coro_(
|
||||
boost::context::protected_fixedsize_stack(coroStackSize),
|
||||
[this,
|
||||
fn = std::forward<F>(f)](boost::coroutines2::coroutine<void>::push_type& do_yield) {
|
||||
// Stack size of 1MB wasn't sufficient for deep calls. ASAN tests flagged the issue. Hence
|
||||
// increasing the size to 1.5MB.
|
||||
boost::context::protected_fixedsize_stack(1536 * 1024),
|
||||
[this, fn = std::forward<F>(f)](
|
||||
boost::coroutines2::asymmetric_coroutine<void>::push_type& do_yield) {
|
||||
yield_ = &do_yield;
|
||||
yield();
|
||||
fn(shared_from_this());
|
||||
|
||||
@@ -132,6 +132,9 @@ LoanPay::calculateBaseFee(ReadView const& view, STTx const& tx)
|
||||
|
||||
auto const regularPayment = roundPeriodicPayment(asset, loanSle->at(sfPeriodicPayment), scale) +
|
||||
loanSle->at(sfLoanServiceFee);
|
||||
if (view.rules().enabled(fixSecurity3_1_3) &&
|
||||
amount >= regularPayment * loanMaximumPaymentsPerTransaction)
|
||||
return loanMaximumPaymentsPerTransaction * normalCost;
|
||||
|
||||
// If making an overpayment, count it as a full payment because it will do
|
||||
// about the same amount of work, if not more.
|
||||
|
||||
Reference in New Issue
Block a user