diff --git a/include/xrpl/server/Manifest.h b/include/xrpl/server/Manifest.h index eed1c14dae3..7d8303bcc2c 100644 --- a/include/xrpl/server/Manifest.h +++ b/include/xrpl/server/Manifest.h @@ -323,6 +323,10 @@ class ManifestCache @param m Manifest to add + @param loading Indicate whether the manifest is being loaded from the + local database (at startup). Lowers the severity of some log + messages. + @return `ManifestDisposition::accepted` if successful, or `stale` or `invalid` otherwise @@ -331,7 +335,7 @@ class ManifestCache May be called concurrently */ ManifestDisposition - applyManifest(Manifest m); + applyManifest(Manifest m, bool loading = false); /** Populate manifest cache with manifests in database and config. diff --git a/src/libxrpl/server/Manifest.cpp b/src/libxrpl/server/Manifest.cpp index 1b0493dd9dd..386ad2aeaa1 100644 --- a/src/libxrpl/server/Manifest.cpp +++ b/src/libxrpl/server/Manifest.cpp @@ -377,7 +377,7 @@ ManifestCache::revoked(PublicKey const& pk) const } ManifestDisposition -ManifestCache::applyManifest(Manifest m) +ManifestCache::applyManifest(Manifest m, bool loading) { // Check the manifest against the conditions that do not require a // `unique_lock` (write lock) on the `mutex_`. Since the signature can be @@ -385,8 +385,10 @@ ManifestCache::applyManifest(Manifest m) // signature should be checked. Since `prewriteCheck` is run twice (see // comment below), `checkSignature` only needs to be set to true on the // first run. - auto prewriteCheck = [this, &m](auto const& iter, bool checkSignature, auto const& lock) - -> std::optional { + auto prewriteCheck = [this, &m, &loading]( + auto const& iter, + bool checkSignature, + auto const& lock) -> std::optional { XRPL_ASSERT(lock.owns_lock(), "xrpl::ManifestCache::applyManifest::prewriteCheck : locked"); (void)lock; // not used. parameter is present to ensure the mutex is // locked when the lambda is called. @@ -417,15 +419,16 @@ ManifestCache::applyManifest(Manifest m) // one. bool const revoked = m.revoked(); - if (auto stream = j_.warn(); stream && revoked) + if (auto stream = loading ? j_.info() : j_.warn(); stream && revoked) logMftAct(stream, "Revoked", m.masterKey, m.sequence); // Sanity check: the master key of this manifest should not be used as // the ephemeral key of another manifest: if (auto const x = signingToMasterKeys_.find(m.masterKey); x != signingToMasterKeys_.end()) { - JLOG(j_.warn()) << to_string(m) << ": Master key already used as ephemeral key for " - << toBase58(TokenType::NodePublic, x->second); + JLOG((loading ? j_.info() : j_.warn())) + << to_string(m) << ": Master key already used as ephemeral key for " + << toBase58(TokenType::NodePublic, x->second); return ManifestDisposition::BadMasterKey; } @@ -446,17 +449,18 @@ ManifestCache::applyManifest(Manifest m) if (auto const x = signingToMasterKeys_.find(*m.signingKey); x != signingToMasterKeys_.end()) { - JLOG(j_.warn()) << to_string(m) - << ": Ephemeral key already used as ephemeral key for " - << toBase58(TokenType::NodePublic, x->second); + JLOG((loading ? j_.info() : j_.warn())) + << to_string(m) << ": Ephemeral key already used as ephemeral key for " + << toBase58(TokenType::NodePublic, x->second); return ManifestDisposition::BadEphemeralKey; } if (auto const x = map_.find(*m.signingKey); x != map_.end()) { - JLOG(j_.warn()) << to_string(m) << ": Ephemeral key used as master key for " - << to_string(x->second); + JLOG((loading ? j_.info() : j_.warn())) + << to_string(m) << ": Ephemeral key used as master key for " + << to_string(x->second); return ManifestDisposition::BadEphemeralKey; } diff --git a/src/libxrpl/server/Wallet.cpp b/src/libxrpl/server/Wallet.cpp index f3ae9dc925c..0214d37388d 100644 --- a/src/libxrpl/server/Wallet.cpp +++ b/src/libxrpl/server/Wallet.cpp @@ -75,7 +75,7 @@ getManifests( continue; } - cache.applyManifest(std::move(*mo)); + cache.applyManifest(std::move(*mo), true); } else { @@ -111,7 +111,6 @@ saveManifests( // but only save trusted non-revocation manifests. if (!v.second.revoked() && !isTrusted(v.second.masterKey)) { - JLOG(j.info()) << "Untrusted manifest in cache not saved to db"; continue; }