rippled
Change.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 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/ledger/Ledger.h>
21 #include <ripple/app/main/Application.h>
22 #include <ripple/app/misc/AmendmentTable.h>
23 #include <ripple/app/misc/NetworkOPs.h>
24 #include <ripple/app/tx/impl/Change.h>
25 #include <ripple/basics/Log.h>
26 #include <ripple/ledger/Sandbox.h>
27 #include <ripple/protocol/Feature.h>
28 #include <ripple/protocol/Indexes.h>
29 #include <ripple/protocol/TxFlags.h>
30 #include <string_view>
31 
32 namespace ripple {
33 
34 NotTEC
36 {
37  auto const ret = preflight0(ctx);
38  if (!isTesSuccess(ret))
39  return ret;
40 
41  auto account = ctx.tx.getAccountID(sfAccount);
42  if (account != beast::zero)
43  {
44  JLOG(ctx.j.warn()) << "Change: Bad source id";
45  return temBAD_SRC_ACCOUNT;
46  }
47 
48  // No point in going any further if the transaction fee is malformed.
49  auto const fee = ctx.tx.getFieldAmount(sfFee);
50  if (!fee.native() || fee != beast::zero)
51  {
52  JLOG(ctx.j.warn()) << "Change: invalid fee";
53  return temBAD_FEE;
54  }
55 
56  if (!ctx.tx.getSigningPubKey().empty() || !ctx.tx.getSignature().empty() ||
58  {
59  JLOG(ctx.j.warn()) << "Change: Bad signature";
60  return temBAD_SIGNATURE;
61  }
62 
63  if (ctx.tx.getFieldU32(sfSequence) != 0 ||
65  {
66  JLOG(ctx.j.warn()) << "Change: Bad sequence";
67  return temBAD_SEQUENCE;
68  }
69 
70  if (ctx.tx.getTxnType() == ttUNL_MODIFY &&
72  {
73  JLOG(ctx.j.warn()) << "Change: NegativeUNL not enabled";
74  return temDISABLED;
75  }
76 
77  return tesSUCCESS;
78 }
79 
80 TER
82 {
83  // If tapOPEN_LEDGER is resurrected into ApplyFlags,
84  // this block can be moved to preflight.
85  if (ctx.view.open())
86  {
87  JLOG(ctx.j.warn()) << "Change transaction against open ledger";
88  return temINVALID;
89  }
90 
91  switch (ctx.tx.getTxnType())
92  {
93  case ttFEE:
94  if (ctx.view.rules().enabled(featureXRPFees))
95  {
96  // The ttFEE transaction format defines these fields as
97  // optional, but once the XRPFees feature is enabled, they are
98  // required.
99  if (!ctx.tx.isFieldPresent(sfBaseFeeDrops) ||
102  return temMALFORMED;
103  // The ttFEE transaction format defines these fields as
104  // optional, but once the XRPFees feature is enabled, they are
105  // forbidden.
106  if (ctx.tx.isFieldPresent(sfBaseFee) ||
110  return temMALFORMED;
111  }
112  else
113  {
114  // The ttFEE transaction format formerly defined these fields
115  // as required. When the XRPFees feature was implemented, they
116  // were changed to be optional. Until the feature has been
117  // enabled, they are required.
118  if (!ctx.tx.isFieldPresent(sfBaseFee) ||
122  return temMALFORMED;
123  // The ttFEE transaction format defines these fields as
124  // optional, but without the XRPFees feature, they are
125  // forbidden.
126  if (ctx.tx.isFieldPresent(sfBaseFeeDrops) ||
129  return temDISABLED;
130  }
131  return tesSUCCESS;
132  case ttAMENDMENT:
133  case ttUNL_MODIFY:
134  return tesSUCCESS;
135  default:
136  return temUNKNOWN;
137  }
138 }
139 
140 TER
142 {
143  switch (ctx_.tx.getTxnType())
144  {
145  case ttAMENDMENT:
146  return applyAmendment();
147  case ttFEE:
148  return applyFee();
149  case ttUNL_MODIFY:
150  return applyUNLModify();
151  default:
152  assert(0);
153  return tefFAILURE;
154  }
155 }
156 
157 void
159 {
160  assert(account_ == beast::zero);
161 }
162 
163 void
165 {
166  JLOG(j_.warn()) << "fixTrustLinesToSelf amendment activation code starting";
167 
168  auto removeTrustLineToSelf = [this](Sandbox& sb, uint256 id) {
169  auto tl = sb.peek(keylet::child(id));
170 
171  if (tl == nullptr)
172  {
173  JLOG(j_.warn()) << id << ": Unable to locate trustline";
174  return true;
175  }
176 
177  if (tl->getType() != ltRIPPLE_STATE)
178  {
179  JLOG(j_.warn()) << id << ": Unexpected type "
180  << static_cast<std::uint16_t>(tl->getType());
181  return true;
182  }
183 
184  auto const& lo = tl->getFieldAmount(sfLowLimit);
185  auto const& hi = tl->getFieldAmount(sfHighLimit);
186 
187  if (lo != hi)
188  {
189  JLOG(j_.warn()) << id << ": Trustline doesn't meet requirements";
190  return true;
191  }
192 
193  if (auto const page = tl->getFieldU64(sfLowNode); !sb.dirRemove(
194  keylet::ownerDir(lo.getIssuer()), page, tl->key(), false))
195  {
196  JLOG(j_.error()) << id << ": failed to remove low entry from "
197  << toBase58(lo.getIssuer()) << ":" << page
198  << " owner directory";
199  return false;
200  }
201 
202  if (auto const page = tl->getFieldU64(sfHighNode); !sb.dirRemove(
203  keylet::ownerDir(hi.getIssuer()), page, tl->key(), false))
204  {
205  JLOG(j_.error()) << id << ": failed to remove high entry from "
206  << toBase58(hi.getIssuer()) << ":" << page
207  << " owner directory";
208  return false;
209  }
210 
211  if (tl->getFlags() & lsfLowReserve)
213  sb, sb.peek(keylet::account(lo.getIssuer())), -1, j_);
214 
215  if (tl->getFlags() & lsfHighReserve)
217  sb, sb.peek(keylet::account(hi.getIssuer())), -1, j_);
218 
219  sb.erase(tl);
220 
221  JLOG(j_.warn()) << "Successfully deleted trustline " << id;
222 
223  return true;
224  };
225 
226  using namespace std::literals;
227 
228  Sandbox sb(&view());
229 
230  if (removeTrustLineToSelf(
231  sb,
232  uint256{
233  "2F8F21EFCAFD7ACFB07D5BB04F0D2E18587820C7611305BB674A64EAB0FA71E1"sv}) &&
234  removeTrustLineToSelf(
235  sb,
236  uint256{
237  "326035D5C0560A9DA8636545DD5A1B0DFCFF63E68D491B5522B767BB00564B1A"sv}))
238  {
239  JLOG(j_.warn()) << "fixTrustLinesToSelf amendment activation code "
240  "executed successfully";
241  sb.apply(ctx_.rawView());
242  }
243 }
244 
245 TER
247 {
248  uint256 amendment(ctx_.tx.getFieldH256(sfAmendment));
249 
250  auto const k = keylet::amendments();
251 
252  SLE::pointer amendmentObject = view().peek(k);
253 
254  if (!amendmentObject)
255  {
256  amendmentObject = std::make_shared<SLE>(k);
257  view().insert(amendmentObject);
258  }
259 
260  STVector256 amendments = amendmentObject->getFieldV256(sfAmendments);
261 
262  if (std::find(amendments.begin(), amendments.end(), amendment) !=
263  amendments.end())
264  return tefALREADY;
265 
266  auto flags = ctx_.tx.getFlags();
267 
268  const bool gotMajority = (flags & tfGotMajority) != 0;
269  const bool lostMajority = (flags & tfLostMajority) != 0;
270 
271  if (gotMajority && lostMajority)
272  return temINVALID_FLAG;
273 
274  STArray newMajorities(sfMajorities);
275 
276  bool found = false;
277  if (amendmentObject->isFieldPresent(sfMajorities))
278  {
279  const STArray& oldMajorities =
280  amendmentObject->getFieldArray(sfMajorities);
281  for (auto const& majority : oldMajorities)
282  {
283  if (majority.getFieldH256(sfAmendment) == amendment)
284  {
285  if (gotMajority)
286  return tefALREADY;
287  found = true;
288  }
289  else
290  {
291  // pass through
292  newMajorities.push_back(majority);
293  }
294  }
295  }
296 
297  if (!found && lostMajority)
298  return tefALREADY;
299 
300  if (gotMajority)
301  {
302  // This amendment now has a majority
303  newMajorities.push_back(STObject(sfMajority));
304  auto& entry = newMajorities.back();
305  entry.emplace_back(STUInt256(sfAmendment, amendment));
306  entry.emplace_back(STUInt32(
307  sfCloseTime, view().parentCloseTime().time_since_epoch().count()));
308 
309  if (!ctx_.app.getAmendmentTable().isSupported(amendment))
310  {
311  JLOG(j_.warn()) << "Unsupported amendment " << amendment
312  << " received a majority.";
313  }
314  }
315  else if (!lostMajority)
316  {
317  // No flags, enable amendment
318  amendments.push_back(amendment);
319  amendmentObject->setFieldV256(sfAmendments, amendments);
320 
321  if (amendment == fixTrustLinesToSelf)
323 
324  ctx_.app.getAmendmentTable().enable(amendment);
325 
326  if (!ctx_.app.getAmendmentTable().isSupported(amendment))
327  {
328  JLOG(j_.error()) << "Unsupported amendment " << amendment
329  << " activated: server blocked.";
331  }
332  }
333 
334  if (newMajorities.empty())
335  amendmentObject->makeFieldAbsent(sfMajorities);
336  else
337  amendmentObject->setFieldArray(sfMajorities, newMajorities);
338 
339  view().update(amendmentObject);
340 
341  return tesSUCCESS;
342 }
343 
344 TER
346 {
347  auto const k = keylet::fees();
348 
349  SLE::pointer feeObject = view().peek(k);
350 
351  if (!feeObject)
352  {
353  feeObject = std::make_shared<SLE>(k);
354  view().insert(feeObject);
355  }
356  auto set = [](SLE::pointer& feeObject, STTx const& tx, auto const& field) {
357  feeObject->at(field) = tx[field];
358  };
359  if (view().rules().enabled(featureXRPFees))
360  {
361  set(feeObject, ctx_.tx, sfBaseFeeDrops);
362  set(feeObject, ctx_.tx, sfReserveBaseDrops);
363  set(feeObject, ctx_.tx, sfReserveIncrementDrops);
364  // Ensure the old fields are removed
365  feeObject->makeFieldAbsent(sfBaseFee);
366  feeObject->makeFieldAbsent(sfReferenceFeeUnits);
367  feeObject->makeFieldAbsent(sfReserveBase);
368  feeObject->makeFieldAbsent(sfReserveIncrement);
369  }
370  else
371  {
372  set(feeObject, ctx_.tx, sfBaseFee);
373  set(feeObject, ctx_.tx, sfReferenceFeeUnits);
374  set(feeObject, ctx_.tx, sfReserveBase);
375  set(feeObject, ctx_.tx, sfReserveIncrement);
376  }
377 
378  view().update(feeObject);
379 
380  JLOG(j_.warn()) << "Fees have been changed";
381  return tesSUCCESS;
382 }
383 
384 TER
386 {
387  if (!isFlagLedger(view().seq()))
388  {
389  JLOG(j_.warn()) << "N-UNL: applyUNLModify, not a flag ledger, seq="
390  << view().seq();
391  return tefFAILURE;
392  }
393 
398  {
399  JLOG(j_.warn()) << "N-UNL: applyUNLModify, wrong Tx format.";
400  return tefFAILURE;
401  }
402 
403  bool const disabling = ctx_.tx.getFieldU8(sfUNLModifyDisabling);
404  auto const seq = ctx_.tx.getFieldU32(sfLedgerSequence);
405  if (seq != view().seq())
406  {
407  JLOG(j_.warn()) << "N-UNL: applyUNLModify, wrong ledger seq=" << seq;
408  return tefFAILURE;
409  }
410 
411  Blob const validator = ctx_.tx.getFieldVL(sfUNLModifyValidator);
412  if (!publicKeyType(makeSlice(validator)))
413  {
414  JLOG(j_.warn()) << "N-UNL: applyUNLModify, bad validator key";
415  return tefFAILURE;
416  }
417 
418  JLOG(j_.info()) << "N-UNL: applyUNLModify, "
419  << (disabling ? "ToDisable" : "ToReEnable")
420  << " seq=" << seq
421  << " validator data:" << strHex(validator);
422 
423  auto const k = keylet::negativeUNL();
424  SLE::pointer negUnlObject = view().peek(k);
425  if (!negUnlObject)
426  {
427  negUnlObject = std::make_shared<SLE>(k);
428  view().insert(negUnlObject);
429  }
430 
431  bool const found = [&] {
432  if (negUnlObject->isFieldPresent(sfDisabledValidators))
433  {
434  auto const& negUnl =
435  negUnlObject->getFieldArray(sfDisabledValidators);
436  for (auto const& v : negUnl)
437  {
438  if (v.isFieldPresent(sfPublicKey) &&
439  v.getFieldVL(sfPublicKey) == validator)
440  return true;
441  }
442  }
443  return false;
444  }();
445 
446  if (disabling)
447  {
448  // cannot have more than one toDisable
449  if (negUnlObject->isFieldPresent(sfValidatorToDisable))
450  {
451  JLOG(j_.warn()) << "N-UNL: applyUNLModify, already has ToDisable";
452  return tefFAILURE;
453  }
454 
455  // cannot be the same as toReEnable
456  if (negUnlObject->isFieldPresent(sfValidatorToReEnable))
457  {
458  if (negUnlObject->getFieldVL(sfValidatorToReEnable) == validator)
459  {
460  JLOG(j_.warn())
461  << "N-UNL: applyUNLModify, ToDisable is same as ToReEnable";
462  return tefFAILURE;
463  }
464  }
465 
466  // cannot be in negative UNL already
467  if (found)
468  {
469  JLOG(j_.warn())
470  << "N-UNL: applyUNLModify, ToDisable already in negative UNL";
471  return tefFAILURE;
472  }
473 
474  negUnlObject->setFieldVL(sfValidatorToDisable, validator);
475  }
476  else
477  {
478  // cannot have more than one toReEnable
479  if (negUnlObject->isFieldPresent(sfValidatorToReEnable))
480  {
481  JLOG(j_.warn()) << "N-UNL: applyUNLModify, already has ToReEnable";
482  return tefFAILURE;
483  }
484 
485  // cannot be the same as toDisable
486  if (negUnlObject->isFieldPresent(sfValidatorToDisable))
487  {
488  if (negUnlObject->getFieldVL(sfValidatorToDisable) == validator)
489  {
490  JLOG(j_.warn())
491  << "N-UNL: applyUNLModify, ToReEnable is same as ToDisable";
492  return tefFAILURE;
493  }
494  }
495 
496  // must be in negative UNL
497  if (!found)
498  {
499  JLOG(j_.warn())
500  << "N-UNL: applyUNLModify, ToReEnable is not in negative UNL";
501  return tefFAILURE;
502  }
503 
504  negUnlObject->setFieldVL(sfValidatorToReEnable, validator);
505  }
506 
507  view().update(negUnlObject);
508  return tesSUCCESS;
509 }
510 
511 } // namespace ripple
ripple::STArray::empty
bool empty() const
Definition: STArray.h:254
ripple::STTx::getTxnType
TxType getTxnType() const
Definition: STTx.h:179
ripple::tfGotMajority
constexpr std::uint32_t tfGotMajority
Definition: TxFlags.h:118
ripple::keylet::ownerDir
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Definition: Indexes.cpp:303
ripple::isFlagLedger
bool isFlagLedger(LedgerIndex seq)
Returns true if the given ledgerIndex is a flag ledgerIndex.
Definition: Ledger.cpp:969
ripple::sfUNLModifyValidator
const SF_VL sfUNLModifyValidator
ripple::tfLostMajority
constexpr std::uint32_t tfLostMajority
Definition: TxFlags.h:119
ripple::sfBaseFeeDrops
const SF_AMOUNT sfBaseFeeDrops
ripple::makeSlice
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Definition: Slice.h:241
ripple::sfReserveBase
const SF_UINT32 sfReserveBase
ripple::Change::applyUNLModify
TER applyUNLModify()
Definition: Change.cpp:385
ripple::featureXRPFees
const uint256 featureXRPFees
ripple::Rules::enabled
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
Definition: Rules.cpp:94
std::shared_ptr< STLedgerEntry >
ripple::PreclaimContext::view
ReadView const & view
Definition: Transactor.h:56
ripple::sfSigners
const SField sfSigners
ripple::keylet::amendments
Keylet const & amendments() noexcept
The index of the amendment table.
Definition: Indexes.cpp:163
ripple::PreclaimContext::j
const beast::Journal j
Definition: Transactor.h:60
ripple::ApplyView::peek
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
ripple::sfLedgerSequence
const SF_UINT32 sfLedgerSequence
ripple::lsfLowReserve
@ lsfLowReserve
Definition: LedgerFormats.h:252
ripple::Transactor::j_
const beast::Journal j_
Definition: Transactor.h:89
ripple::isTesSuccess
bool isTesSuccess(TER x)
Definition: TER.h:597
ripple::Sandbox::apply
void apply(RawView &to)
Definition: Sandbox.h:55
ripple::sfSequence
const SF_UINT32 sfSequence
ripple::Application::getAmendmentTable
virtual AmendmentTable & getAmendmentTable()=0
std::vector< unsigned char >
std::find
T find(T... args)
ripple::STUInt32
STInteger< std::uint32_t > STUInt32
Definition: STInteger.h:80
ripple::STObject::getFieldU8
unsigned char getFieldU8(SField const &field) const
Definition: STObject.cpp:547
ripple::ttFEE
@ ttFEE
This system-generated transaction type is used to update the network's fee settings.
Definition: TxFormats.h:152
ripple::toBase58
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:104
beast::Journal::warn
Stream warn() const
Definition: Journal.h:327
ripple::keylet::child
Keylet child(uint256 const &key) noexcept
Any item that can be in an owner dir.
Definition: Indexes.cpp:139
ripple::STArray::push_back
void push_back(STObject const &object)
Definition: STArray.h:212
ripple::Change::preCompute
void preCompute() override
Definition: Change.cpp:158
ripple::NetworkOPs::setAmendmentBlocked
virtual void setAmendmentBlocked()=0
ripple::ApplyView::update
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
ripple::sfCloseTime
const SF_UINT32 sfCloseTime
ripple::ApplyContext::rawView
RawView & rawView()
Definition: ApplyContext.h:67
ripple::STObject::getFieldVL
Blob getFieldVL(SField const &field) const
Definition: STObject.cpp:595
ripple::ttAMENDMENT
@ ttAMENDMENT
This system-generated transaction type is used to update the status of the various amendments.
Definition: TxFormats.h:146
ripple::PreflightContext::j
const beast::Journal j
Definition: Transactor.h:38
ripple::Application::getOPs
virtual NetworkOPs & getOPs()=0
ripple::ApplyContext::app
Application & app
Definition: ApplyContext.h:47
ripple::STUInt256
STBitString< 256 > STUInt256
Definition: STBitString.h:86
ripple::ApplyView::dirRemove
bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)
Remove an entry from a directory.
Definition: ApplyView.cpp:189
ripple::publicKeyType
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
Definition: PublicKey.cpp:207
ripple::sfLowNode
const SF_UINT64 sfLowNode
ripple::Keylet::key
uint256 key
Definition: Keylet.h:40
ripple::base_uint< 256 >
ripple::temINVALID_FLAG
@ temINVALID_FLAG
Definition: TER.h:109
ripple::sfLowLimit
const SF_AMOUNT sfLowLimit
ripple::preflight0
NotTEC preflight0(PreflightContext const &ctx)
Performs early sanity checks on the txid.
Definition: Transactor.cpp:41
ripple::adjustOwnerCount
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
Definition: View.cpp:713
ripple::ttUNL_MODIFY
@ ttUNL_MODIFY
This system-generated transaction type is used to update the network's negative UNL.
Definition: TxFormats.h:158
ripple::keylet::account
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:133
ripple::STObject::getAccountID
AccountID getAccountID(SField const &field) const
Definition: STObject.cpp:589
ripple::sfReserveIncrement
const SF_UINT32 sfReserveIncrement
ripple::TERSubset< CanCvtToTER >
ripple::STArray
Definition: STArray.h:28
ripple::Sandbox
Discardable, editable view to a ledger.
Definition: Sandbox.h:34
ripple::temBAD_SEQUENCE
@ temBAD_SEQUENCE
Definition: TER.h:102
ripple::temBAD_SRC_ACCOUNT
@ temBAD_SRC_ACCOUNT
Definition: TER.h:104
ripple::set
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
Definition: BasicConfig.h:313
ripple::sfValidatorToDisable
const SF_VL sfValidatorToDisable
ripple::Change::doApply
TER doApply() override
Definition: Change.cpp:141
beast::Journal::error
Stream error() const
Definition: Journal.h:333
beast::Journal::info
Stream info() const
Definition: Journal.h:321
ripple::STObject::getFlags
std::uint32_t getFlags() const
Definition: STObject.cpp:481
ripple::sfMajority
const SField sfMajority
ripple::STTx
Definition: STTx.h:45
ripple::STTx::getSigningPubKey
Blob getSigningPubKey() const
Definition: STTx.h:185
ripple::sfPreviousTxnID
const SF_UINT256 sfPreviousTxnID
std::uint16_t
ripple::sfHighLimit
const SF_AMOUNT sfHighLimit
ripple::temBAD_SIGNATURE
@ temBAD_SIGNATURE
Definition: TER.h:103
ripple::temUNKNOWN
@ temUNKNOWN
Definition: TER.h:122
ripple::tefFAILURE
@ tefFAILURE
Definition: TER.h:148
ripple::AmendmentTable::enable
virtual bool enable(uint256 const &amendment)=0
ripple::temBAD_FEE
@ temBAD_FEE
Definition: TER.h:90
ripple::sfReserveIncrementDrops
const SF_AMOUNT sfReserveIncrementDrops
ripple::sfReserveBaseDrops
const SF_AMOUNT sfReserveBaseDrops
ripple::fixTrustLinesToSelf
const uint256 fixTrustLinesToSelf
ripple::PreclaimContext::tx
STTx const & tx
Definition: Transactor.h:58
ripple::sfUNLModifyDisabling
const SF_UINT8 sfUNLModifyDisabling
ripple::Change::preclaim
static TER preclaim(PreclaimContext const &ctx)
Definition: Change.cpp:81
ripple::AmendmentTable::isSupported
virtual bool isSupported(uint256 const &amendment) const =0
ripple::PreclaimContext
State information when determining if a tx is likely to claim a fee.
Definition: Transactor.h:52
ripple::Change::applyAmendment
TER applyAmendment()
Definition: Change.cpp:246
ripple::sfBaseFee
const SF_UINT64 sfBaseFee
ripple::detail::ApplyViewBase::erase
void erase(std::shared_ptr< SLE > const &sle) override
Remove a peeked SLE.
Definition: ApplyViewBase.cpp:134
ripple::STObject::emplace_back
std::size_t emplace_back(Args &&... args)
Definition: STObject.h:907
ripple::Change::preflight
static NotTEC preflight(PreflightContext const &ctx)
Definition: Change.cpp:35
ripple::STObject
Definition: STObject.h:51
ripple::ApplyView::insert
virtual void insert(std::shared_ptr< SLE > const &sle)=0
Insert a new state SLE.
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::Transactor::view
ApplyView & view()
Definition: Transactor.h:107
ripple::temDISABLED
@ temDISABLED
Definition: TER.h:112
ripple::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition: ReadView.h:193
ripple::STTx::getSignature
Blob getSignature() const
Definition: STTx.cpp:170
ripple::ReadView::rules
virtual Rules const & rules() const =0
Returns the tx processing rules.
ripple::tefALREADY
@ tefALREADY
Definition: TER.h:149
ripple::featureNegativeUNL
const uint256 featureNegativeUNL
ripple::STObject::isFieldPresent
bool isFieldPresent(SField const &field) const
Definition: STObject.cpp:428
ripple::sfReferenceFeeUnits
const SF_UINT32 sfReferenceFeeUnits
ripple::STVector256
Definition: STVector256.h:29
std::vector::empty
T empty(T... args)
ripple::Transactor::ctx_
ApplyContext & ctx_
Definition: Transactor.h:88
ripple::STArray::back
STObject & back()
Definition: STArray.h:193
ripple::keylet::fees
Keylet const & fees() noexcept
The (fixed) index of the object containing the ledger fees.
Definition: Indexes.cpp:171
ripple::sfFee
const SF_AMOUNT sfFee
ripple::sfAccount
const SF_ACCOUNT sfAccount
ripple::ltRIPPLE_STATE
@ ltRIPPLE_STATE
A ledger object which describes a bidirectional trust line.
Definition: LedgerFormats.h:74
ripple::detail::ApplyViewBase::peek
std::shared_ptr< SLE > peek(Keylet const &k) override
Prepare to modify the SLE associated with key.
Definition: ApplyViewBase.cpp:128
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
ripple::Change::activateTrustLinesToSelfFix
void activateTrustLinesToSelfFix()
Definition: Change.cpp:164
ripple::temMALFORMED
@ temMALFORMED
Definition: TER.h:85
ripple::PreflightContext::tx
STTx const & tx
Definition: Transactor.h:35
ripple::STObject::getFieldU32
std::uint32_t getFieldU32(SField const &field) const
Definition: STObject.cpp:559
ripple::PreflightContext
State information when preflighting a tx.
Definition: Transactor.h:31
ripple::keylet::negativeUNL
Keylet const & negativeUNL() noexcept
The (fixed) index of the object containing the ledger negativeUNL.
Definition: Indexes.cpp:179
ripple::PreflightContext::rules
const Rules rules
Definition: Transactor.h:36
ripple::sfAmendment
const SF_UINT256 sfAmendment
ripple::Change::applyFee
TER applyFee()
Definition: Change.cpp:345
ripple::sfMajorities
const SField sfMajorities
ripple::ReadView::open
virtual bool open() const =0
Returns true if this reflects an open ledger.
ripple::lsfHighReserve
@ lsfHighReserve
Definition: LedgerFormats.h:253
ripple::sfDisabledValidators
const SField sfDisabledValidators
ripple::tesSUCCESS
@ tesSUCCESS
Definition: TER.h:222
string_view
ripple::sfPublicKey
const SF_VL sfPublicKey
ripple::Transactor::account_
const AccountID account_
Definition: Transactor.h:91
ripple::sfHighNode
const SF_UINT64 sfHighNode
ripple::STObject::getFieldAmount
STAmount const & getFieldAmount(SField const &field) const
Definition: STObject.cpp:603
ripple::ApplyContext::tx
STTx const & tx
Definition: ApplyContext.h:48
ripple::temINVALID
@ temINVALID
Definition: TER.h:108
ripple::sfAmendments
const SF_VECTOR256 sfAmendments
ripple::sfValidatorToReEnable
const SF_VL sfValidatorToReEnable
ripple::NotTEC
TERSubset< CanCvtToNotTEC > NotTEC
Definition: TER.h:528
ripple::STObject::getFieldH256
uint256 getFieldH256(SField const &field) const
Definition: STObject.cpp:583