Skip to content

refactor: replace with_indexer with photon_url in LightClientConfig#1814

Merged
ananas-block merged 3 commits intomainfrom
sergey/light-client-photon-url
Jun 16, 2025
Merged

refactor: replace with_indexer with photon_url in LightClientConfig#1814
ananas-block merged 3 commits intomainfrom
sergey/light-client-photon-url

Conversation

@sergeytimoshin
Copy link
Contributor

@sergeytimoshin sergeytimoshin commented Jun 15, 2025

Summary by CodeRabbit

  • New Features

    • Added support for configuring an optional Photon URL in RPC connection and pool setup.
    • Updated configuration options to allow specifying a Photon service endpoint where applicable.
  • Refactor

    • Replaced the previous indexer flag with an explicit Photon URL parameter across client, configuration, and builder interfaces.
    • Simplified test and utility setup by using new configuration methods and removing redundant parameters.
  • Tests

    • Streamlined test configurations to use updated setup methods and Photon URL handling.

…fig` and adjust related tests and RPC calls
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 15, 2025

Walkthrough

This change replaces the with_indexer boolean flag with an optional photon_url string across the codebase. The new photon_url field is propagated through configuration structs, constructors, and builder patterns for Solana RPC connections and light clients, allowing explicit configuration of an external photon service endpoint.

Changes

File(s) Change Summary
forester-utils/src/rpc_pool.rs Added optional photon_url to SolanaConnectionManager and SolanaRpcPoolBuilder; updated methods.
sdk-libs/client/src/rpc/rpc_trait.rs Replaced with_indexer: bool with photon_url: Option<String> in LightClientConfig; updated methods.
sdk-libs/client/src/rpc/client.rs Simplified indexer initialization to use photon_url instead of with_indexer.
.../epoch_manager.rs, .../forester_status.rs, .../lib.rs Updated LightClientConfig usage to set photon_url and remove with_indexer.
.../address_v2_test.rs, .../batched_state_async_indexer_test.rs, ... Tests updated to use photon_url or LightClientConfig::local(); removed with_indexer.
.../batched_address_test.rs, .../batched_state_test.rs, .../e2e_test.rs Tests updated to set photon_url: None and remove with_indexer.
.../priority_fee_test.rs, .../batched_state_indexer_test.rs Simplified test setup using LightClientConfig::local(); removed unused imports.
program-tests/utils/src/setup_accounts.rs Replaced with_indexer: false with photon_url: None in config.
xtask/src/create_*.rs, xtask/src/new_deployment.rs Updated LightClientConfig to use photon_url: None instead of with_indexer.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PoolBuilder
    participant ConnectionManager
    participant LightClient

    User->>PoolBuilder: set photon_url (optional)
    PoolBuilder->>ConnectionManager: build with photon_url
    ConnectionManager->>LightClient: create with LightClientConfig(photon_url)
    LightClient->>LightClient: Optionally create PhotonIndexer if photon_url is Some
Loading

Possibly related PRs

  • Lightprotocol/light-protocol#1799: Refactors to use LightClientConfig instead of RpcConfig in similar files, touching related configuration logic but not introducing photon_url.

Suggested reviewers

  • SwenSchaeferjohann

Poem

A photon hops along the wire,
No indexer flag, just URLs to inspire.
Configs now clearer, code less dense,
A hop, a skip, a photon makes sense!
With every new field, the future looks bright—
Hopping forward, code feels light!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
xtask/src/create_state_tree.rs (1)

47-52: Same concern as in create_batch_state_tree.rs

Repeating the suggestion: allow callers to supply a photon_url instead of hard-coding None.

🧹 Nitpick comments (8)
xtask/src/create_batch_state_tree.rs (1)

47-52: Expose photon_url instead of hard-coding None

Hard-coding photon_url: None forces downstream users to recompile if they want to hit a remote Photon service. Consider wiring it through the Options CLI (e.g. --photon-url) or allowing an env var fallback so scripts stay flexible.

+    #[clap(long)]
+    photon_url: Option<String>,
...
-    photon_url: None,
+    photon_url: options.photon_url,
program-tests/utils/src/setup_accounts.rs (1)

13-18: Derive Default for LightClientConfig to cut boilerplate

Every call site now has to be touched whenever a new field is added. Implementing Default (if not already present) lets you build configs concisely:

-    let mut rpc = light_client::rpc::LightClient::new(LightClientConfig {
-        commitment_config: Some(CommitmentConfig::confirmed()),
-        url: url.to_string(),
-        photon_url: None,
-        fetch_active_tree: false,
-    })
+    let mut rpc = light_client::rpc::LightClient::new(LightClientConfig {
+        url: url.to_string(),
+        ..Default::default()
+    })

This reduces churn the next time a field is added.

xtask/src/create_batch_address_tree.rs (1)

42-47: Provide a way to set photon_url

For parity with other tooling, expose --photon-url (or env var) and pass it through instead of always using None.

forester/tests/batched_state_test.rs (1)

70-76: Consider the LightClientConfig::local() helper

The manual construction duplicates the built-in helper intended for local validators and keeps the tests slightly harder to tweak.

-let mut rpc = LightClient::new(LightClientConfig {
-    url: RpcUrl::Localnet.to_string(),
-    photon_url: None,
-    commitment_config: Some(commitment_config),
-    fetch_active_tree: false,
-})
+let mut rpc = LightClient::new(
+    LightClientConfig::local()
+        .with_commitment(commitment_config) // assuming the builder exposes this
+)

Up to you, but adopting the helper keeps test setup consistent across files.

forester/src/epoch_manager.rs (1)

476-481: Avoid copy-pasting LightClientConfig literals

The three call-sites build nearly identical configs by hand. Extracting a helper (e.g. fn forester_rpc_config(indexer: Option<String>) -> LightClientConfig) will:

  • guarantee all options stay in sync with future field additions
  • remove boilerplate
  • simplify unit-testing of configuration

Also applies to: 545-551, 1196-1202

forester/tests/e2e_test.rs (1)

406-411: Avoid duplicating manual literals
Now that local_no_indexer() exists, consider using it here as well (or a helper like devnet(None)) instead of an in-place struct literal – this keeps the configuration source-of-truth in one place:

-    let mut rpc = LightClient::new(LightClientConfig {
-        url: RpcUrl::Localnet.to_string(),
-        photon_url: None,
-        commitment_config: Some(CommitmentConfig::confirmed()),
-        fetch_active_tree: false,
-    })
+    let mut rpc = LightClient::new(LightClientConfig::local_no_indexer())
sdk-libs/client/src/rpc/rpc_trait.rs (1)

61-68: Minor API ergonomics
devnet(photon_url: Option<String>) is flexible, but most callers will pass a concrete URL. Accepting impl Into<String> and wrapping it in Some() internally would remove boilerplate:

pub fn devnet<P: Into<String>>(photon_url: Option<P>) -> Self {}

Low priority, but worth considering.

forester-utils/src/rpc_pool.rs (1)

137-140: Builder takes Option<String> directly
Passing an Option into a builder feels a bit clunky (.photon_url(Some(url))). Allowing a plain String (and handling None by omission) would make the API smoother, but this is purely cosmetic.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 983f687 and 34b60b3.

📒 Files selected for processing (19)
  • forester-utils/src/rpc_pool.rs (7 hunks)
  • forester/src/epoch_manager.rs (3 hunks)
  • forester/src/forester_status.rs (1 hunks)
  • forester/src/lib.rs (2 hunks)
  • forester/tests/address_v2_test.rs (3 hunks)
  • forester/tests/batched_address_test.rs (1 hunks)
  • forester/tests/batched_state_async_indexer_test.rs (2 hunks)
  • forester/tests/batched_state_indexer_test.rs (2 hunks)
  • forester/tests/batched_state_test.rs (1 hunks)
  • forester/tests/e2e_test.rs (2 hunks)
  • forester/tests/priority_fee_test.rs (2 hunks)
  • program-tests/utils/src/setup_accounts.rs (1 hunks)
  • sdk-libs/client/src/rpc/client.rs (1 hunks)
  • sdk-libs/client/src/rpc/rpc_trait.rs (2 hunks)
  • xtask/src/create_batch_address_tree.rs (1 hunks)
  • xtask/src/create_batch_state_tree.rs (1 hunks)
  • xtask/src/create_state_tree.rs (1 hunks)
  • xtask/src/create_update_protocol_config_ix.rs (1 hunks)
  • xtask/src/new_deployment.rs (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
forester/tests/priority_fee_test.rs (2)
sdk-libs/client/src/rpc/rpc_trait.rs (3)
  • new (35-42)
  • new (73-75)
  • local (52-59)
sdk-libs/client/src/rpc/client.rs (1)
  • new (419-424)
forester/tests/batched_state_async_indexer_test.rs (2)
sdk-libs/client/src/rpc/rpc_trait.rs (3)
  • new (35-42)
  • new (73-75)
  • local (52-59)
sdk-libs/client/src/rpc/client.rs (1)
  • new (419-424)
⏰ Context from checks skipped due to timeout of 90000ms (22)
  • GitHub Check: system-programs (token-escrow-test, [ "cargo test-sbf -p token-escrow" ])
  • GitHub Check: system-programs (sdk-anchor-test-program, ["cargo-test-sbf -p sdk-anchor-test", "cargo-test-sbf -...
  • GitHub Check: system-programs (sdk-test-program, ["cargo-test-sbf -p sdk-test"])
  • GitHub Check: system-programs (counter-test, ["cargo test-sbf -p counter"])
  • GitHub Check: test-2-foresters
  • GitHub Check: test-address-batched
  • GitHub Check: test-double-registration
  • GitHub Check: test-state-photon-batched
  • GitHub Check: test-state-batched
  • GitHub Check: test-e2e
  • GitHub Check: stateless-js
  • GitHub Check: system-programs (random-e2e-test, ["cargo-test-sbf -p e2e-test"])
  • GitHub Check: system-programs (system-cpi-test-v2, ["cargo-test-sbf -p system-cpi-v2-test"])
  • GitHub Check: system-programs (account-compression, ["cargo-test-sbf -p account-compression-test"])
  • GitHub Check: system-programs (system-cpi-test, ["cargo-test-sbf -p system-cpi-test"])
  • GitHub Check: system-programs (light-registry, ["cargo-test-sbf -p registry-test"])
  • GitHub Check: system-programs (light-system-program, ["cargo-test-sbf -p system-test"])
  • GitHub Check: system-programs (light-compressed-token, ["cargo-test-sbf -p compressed-token-test"])
  • GitHub Check: Test concurrent-merkle-tree
  • GitHub Check: Test sdk-libs
  • GitHub Check: Test program-libs
  • GitHub Check: lint
🔇 Additional comments (14)
forester/tests/batched_address_test.rs (1)

66-70: Config update looks correct

The test now matches the new LightClientConfig signature and keeps behaviour unchanged.

forester/tests/batched_state_indexer_test.rs (1)

64-64: Switch to LightClientConfig::local() – good call

The helper cleans up boilerplate and keeps the test focused on business logic. Nice tidy-up.

forester/tests/priority_fee_test.rs (2)

9-12: Import appears correct – no issues spotted

Signer is needed for pubkey() so the new import is appropriate.


80-83: Confirm the target RPC endpoint before hard-coding LightClientConfig::local()

LightClientConfig::local() forces the client to http://localhost:8899, while the rest of the test suite pulls RPC / WS URLs from the environment.
If those env vars ever point to a non-local validator the test will silently talk to the wrong cluster.

Consider wiring the env-provided URL into LightClientConfig::new(...) instead, or assert that FORESTER_RPC_URL=="http://localhost:8899".

forester/src/lib.rs (2)

54-59: Disabling the photon indexer – is this intentional?

Setting photon_url: None means the light client instantiated in run_queue_info cannot use the photon indexer even when one is configured elsewhere.
If that is intentional (e.g. to minimise network I/O) 👍. Otherwise, consider threading the value from config.external_services.indexer_url.


101-105: photon_url() is fed with indexer_url – naming mismatch could confuse

The builder now binds

.photon_url(config.external_services.indexer_url.clone())

Verify that indexer_url indeed holds the photon service endpoint, not some other GRPC/REST indexer. A quick rename in the config struct might avoid future confusion.

forester/tests/address_v2_test.rs (2)

12-15: Updated imports align with new API

The switch to the re-exported traits (MerkleTreeExt, Rpc) is consistent with the refactor.


72-76: Ensure the local-validator is actually on localhost:8899

LightClientConfig::local() hard-codes the RPC URL; the init() helper spins up a validator, but if it binds to a different port the test will fail.

forester/tests/batched_state_async_indexer_test.rs (2)

15-16: Import cleanup looks good
RpcUrl is no longer referenced in this file after switching to the convenience constructor, so removing the sub-module import is the right call.


224-226: Confirm commitment level change
LightClientConfig::local() defaults to CommitmentConfig::confirmed() whereas the previous hand-rolled config used processed().
For heavily time-sensitive tests this tighter commitment can introduce extra slots of delay and may hide race-conditions that only occur at processed. Make sure all call-sites are happy with the stronger commitment or revert to local_no_indexer() and override the commitment explicitly.

forester/tests/e2e_test.rs (1)

63-66: Nice simplification
Replacing the verbose struct literal with LightClientConfig::local_no_indexer() improves readability and avoids repetition.

sdk-libs/client/src/rpc/rpc_trait.rs (2)

30-32: Field introduced cleanly
photon_url: Option<String> integrates without breaking existing semantics – good job.


35-42: new() now forces fetch_active_tree = true – double-check callers
Previously some call-sites relied on fetch_active_tree being false unless explicitly enabled. The new helper toggles it to true, which causes an extra RPC round-trip on every light-client instantiation. If that’s unintended, expose fetch_active_tree as a parameter or keep the default consistent with the other constructors (local*/devnet).

forester-utils/src/rpc_pool.rs (1)

28-35: Good propagation of photon_url
Adding the field to the connection manager keeps configuration plumbing straightforward.

Comment on lines 35 to 42
let rpc = LightClient::new(LightClientConfig {
url: rpc_url,
photon_url: None,
commitment_config: None,
fetch_active_tree: false,
with_indexer: false,
})
.await
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Handle LightClient initialization errors instead of panicking

unwrap() will crash the CLI on transient network issues or mis-configuration. Because the surrounding function already returns anyhow::Result<()>, you can propagate the error cleanly and optionally surface more context.

-    let rpc = LightClient::new(LightClientConfig {
-        url: rpc_url,
-        photon_url: None,
-        commitment_config: None,
-        fetch_active_tree: false,
-    })
-    .await
-    .unwrap();
+    let rpc = LightClient::new(LightClientConfig {
+        url: rpc_url,
+        photon_url: None, // consider wiring this from an env/CLI flag
+        commitment_config: None,
+        fetch_active_tree: false,
+    })
+    .await
+    .context("failed to initialise LightClient")?;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let rpc = LightClient::new(LightClientConfig {
url: rpc_url,
photon_url: None,
commitment_config: None,
fetch_active_tree: false,
with_indexer: false,
})
.await
.unwrap();
let rpc = LightClient::new(LightClientConfig {
url: rpc_url,
photon_url: None, // consider wiring this from an env/CLI flag
commitment_config: None,
fetch_active_tree: false,
})
.await
.context("failed to initialise LightClient")?;
🤖 Prompt for AI Agents
In xtask/src/create_update_protocol_config_ix.rs around lines 35 to 42, the
LightClient initialization uses unwrap(), which causes a panic on errors.
Replace unwrap() with the ? operator to propagate the error properly, and
optionally add context using .context() from anyhow to provide clearer error
messages while maintaining the function's anyhow::Result return type.

Comment on lines 56 to 63
let mut rpc = LightClient::new(LightClientConfig {
url: rpc_url,
photon_url: None,
commitment_config: None,
fetch_active_tree: false,
with_indexer: false,
})
.await
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace unwrap() with ? and provide error context

For long-running provisioning scripts, a panic is painful to diagnose. Propagate the error with context instead.

-    let mut rpc = LightClient::new(LightClientConfig {
+    let mut rpc = LightClient::new(LightClientConfig {
         url: rpc_url,
         photon_url: None,
         commitment_config: None,
         fetch_active_tree: false,
-    })
-    .await
-    .unwrap();
+    })
+    .await
+    .context("failed to create LightClient")?;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let mut rpc = LightClient::new(LightClientConfig {
url: rpc_url,
photon_url: None,
commitment_config: None,
fetch_active_tree: false,
with_indexer: false,
})
.await
.unwrap();
let mut rpc = LightClient::new(LightClientConfig {
url: rpc_url,
photon_url: None,
commitment_config: None,
fetch_active_tree: false,
})
.await
.context("failed to create LightClient")?;
🤖 Prompt for AI Agents
In xtask/src/new_deployment.rs around lines 56 to 63, replace the use of
unwrap() on the LightClient::new call with the ? operator to propagate errors
instead of panicking. Additionally, wrap the error with context using a method
like .context() or map_err() to provide a clear error message that aids in
diagnosing failures during provisioning.

Comment on lines 176 to 183
let mut rpc = LightClient::new(LightClientConfig {
url: config.external_services.rpc_url.to_string(),
photon_url: None,
commitment_config: None,
fetch_active_tree: false,
with_indexer: false,
})
.await
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use configured photon_url and avoid panic on LightClient build

The ForesterConfig already carries external_services.photon_url; passing None disables the indexer even when the user enabled it in the config. At the same time, unwrap() will abort the status command on any RPC hiccup.

-    let mut rpc = LightClient::new(LightClientConfig {
-        url: config.external_services.rpc_url.to_string(),
-        photon_url: None,
+    let mut rpc = LightClient::new(LightClientConfig {
+        url: config.external_services.rpc_url.to_string(),
+        photon_url: config.external_services.photon_url.clone(),
         commitment_config: None,
         fetch_active_tree: false,
-    })
-    .await
-    .unwrap();
+    })
+    .await
+    .context("failed to create LightClient")?;

This preserves the new configuration surface and improves robustness.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let mut rpc = LightClient::new(LightClientConfig {
url: config.external_services.rpc_url.to_string(),
photon_url: None,
commitment_config: None,
fetch_active_tree: false,
with_indexer: false,
})
.await
.unwrap();
let mut rpc = LightClient::new(LightClientConfig {
url: config.external_services.rpc_url.to_string(),
photon_url: config.external_services.photon_url.clone(),
commitment_config: None,
fetch_active_tree: false,
})
.await
.context("failed to create LightClient")?;
🤖 Prompt for AI Agents
In forester/src/forester_status.rs around lines 176 to 183, replace the
hardcoded None for photon_url with the configured photon_url from
external_services to respect user settings. Also, instead of using unwrap() on
the LightClient::new call, handle the Result properly to avoid panics on RPC
failures, for example by using match or if let to gracefully handle errors and
improve robustness.

Comment on lines 111 to 115
let retry_config = retry_config.unwrap_or_default();

let indexer = if config.with_indexer {
if config.url == RpcUrl::Localnet.to_string() {
Some(PhotonIndexer::new(
"http://127.0.0.1:8784".to_string(),
None,
))
} else {
Some(PhotonIndexer::new(
config.url.to_string(),
None, // TODO: test that this is not required
))
}
} else {
None
};
let indexer = config.photon_url.map(|path| PhotonIndexer::new(path, None));

let mut new = Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Photon API key silently dropped

PhotonIndexer::new(path, None) ignores any API key that may be required for production use. If the key is available but not forwarded, authenticated requests will fail.

- let indexer = config.photon_url.map(|path| PhotonIndexer::new(path, None));
+ // Propagate the optional API key once LightClientConfig is extended
+ let indexer = config
+     .photon_url
+     .as_ref()
+     .map(|path| PhotonIndexer::new(path.clone(), config.photon_api_key.clone()));

This will need:

  1. Adding photon_api_key: Option<String> to LightClientConfig.
  2. Populating it in the builders/tests that already carry the key.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In sdk-libs/client/src/rpc/client.rs around lines 111 to 115, the PhotonIndexer
is created without passing the API key, causing it to be silently dropped and
leading to failed authenticated requests. To fix this, add a photon_api_key
field of type Option<String> to the LightClientConfig struct, update all
builders and tests that instantiate LightClientConfig to populate this new field
with the API key if available, and modify the PhotonIndexer::new call to pass
the API key instead of None so that authenticated requests can succeed.

@sergeytimoshin sergeytimoshin marked this pull request as draft June 16, 2025 00:48
@sergeytimoshin sergeytimoshin marked this pull request as ready for review June 16, 2025 18:08
@ananas-block ananas-block merged commit c7b2aa3 into main Jun 16, 2025
56 of 60 checks passed
@ananas-block ananas-block deleted the sergey/light-client-photon-url branch June 16, 2025 19:34
@coderabbitai coderabbitai bot mentioned this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants