Skip to content

feat: set_log_filter rpc and start_time rpc#410

Merged
MicaiahReid merged 7 commits intosolana-foundation:mainfrom
JkrishnaD:feat/set-log-filter-rpc-start-time-rpc
Nov 20, 2025
Merged

feat: set_log_filter rpc and start_time rpc#410
MicaiahReid merged 7 commits intosolana-foundation:mainfrom
JkrishnaD:feat/set-log-filter-rpc-start-time-rpc

Conversation

@JkrishnaD
Copy link
Contributor

Changes

  • Added set_log_filter admin RPC for updating the system log level.
  • Added start_time admin RPC to return the runloop start timestamp.
  • Added corresponding PluginManagerCommand variants.
  • Implemented handlers inside the geyser runloop.
  • Updated admin RPC trait and implementations.

Issue: #330

@JkrishnaD JkrishnaD changed the title Feat/set log filter rpc start time rpc feat: set_log_filter rpc and start_time rpc Nov 15, 2025
Copy link
Collaborator

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

Hey @JkrishnaD, thanks for the PR!

I've got a few notes:

Remove set_log_filter method

Sadly, I think we should remove the set_log_filter admin method. I don't see it as particularly valuable to the user, and our log management is a bit more complicated than you have here. We manage logs for the CLI and a written log, so we have a designated configuration on startup of the simnet. I think what we have at the CLI level is sufficient, so we can just remove this admin RPC method completely. (both from the implementation and the AdminRpc trait.

Fixes for start_time

The current implementation of the start_time is gated behind the subgraph feature, which is unnecessary. Actually, it doesn't need to be using the PluginManagerCommand at all. The use of an rx/tx pair to send a command to get a time back is necessary.
I think a better approach is:

  1. Add a start_time field to the SurfnetSvm struct in the svm.rs file
  2. Add a function to the SurfnetSvmLocker structure (in locker.rs) to get this value
  3. Have something like the following in the start_time admin RPC function to just directly fetch the time:
let svm_locker = meta.get_svm_locker()?;
let start_time = svm_locker.get_start_time();
Ok(start_time)

@JkrishnaD
Copy link
Contributor Author

Hey @JkrishnaD, thanks for the PR!

I've got a few notes:

Remove set_log_filter method

Sadly, I think we should remove the set_log_filter admin method. I don't see it as particularly valuable to the user, and our log management is a bit more complicated than you have here. We manage logs for the CLI and a written log, so we have a designated configuration on startup of the simnet. I think what we have at the CLI level is sufficient, so we can just remove this admin RPC method completely. (both from the implementation and the AdminRpc trait.

Fixes for start_time

The current implementation of the start_time is gated behind the subgraph feature, which is unnecessary. Actually, it doesn't need to be using the PluginManagerCommand at all. The use of an rx/tx pair to send a command to get a time back is necessary. I think a better approach is:

  1. Add a start_time field to the SurfnetSvm struct in the svm.rs file
  2. Add a function to the SurfnetSvmLocker structure (in locker.rs) to get this value
  3. Have something like the following in the start_time admin RPC function to just directly fetch the time:
let svm_locker = meta.get_svm_locker()?;
let start_time = svm_locker.get_start_time();
Ok(start_time)

@MicaiahReid I’ve applied all the requested changes:

  • removed the set_log_filter RPC (trait + implementation + command)
  • implemented start_time using the direct getter on SurfnetSvmLocker
  • added start_time to the SurfnetSvm struct as suggested

Please take another look when you get a chance. Thanks for the clear guidance!

Copy link
Collaborator

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

This is great, thanks for the quick turnaround! Just two small comments - some artifacts of the previous implementation that weren't removed, then we'll be good to merge!

@JkrishnaD
Copy link
Contributor Author

@MicaiahReid ser check the implementation now

Copy link
Collaborator

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

Looks good, thank you so much @JkrishnaD!!

@MicaiahReid MicaiahReid merged commit 1dedfa1 into solana-foundation:main Nov 20, 2025
@JkrishnaD JkrishnaD deleted the feat/set-log-filter-rpc-start-time-rpc branch November 27, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants