Skip to content

interchain-indexer: Replace DashMap with Scalable Concurrent Containers HashMap in Message Buffer #1639

@fedor-ivn

Description

@fedor-ivn

Description

Replace DashMap in the message buffer with Scalable Concurrent Containers (SCC) HashMap. The goal is to improve async safety and maintainability while keeping current buffer behavior unchanged.

Motivation

DashMap has known deadlock risks in async contexts and requires careful usage patterns that are easy to regress. SCC offers APIs better aligned with async Rust and safer mutation semantics for this hot path.

Current State

The message buffer currently uses DashMap for concurrent in-memory storage and mutation. It works, but safety depends on strict guard-handling discipline, which makes future changes riskier.

Proposed Changes

  • Use SCC HashMap as the message buffer’s hot-tier concurrent map.
  • Update mutation and maintenance flows to SCC-native async-safe patterns.
  • Preserve message lifecycle semantics (restore, mutate, flush marking, safe eviction).
  • Update dependencies and tests to support the migration without external behavior changes.

Expected Benefits

  • Lower deadlock and async concurrency risk.
  • Better maintainability with explicit, async-friendly APIs.
  • More confidence in behavior under high concurrency.
  • Lower long-term dependency risk.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions