Skip to content

feat(logging): add account, note, storage, and mempool lifecycle events - #2358

Merged
sergerad merged 14 commits into
nextfrom
krisztian/log-lifetime-events
Jul 28, 2026
Merged

feat(logging): add account, note, storage, and mempool lifecycle events#2358
sergerad merged 14 commits into
nextfrom
krisztian/log-lifetime-events

Conversation

@kkovaacs

Copy link
Copy Markdown
Collaborator

Summary

  • Emit lifecycle events after successful block commits for account registration, note creation and consumption, and public account storage changes.
  • Resolve consumed note IDs from nullifiers on a best-effort basis and identify output notes erased within the same block.
  • Log mempool transaction additions, expirations, and evictions, distinguishing direct removals from dependent transaction removals.
  • Improve input-note formatting with explicit nullifier and note_id labels.

Resolves part 2 of issue #2330

Changelog

[[entry]]
scope       = "general"
impact      = "fixed"
description = "Account, note, storage and mempool lifecycle events are now logged on stdout."

kkovaacs added 4 commits July 20, 2026 13:30
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.
Comment thread crates/block-producer/src/mempool/mod.rs Outdated
Comment thread crates/block-producer/src/mempool/mod.rs Outdated
Comment thread crates/store/src/db/mod.rs
Comment thread crates/store/src/state/block_lifecycle.rs
Comment thread crates/store/src/state/block_lifecycle.rs
@kkovaacs
kkovaacs requested a review from sergerad July 27, 2026 11:31
Comment thread crates/store/src/state/apply_block.rs
Comment on lines +628 to +633
tracing::warn!(
target: COMPONENT,
%err,
nullifiers.count = chunk.len(),
"Failed to resolve consumed note IDs for lifecycle events",
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When would this happen?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is specifically for unauthenticated notes that don't have their nullifier in our DB. Maybe this should not even be a warning, because unauthenticated notes created and consumed in the same block would trigger this?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm a bit concerned about how this will scale when we want to change how things work in the mempool.

But I guess we'll have to cross that bridge when we get there.

@sergerad
sergerad merged commit 503ebfc into next Jul 28, 2026
24 checks passed
@sergerad
sergerad deleted the krisztian/log-lifetime-events branch July 28, 2026 01:12
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