perf: optimize instrumentation in hot paths#890
Conversation
Manual Deploy AvailableYou can trigger a manual deploy of this PR branch to testnet: Alternative: Comment
Comment updated automatically when the PR is synchronized. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR optimizes tracing instrumentation overhead by reducing field-level logging in the magicblock-aperture request path while deferring detailed signature logging to the magicblock-chainlink fetch_cloner phase where accounts are being retrieved. Changes include converting per-field instrumentation to Assessment against linked issues
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6ee47fe to
c25bdcf
Compare
Summary
Optimizes instrumentation overhead in hot paths by avoiding pubkey/signature stringification when accounts are already in the local bank. The transaction signature is now carried through the call chain and only stringified in the cold path (when actually fetching from chain).
CLOSES: #867
Details
Hot Path Optimization
Removed eager signature/pubkey stringification from the hot path functions:
send_transaction: Changed to#[instrument(skip_all)], removed.record()callensure_transaction_accounts: Changed to#[instrument(skip_all)]read_account_with_ensure: Changed to#[instrument(skip_all)]Cold Path Signature Propagation
Extended
AccountFetchOrigin::SendTransactionto carry the transaction signature:SendTransaction(Signature)signature()accessor methodIn
fetch_and_clone_accounts(cold path), the signature is recorded on the span so it appears in all logs during chain fetch operations.Documentation
Added explanatory comments to cold path functions in
chain_laser_actor.rs,chain_pubsub_actor.rs, andsubscription_reconciler.rsnoting that pubkey stringification is acceptable there since network I/O dwarfs the cost.Summary by CodeRabbit