rippled
rpc/impl/Tuning.h
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 #ifndef RIPPLE_RPC_TUNING_H_INCLUDED
21 #define RIPPLE_RPC_TUNING_H_INCLUDED
22 
23 namespace ripple {
24 namespace RPC {
25 
28 namespace Tuning {
29 
31 struct LimitRange
32 {
33  unsigned int rmin, rdefault, rmax;
34 };
35 
37 static LimitRange constexpr accountLines = {10, 200, 400};
38 
40 static LimitRange constexpr accountChannels = {10, 200, 400};
41 
43 static LimitRange constexpr accountObjects = {10, 200, 400};
44 
46 static LimitRange constexpr accountOffers = {10, 200, 400};
47 
49 static LimitRange constexpr bookOffers = {0, 60, 100};
50 
52 static LimitRange constexpr noRippleCheck = {10, 300, 400};
53 
55 static LimitRange constexpr accountNFTokens = {20, 100, 400};
56 
58 static LimitRange constexpr nftOffers = {50, 250, 500};
59 
60 static int constexpr defaultAutoFillFeeMultiplier = 10;
61 static int constexpr defaultAutoFillFeeDivisor = 1;
62 static int constexpr maxPathfindsInProgress = 2;
63 static int constexpr maxPathfindJobCount = 50;
64 static int constexpr maxJobQueueClients = 500;
66 static int constexpr maxRequestSize = 1000000;
67 
69 static int constexpr binaryPageLength = 2048;
70 
72 static int constexpr jsonPageLength = 256;
73 
75 inline int constexpr pageLength(bool isBinary)
76 {
77  return isBinary ? binaryPageLength : jsonPageLength;
78 }
79 
81 static int constexpr max_src_cur = 18;
82 
84 static int constexpr max_auto_src_cur = 88;
85 
86 } // namespace Tuning
89 } // namespace RPC
90 } // namespace ripple
91 
92 #endif
ripple::RPC::Tuning::noRippleCheck
static constexpr LimitRange noRippleCheck
Limits for the no_ripple_check command.
Definition: rpc/impl/Tuning.h:52
ripple::RPC::Tuning::accountNFTokens
static constexpr LimitRange accountNFTokens
Limits for the account_nftokens command, in pages.
Definition: rpc/impl/Tuning.h:55
std::chrono::minutes
ripple::RPC::Tuning::LimitRange::rdefault
unsigned int rdefault
Definition: rpc/impl/Tuning.h:33
ripple::RPC::Tuning::bookOffers
static constexpr LimitRange bookOffers
Limits for the book_offers command.
Definition: rpc/impl/Tuning.h:49
ripple::RPC::Tuning::accountLines
static constexpr LimitRange accountLines
Limits for the account_lines command.
Definition: rpc/impl/Tuning.h:37
ripple::RPC::Tuning::nftOffers
static constexpr LimitRange nftOffers
Limits for the nft_buy_offers & nft_sell_offers commands.
Definition: rpc/impl/Tuning.h:58
ripple::RPC::Tuning::max_src_cur
static constexpr int max_src_cur
Maximum number of source currencies allowed in a path find request.
Definition: rpc/impl/Tuning.h:81
ripple::RPC::Tuning::maxPathfindJobCount
static constexpr int maxPathfindJobCount
Definition: rpc/impl/Tuning.h:63
ripple::RPC::Tuning::maxRequestSize
static constexpr int maxRequestSize
Definition: rpc/impl/Tuning.h:66
ripple::RPC::Tuning::pageLength
constexpr int pageLength(bool isBinary)
Maximum number of pages in a LedgerData response.
Definition: rpc/impl/Tuning.h:75
ripple::RPC::Tuning::accountObjects
static constexpr LimitRange accountObjects
Limits for the account_objects command.
Definition: rpc/impl/Tuning.h:43
ripple::RPC::Tuning::LimitRange::rmax
unsigned int rmax
Definition: rpc/impl/Tuning.h:33
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RPC::Tuning::accountOffers
static constexpr LimitRange accountOffers
Limits for the account_offers command.
Definition: rpc/impl/Tuning.h:46
ripple::RPC::Tuning::binaryPageLength
static constexpr int binaryPageLength
Maximum number of pages in one response from a binary LedgerData request.
Definition: rpc/impl/Tuning.h:69
ripple::RPC::Tuning::LimitRange::rmin
unsigned int rmin
Definition: rpc/impl/Tuning.h:33
ripple::RPC::Tuning::max_auto_src_cur
static constexpr int max_auto_src_cur
Maximum number of auto source currencies in a path find request.
Definition: rpc/impl/Tuning.h:84
ripple::RPC::Tuning::accountChannels
static constexpr LimitRange accountChannels
Limits for the account_channels command.
Definition: rpc/impl/Tuning.h:40
ripple::RPC::Tuning::jsonPageLength
static constexpr int jsonPageLength
Maximum number of pages in one response from a Json LedgerData request.
Definition: rpc/impl/Tuning.h:72
ripple::RPC::Tuning::LimitRange
Represents RPC limit parameter values that have a min, default and max.
Definition: rpc/impl/Tuning.h:31
ripple::RPC::Tuning::defaultAutoFillFeeMultiplier
static constexpr int defaultAutoFillFeeMultiplier
Definition: rpc/impl/Tuning.h:60
ripple::RPC::Tuning::maxPathfindsInProgress
static constexpr int maxPathfindsInProgress
Definition: rpc/impl/Tuning.h:62
ripple::RPC::Tuning::defaultAutoFillFeeDivisor
static constexpr int defaultAutoFillFeeDivisor
Definition: rpc/impl/Tuning.h:61
ripple::RPC::Tuning::maxJobQueueClients
static constexpr int maxJobQueueClients
Definition: rpc/impl/Tuning.h:64
ripple::RPC::Tuning::maxValidatedLedgerAge
constexpr auto maxValidatedLedgerAge
Definition: rpc/impl/Tuning.h:65