Skip to content

Conversation

@Fibonacci747
Copy link
Contributor

Motivation

The in-memory rollup store is used in L2 components that expose metrics about transactions, privileged transactions and messages. These metrics depend on the global counters exposed by get_operations_count. However, the in-memory implementation of update_operations_count was not updating the underlying state at all, so the counters always stayed at zero. This silently broke L2 metrics when the in-memory backend is used and also made its behavior diverge from the SQL backend.

Description

This change fixes the in-memory implementation of StoreEngineRollup::update_operations_count so that it mutates the operations_counts array inside StoreInner instead of working on a local copy. As a result, subsequent calls to get_operations_count now return the accumulated values, matching the semantics of the SQL backend. A small async unit test was added to in_memory.rs to verify that multiple updates correctly accumulate and are reflected in the result of get_operations_count.

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.

1 participant