mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 10:35:50 +00:00
chore: Run prettier on all files (#5657)
This commit is contained in:
@@ -4,37 +4,34 @@ Utility functions and classes.
|
||||
|
||||
ripple/basic should contain no dependencies on other modules.
|
||||
|
||||
# Choosing a rippled container.
|
||||
|
||||
Choosing a rippled container.
|
||||
=============================
|
||||
- `std::vector`
|
||||
- For ordered containers with most insertions or erases at the end.
|
||||
|
||||
* `std::vector`
|
||||
* For ordered containers with most insertions or erases at the end.
|
||||
- `std::deque`
|
||||
- For ordered containers with most insertions or erases at the start or end.
|
||||
|
||||
* `std::deque`
|
||||
* For ordered containers with most insertions or erases at the start or end.
|
||||
|
||||
* `std::list`
|
||||
* For ordered containers with inserts and erases to the middle.
|
||||
* For containers with iterators stable over insert and erase.
|
||||
* Generally slower and bigger than `std::vector` or `std::deque` except for
|
||||
- `std::list`
|
||||
- For ordered containers with inserts and erases to the middle.
|
||||
- For containers with iterators stable over insert and erase.
|
||||
- Generally slower and bigger than `std::vector` or `std::deque` except for
|
||||
those cases.
|
||||
|
||||
* `std::set`
|
||||
* For sorted containers.
|
||||
- `std::set`
|
||||
- For sorted containers.
|
||||
|
||||
* `ripple::hash_set`
|
||||
* Where inserts and contains need to be O(1).
|
||||
* For "small" sets, `std::set` might be faster and smaller.
|
||||
- `ripple::hash_set`
|
||||
- Where inserts and contains need to be O(1).
|
||||
- For "small" sets, `std::set` might be faster and smaller.
|
||||
|
||||
* `ripple::hardened_hash_set`
|
||||
* For data sets where the key could be manipulated by an attacker
|
||||
in an attempt to mount an algorithmic complexity attack: see
|
||||
- `ripple::hardened_hash_set`
|
||||
- For data sets where the key could be manipulated by an attacker
|
||||
in an attempt to mount an algorithmic complexity attack: see
|
||||
http://en.wikipedia.org/wiki/Algorithmic_complexity_attack
|
||||
|
||||
|
||||
The following container is deprecated
|
||||
|
||||
* `std::unordered_set`
|
||||
* Use `ripple::hash_set` instead, which uses a better hashing algorithm.
|
||||
* Or use `ripple::hardened_hash_set` to prevent algorithmic complexity attacks.
|
||||
- `std::unordered_set`
|
||||
- Use `ripple::hash_set` instead, which uses a better hashing algorithm.
|
||||
- Or use `ripple::hardened_hash_set` to prevent algorithmic complexity attacks.
|
||||
|
||||
@@ -79,4 +79,3 @@ mirror the JSON test as much as possible.
|
||||
Refer to the Protocol Buffers [language
|
||||
guide](https://developers.google.com/protocol-buffers/docs/proto3)
|
||||
for more detailed information about Protocol Buffers.
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ optional fields easier to read:
|
||||
if it exists, or nothing if it doesn't." This usage of the
|
||||
tilde/bitwise NOT operator is not standard outside of the
|
||||
`rippled` codebase.
|
||||
- As a consequence of this, `x[~sfFoo] = y[~sfFoo]`
|
||||
assigns the value of Foo from y to x, including omitting
|
||||
Foo from x if it doesn't exist in y.
|
||||
- As a consequence of this, `x[~sfFoo] = y[~sfFoo]`
|
||||
assigns the value of Foo from y to x, including omitting
|
||||
Foo from x if it doesn't exist in y.
|
||||
|
||||
Typically, for things that are guaranteed to exist, you use
|
||||
`x[sfFoo]` and avoid having to deal with a container that may
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Resource::Manager #
|
||||
# Resource::Manager
|
||||
|
||||
The ResourceManager module has these responsibilities:
|
||||
|
||||
@@ -7,7 +7,7 @@ The ResourceManager module has these responsibilities:
|
||||
- Provide an interface to share load information in a cluster.
|
||||
- Warn and/or disconnect endpoints for imposing load.
|
||||
|
||||
## Description ##
|
||||
## Description
|
||||
|
||||
To prevent monopolization of server resources or attacks on servers,
|
||||
resource consumption is monitored at each endpoint. When consumption
|
||||
@@ -33,44 +33,44 @@ Although RPC connections consume resources, they are transient and
|
||||
cannot be rate limited. It is advised not to expose RPC interfaces
|
||||
to the general public.
|
||||
|
||||
## Consumer Types ##
|
||||
## Consumer Types
|
||||
|
||||
Consumers are placed into three classifications (as identified by the
|
||||
Resource::Kind enumeration):
|
||||
|
||||
- InBound,
|
||||
- OutBound, and
|
||||
- Admin
|
||||
- InBound,
|
||||
- OutBound, and
|
||||
- Admin
|
||||
|
||||
Each caller determines for itself the classification of the Consumer it is
|
||||
creating.
|
||||
Each caller determines for itself the classification of the Consumer it is
|
||||
creating.
|
||||
|
||||
## Resource Loading ##
|
||||
## Resource Loading
|
||||
|
||||
It is expected that a client will impose a higher load on the server
|
||||
when it first connects: the client may need to catch up on transactions
|
||||
it has missed, or get trust lines, or transfer fees. The Manager must
|
||||
it has missed, or get trust lines, or transfer fees. The Manager must
|
||||
expect this initial peak load, but not allow that high load to continue
|
||||
because over the long term that would unduly stress the server.
|
||||
|
||||
If a client places a sustained high load on the server, that client
|
||||
is initially given a warning message. If that high load continues
|
||||
is initially given a warning message. If that high load continues
|
||||
the Manager may tell the heavily loaded server to drop the connection
|
||||
entirely and not allow re-connection for some amount of time.
|
||||
|
||||
Each load is monitored by capturing peaks and then decaying those peak
|
||||
values over time: this is implemented by the DecayingSample class.
|
||||
|
||||
## Gossip ##
|
||||
## Gossip
|
||||
|
||||
Each server in a cluster creates a list of IP addresses of end points
|
||||
that are imposing a significant load. This list is called Gossip, which
|
||||
is passed to other nodes in that cluster. Gossip helps individual
|
||||
that are imposing a significant load. This list is called Gossip, which
|
||||
is passed to other nodes in that cluster. Gossip helps individual
|
||||
servers in the cluster identify IP addreses that might be unduly loading
|
||||
the entire cluster. Again the recourse of the individual servers is to
|
||||
the entire cluster. Again the recourse of the individual servers is to
|
||||
drop connections to those IP addresses that occur commonly in the gossip.
|
||||
|
||||
## Access ##
|
||||
## Access
|
||||
|
||||
In rippled, the Application holds a unique instance of Resource::Manager,
|
||||
which may be retrieved by calling the method
|
||||
|
||||
Reference in New Issue
Block a user