Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: log RPC calls #4739

Merged
merged 3 commits into from
Sep 6, 2024
Merged

feat: log RPC calls #4739

merged 3 commits into from
Sep 6, 2024

Conversation

LesnyRumcajs
Copy link
Member

@LesnyRumcajs LesnyRumcajs commented Sep 6, 2024

Summary of changes

Changes introduced in this pull request:

  • added server-side logs for RPC calls.

Reference issue to close (if applicable)

Closes

Other information and links

Default:

2024-09-06T11:29:27.964357Z  INFO forest_filecoin::chain_sync::chain_muxer: Bootstrap successfully completed, now evaluating the network head to ensure the node is in sync
2024-09-06T11:29:27.964369Z  INFO forest_filecoin::chain_sync::chain_muxer: Evaluating network head...
2024-09-06T11:29:27.964380Z  INFO forest_filecoin::chain_sync::chain_muxer: Local node is in sync with the network
2024-09-06T11:29:28.209002Z  INFO forest_filecoin::rpc::log_layer: RPC#7e600a OK: Filecoin.StateNetworkName. Took 92.986µs
2024-09-06T11:29:28.209320Z  INFO forest_filecoin::rpc::log_layer: RPC#d6ce46 OK: Filecoin.NetPeers. Took 107.429µs
2024-09-06T11:29:28.209522Z  INFO forest_filecoin::rpc::log_layer: RPC#c4f0e0 OK: Filecoin.NetAgentVersion. Took 34.714µs
2024-09-06T11:29:28.209858Z  INFO forest_filecoin::rpc::log_layer: RPC#e72ce7 OK: Filecoin.NetAgentVersion. Took 27.736µs
2024-09-06T11:29:28.209924Z  INFO forest_filecoin::rpc::log_layer: RPC#79fcc7 OK: Filecoin.NetAgentVersion. Took 23.947µs
2024-09-06T11:29:28.209930Z  INFO forest_filecoin::rpc::log_layer: RPC#d9246e OK: Filecoin.NetAgentVersion. Took 18.93µs
2024-09-06T11:29:28.209936Z  INFO forest_filecoin::rpc::log_layer: RPC#4404c5 OK: Filecoin.NetAgentVersion. Took 10.07µs
2024-09-06T11:29:28.209959Z  INFO forest_filecoin::rpc::log_layer: RPC#209663 ERR(-32603): Filecoin.NetAgentVersion. Took 46.694µs
2024-09-06T11:29:28.209991Z  INFO forest_filecoin::rpc::log_layer: RPC#e28eda OK: Filecoin.NetAgentVersion. Took 21.681µs
2024-09-06T11:29:28.210002Z  INFO forest_filecoin::rpc::log_layer: RPC#ca151e ERR(-32603): Filecoin.NetAgentVersion. Took 36.594µs
2024-09-06T11:29:28.210015Z  INFO forest_filecoin::rpc::log_layer: RPC#557350 OK: Filecoin.NetAgentVersion. Took 34.621µs
2024-09-06T11:29:28.210021Z  INFO forest_filecoin::rpc::log_layer: RPC#23b6e5 OK: Filecoin.NetAgentVersion. Took 6.995µs
2024-09-06T11:29:28.210025Z  INFO forest_filecoin::rpc::log_layer: RPC#6bb328 OK: Filecoin.NetAgentVersion. Took 17.989µs
2024-09-06T11:29:28.210035Z  INFO forest_filecoin::rpc::log_layer: RPC#1feb8d OK: Filecoin.NetAgentVersion. Took 37.023µs
2024-09-06T11:29:28.210048Z  INFO forest_filecoin::rpc::log_layer: RPC#7a0476 OK: Filecoin.NetAgentVersion. Took 37.227µs

Debug:

