inconsitency(solana): fill truncated log messages#1847
Open
Conversation
There was a problem hiding this comment.
Code Review Summary
Reviewed the addition of a fallback RPC client for filling truncated Solana log messages. The overall approach is sound — introducing an optional fallback that fetches full transaction logs when the primary source returns truncated data. The config refactoring into RpcProviderConnectionConfig is clean.
Key findings (by priority)
Potential bugs / reliability concerns:
fill_truncated_logsusesanyhow::ensure!and?propagation on per-transaction RPC failures, which bubble up as.recoverable()errors. This could cause infinite retries of the block stream if the fallback persistently returns fewer log entries or a single transaction fetch fails. Consider graceful degradation (warn + skip) instead of hard errors for these cases.
Documentation mismatch (will cause user-facing breakage):
- The README uses
main_rpc_provider_infoin the TOML example and config table, but the actual struct field isrpc_provider_info. The sample TOML and test config use the correct name. Users following the README will get deserialization errors. - Missing
$in test config env var{FALLBACK_SOLANA_MAINNET_RPC_URL}. - Sample TOML has confusing structure for auth fields (commented section header
# [rpc_provider_info]after the real section) and a minor grammar issue.
Pattern violations:
- Logging:
tracing::warn!at line 579 uses non-descriptive field names (id,slot), missing%display prefix, verbose present-tense message. See inline comment for suggested fix perdocs/code/logging.md. - Documentation:
RpcProviderConnectionInfopublic fields lack doc comments perdocs/code/rust-documentation.md.
Minor / non-blocking:
solana_compare.rsduplicates the truncated log marker string instead of using theTRUNCATED_LOG_MESSAGES_MARKERconstant fromclient.rs.- Sequential RPC calls in
fill_truncated_logscould be parallelized if truncated logs are common. - Pre-existing: test functions modified in this PR lack Given-When-Then comment structure and naming conventions per
docs/code/test-functions.md. Not introduced by this PR, but worth noting for future cleanup.
- Add a fallback RPC client that fetches full transaction logs when the primary source (OF1 or main JSON-RPC) returns truncated log messages. This client is optional. If it is missing, truncated log messages will be kept. - Make necessary changes to the Solana provider config to allow the use of the fallback RPC client.
7473dfc to
f2a04d5
Compare
Contributor
|
@sistemd can you check the conflicts? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was the last known inconsistency for Solana.