|
rippled
|
Remembers manifests with the highest sequence number. More...

Public Member Functions | |
| ManifestCache (beast::Journal j=beast::Journal(beast::Journal::getNullSink())) | |
| std::uint32_t | sequence () const |
| A monotonically increasing number used to detect new manifests. More... | |
| PublicKey | getSigningKey (PublicKey const &pk) const |
| Returns master key's current signing key. More... | |
| PublicKey | getMasterKey (PublicKey const &pk) const |
| Returns ephemeral signing key's master public key. More... | |
| std::optional< std::uint32_t > | getSequence (PublicKey const &pk) const |
| Returns master key's current manifest sequence. More... | |
| std::optional< std::string > | getDomain (PublicKey const &pk) const |
| Returns domain claimed by a given public key. More... | |
| std::optional< std::string > | getManifest (PublicKey const &pk) const |
| Returns mainfest corresponding to a given public key. More... | |
| bool | revoked (PublicKey const &pk) const |
Returns true if master key has been revoked in a manifest. More... | |
| ManifestDisposition | applyManifest (Manifest m) |
| Add manifest to cache. More... | |
| bool | load (DatabaseCon &dbCon, std::string const &dbTable, std::string const &configManifest, std::vector< std::string > const &configRevocation) |
| Populate manifest cache with manifests in database and config. More... | |
| void | load (DatabaseCon &dbCon, std::string const &dbTable) |
| Populate manifest cache with manifests in database. More... | |
| void | save (DatabaseCon &dbCon, std::string const &dbTable, std::function< bool(PublicKey const &)> const &isTrusted) |
| Save cached manifests to database. More... | |
| template<class Function > | |
| void | for_each_manifest (Function &&f) const |
| Invokes the callback once for every populated manifest. More... | |
| template<class PreFun , class EachFun > | |
| void | for_each_manifest (PreFun &&pf, EachFun &&f) const |
| Invokes the callback once for every populated manifest. More... | |
Private Attributes | |
| beast::Journal | j_ |
| std::mutex | apply_mutex_ |
| std::mutex | read_mutex_ |
| hash_map< PublicKey, Manifest > | map_ |
| Active manifests stored by master public key. More... | |
| hash_map< PublicKey, PublicKey > | signingToMasterKeys_ |
| Master public keys stored by current ephemeral public key. More... | |
| std::atomic< std::uint32_t > | seq_ {0} |
Remembers manifests with the highest sequence number.
Definition at line 223 of file Manifest.h.
|
explicit |
Definition at line 239 of file Manifest.h.
| std::uint32_t ripple::ManifestCache::sequence | ( | ) | const |
A monotonically increasing number used to detect new manifests.
Definition at line 247 of file Manifest.h.
Returns master key's current signing key.
| pk | Master public key |
May be called concurrently
Definition at line 284 of file app/misc/impl/Manifest.cpp.
Returns ephemeral signing key's master public key.
| pk | Ephemeral signing public key |
May be called concurrently
Definition at line 296 of file app/misc/impl/Manifest.cpp.
| std::optional< std::uint32_t > ripple::ManifestCache::getSequence | ( | PublicKey const & | pk | ) | const |
Returns master key's current manifest sequence.
Definition at line 308 of file app/misc/impl/Manifest.cpp.
| std::optional< std::string > ripple::ManifestCache::getDomain | ( | PublicKey const & | pk | ) | const |
Returns domain claimed by a given public key.
Definition at line 320 of file app/misc/impl/Manifest.cpp.
| std::optional< std::string > ripple::ManifestCache::getManifest | ( | PublicKey const & | pk | ) | const |
Returns mainfest corresponding to a given public key.
Definition at line 332 of file app/misc/impl/Manifest.cpp.
| bool ripple::ManifestCache::revoked | ( | PublicKey const & | pk | ) | const |
Returns true if master key has been revoked in a manifest.
| pk | Master public key |
May be called concurrently
Definition at line 344 of file app/misc/impl/Manifest.cpp.
| ManifestDisposition ripple::ManifestCache::applyManifest | ( | Manifest | m | ) |
Add manifest to cache.
| m | Manifest to add |
ManifestDisposition::accepted if successful, or stale or invalid otherwiseMay be called concurrently
Definition at line 356 of file app/misc/impl/Manifest.cpp.
| bool ripple::ManifestCache::load | ( | DatabaseCon & | dbCon, |
| std::string const & | dbTable, | ||
| std::string const & | configManifest, | ||
| std::vector< std::string > const & | configRevocation | ||
| ) |
Populate manifest cache with manifests in database and config.
| dbCon | Database connection with dbTable |
| dbTable | Database table |
| configManifest | Base64 encoded manifest for local node's validator keys |
| configRevocation | Base64 encoded validator key revocation from the config |
May be called concurrently
Definition at line 484 of file app/misc/impl/Manifest.cpp.
| void ripple::ManifestCache::load | ( | DatabaseCon & | dbCon, |
| std::string const & | dbTable | ||
| ) |
Populate manifest cache with manifests in database.
| dbCon | Database connection with dbTable |
| dbTable | Database table |
May be called concurrently
Definition at line 477 of file app/misc/impl/Manifest.cpp.
| void ripple::ManifestCache::save | ( | DatabaseCon & | dbCon, |
| std::string const & | dbTable, | ||
| std::function< bool(PublicKey const &)> const & | isTrusted | ||
| ) |
Save cached manifests to database.
| dbCon | Database connection with ValidatorManifests table |
| isTrusted | Function that returns true if manifest is trusted |
May be called concurrently
Definition at line 541 of file app/misc/impl/Manifest.cpp.
| void ripple::ManifestCache::for_each_manifest | ( | Function && | f | ) | const |
Invokes the callback once for every populated manifest.
| f | Function called for each manifest |
May be called concurrently
Definition at line 392 of file Manifest.h.
| void ripple::ManifestCache::for_each_manifest | ( | PreFun && | pf, |
| EachFun && | f | ||
| ) | const |
Invokes the callback once for every populated manifest.
| pf | Pre-function called with the maximum number of times f will be called (useful for memory allocations) |
| f | Function called for each manifest |
May be called concurrently
Definition at line 418 of file Manifest.h.
|
mutableprivate |
Definition at line 226 of file Manifest.h.
|
private |
Definition at line 227 of file Manifest.h.
|
mutableprivate |
Definition at line 228 of file Manifest.h.
Active manifests stored by master public key.
Definition at line 231 of file Manifest.h.
Master public keys stored by current ephemeral public key.
Definition at line 234 of file Manifest.h.
|
private |
Definition at line 236 of file Manifest.h.
1.8.17