❯ RUST_LOG=warning,forest_filecoin::rpc=debug forest --chain calibnet --encrypt-keystore=false
2024-09-06T11:33:34.545142Z  INFO forest_filecoin::rpc: Ready for RPC connections
2024-09-06T11:33:36.668335Z DEBUG forest_filecoin::rpc::auth_layer: Decoded JWT Claims: read
2024-09-06T11:33:36.668442Z  INFO forest_filecoin::rpc::log_layer: RPC#38f1eb OK: Filecoin.StateNetworkName. Took 87.752µs
2024-09-06T11:33:36.668445Z DEBUG forest_filecoin::rpc::log_layer: RPC#38f1eb: Filecoin.StateNetworkName. Params: []
2024-09-06T11:33:36.668579Z DEBUG forest_filecoin::rpc::auth_layer: Decoded JWT Claims: read
2024-09-06T11:33:36.668648Z  INFO forest_filecoin::rpc::log_layer: RPC#79faae OK: Filecoin.NetPeers. Took 66.356µs
2024-09-06T11:33:36.668655Z DEBUG forest_filecoin::rpc::log_layer: RPC#79faae: Filecoin.NetPeers. Params: []
2024-09-06T11:33:36.668795Z DEBUG forest_filecoin::rpc::auth_layer: Decoded JWT Claims: read
2024-09-06T11:33:36.668812Z  INFO forest_filecoin::rpc::log_layer: RPC#371a0e OK: Filecoin.NetAgentVersion. Took 14.665µs
2024-09-06T11:33:36.668814Z DEBUG forest_filecoin::rpc::log_layer: RPC#371a0e: Filecoin.NetAgentVersion. Params: ["12D3KooWEiBN8jBX8EBoM3M47pVRLRWV812gDRUJhMxgyVkUoR48"]
2024-09-06T11:33:36.669013Z DEBUG forest_filecoin::rpc::auth_layer: Decoded JWT Claims: read
2024-09-06T11:33:36.669024Z  INFO forest_filecoin::rpc::log_layer: RPC#ea0dab OK: Filecoin.NetAgentVersion. Took 9.864µs
2024-09-06T11:33:36.669026Z DEBUG forest_filecoin::rpc::log_layer: RPC#ea0dab: Filecoin.NetAgentVersion. Params: ["12D3KooWGcsALYimqXxTVLERGnLGBBHdAFdpNkyyrbK39QC2pV6r"]
2024-09-06T11:33:36.669049Z DEBUG forest_filecoin::rpc::auth_layer: Decoded JWT Claims: read
2024-09-06T11:33:36.669065Z DEBUG forest_filecoin::rpc::auth_layer: Decoded JWT Claims: read
2024-09-06T11:33:36.669063Z  INFO forest_filecoin::rpc::log_layer: RPC#f4aa60 OK: Filecoin.NetAgentVersion. Took 11.867µs
2024-09-06T11:33:36.669070Z DEBUG forest_filecoin::rpc::log_layer: RPC#f4aa60: Filecoin.NetAgentVersion. Params: ["12D3KooWQMhAtqMaGRygXeH7jXgVwEKwF1WZNb9XS7TktzU4mnoJ"]
2024-09-06T11:33:36.669074Z  INFO forest_filecoin::rpc::log_layer: RPC#18b136 OK: Filecoin.NetAgentVersion. Took 7.181µs
2024-09-06T11:33:36.669076Z DEBUG forest_filecoin::rpc::log_layer: RPC#18b136: Filecoin.NetAgentVersion. Params: ["12D3KooWNmDqNR8V1qDPwQJANDmdepzQ4uQuMfxEm4wLgDj43eWC"]

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner September 6, 2024 11:35
@LesnyRumcajs LesnyRumcajs requested review from hanabi1224 and sudo-shashank and removed request for a team September 6, 2024 11:35
src/rpc/log_layer.rs Outdated Show resolved Hide resolved
src/rpc/log_layer.rs Outdated Show resolved Hide resolved
LesnyRumcajs and others added 2 commits September 6, 2024 15:52
Co-authored-by: David Himmelstrup <david.himmelstrup@chainsafe.io>
Co-authored-by: David Himmelstrup <david.himmelstrup@chainsafe.io>
@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Sep 6, 2024
Merged via the queue into main with commit 17703a5 Sep 6, 2024
30 checks passed
@LesnyRumcajs LesnyRumcajs deleted the increase-default-rpc-log-level branch September 6, 2024 14:33
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.

3 participants