Skip to content

Consider using slab for storage in transaction orphan pool #1209

Open
@TheQuantumPhysicist

Description

@TheQuantumPhysicist

(Created on Aug, 30 by @iljakuklic)

Currently, Vec is used to store orphans. There are various lookup tables that refer to orphans by a small internal ID which is the index into the vector. The disadvantage of using a vector here is that when an orphan is removed (using swap_remove). Another orphan is placed in its former spot, causing it's ID to change. That means the maps have to be updated to reflect it.

Using a slab, we get a stable internal IDs. This should simplify code and make it more efficient at the cost of using an external crate and potential memory fragmentation.

This change is completely self-contained within the orphan pool implementation and does not require changes in any public interfaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    mempoolMempool-related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions