diff --git a/include/xrpl/server/Manifest.h b/include/xrpl/server/Manifest.h index 7f1bba921e5..766f441dab0 100644 --- a/include/xrpl/server/Manifest.h +++ b/include/xrpl/server/Manifest.h @@ -322,6 +322,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 @@ -330,7 +334,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/Wallet.cpp b/src/libxrpl/server/Wallet.cpp index 95c2e89a200..168a68cf3e3 100644 --- a/src/libxrpl/server/Wallet.cpp +++ b/src/libxrpl/server/Wallet.cpp @@ -45,7 +45,7 @@ getManifests( continue; } - mCache.applyManifest(std::move(*mo)); + mCache.applyManifest(std::move(*mo), true); } else { @@ -81,7 +81,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; } diff --git a/src/xrpld/app/misc/detail/Manifest.cpp b/src/xrpld/app/misc/detail/Manifest.cpp index 4526bf6c165..955d63a0580 100644 --- a/src/xrpld/app/misc/detail/Manifest.cpp +++ b/src/xrpld/app/misc/detail/Manifest.cpp @@ -348,7 +348,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 @@ -356,8 +356,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. @@ -388,15 +390,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; } @@ -417,17 +420,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; }