diff --git a/src/xrpld/app/misc/Manifest.h b/src/xrpld/app/misc/Manifest.h index a41e16dbf95..159edae0dc6 100644 --- a/src/xrpld/app/misc/Manifest.h +++ b/src/xrpld/app/misc/Manifest.h @@ -312,6 +312,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 @@ -320,7 +324,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/xrpld/app/misc/detail/Manifest.cpp b/src/xrpld/app/misc/detail/Manifest.cpp index c226407231c..6fdadd13abd 100644 --- a/src/xrpld/app/misc/detail/Manifest.cpp +++ b/src/xrpld/app/misc/detail/Manifest.cpp @@ -341,7 +341,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 @@ -350,7 +350,8 @@ ManifestCache::applyManifest(Manifest m) // 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 { + [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. @@ -381,15 +382,15 @@ 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; } @@ -409,15 +410,17 @@ ManifestCache::applyManifest(Manifest m) // used as the master or ephemeral key of another manifest: 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/xrpld/app/rdb/detail/Wallet.cpp b/src/xrpld/app/rdb/detail/Wallet.cpp index 88a5dcf9855..a927de62af7 100644 --- a/src/xrpld/app/rdb/detail/Wallet.cpp +++ b/src/xrpld/app/rdb/detail/Wallet.cpp @@ -38,7 +38,7 @@ getManifests(soci::session& session, std::string const& dbTable, ManifestCache& continue; } - mCache.applyManifest(std::move(*mo)); + mCache.applyManifest(std::move(*mo), true); } else { @@ -74,7 +74,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; }