feat(logging): add account, note, storage, and mempool lifecycle events#2358
Open
kkovaacs wants to merge 4 commits into
Open
feat(logging): add account, note, storage, and mempool lifecycle events#2358kkovaacs wants to merge 4 commits into
kkovaacs wants to merge 4 commits into
Conversation
Log lines are now emitted for mempool lifetime events.
apply_block() now logs detailed lifecycle events for all relevant objects in the block that has been applied.
sergerad
reviewed
Jul 21, 2026
| } | ||
|
|
||
| fn emit_dependent_transaction_evictions(removal: &graph::TransactionRemoval, reason: &'static str) { | ||
| for transaction_id in sorted_transaction_ids(removal.dependents()) { |
Collaborator
There was a problem hiding this comment.
These functions should have a guard to avoid unnecessary computation when not in DEBUG
if !tracing::enabled!(target: LOG_TARGET, tracing::Level::DEBUG) {
return;
}
sergerad
reviewed
Jul 21, 2026
| } | ||
| } | ||
|
|
||
| fn sorted_transaction_ids( |
Collaborator
There was a problem hiding this comment.
If we used BTreeSet instead of HashSet then we wouldn't need to sort?
sergerad
reviewed
Jul 21, 2026
|
|
||
| let mut resolved_note_ids = BTreeMap::new(); | ||
| for chunk in | ||
| unresolved_note_nullifiers.chunks(QueryParamNoteCommitmentLimit::LIMIT) |
Collaborator
There was a problem hiding this comment.
Worth commenting that unresolved_note_nullifiers is empty unless we are in DEBUG mode. And/or moving this to a separate function with that as a doc comment
sergerad
reviewed
Jul 21, 2026
| }, | ||
| } | ||
|
|
||
| impl BlockLifecycle { |
Collaborator
There was a problem hiding this comment.
Should this block be moved to under the BlockLifecycle struct section?
sergerad
reviewed
Jul 21, 2026
| } | ||
|
|
||
| impl BlockLifecycle { | ||
| pub(super) fn from_block_body(block_num: BlockNumber, body: &BlockBody) -> Self { |
Collaborator
There was a problem hiding this comment.
Would be good for tracing to show duration of this fn as well as emit()
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.
Summary
Resolves part 2 of issue #2330
Changelog