Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

clear_prefix iterates only over backend ignoring the overlay #426

@pepyakin

Description

@pepyakin

While deciding which keys to remove from the storage, clear_prefix iterates only over the backend and ignores the changes in the overlay.

Example:

# 1. At the `Externalities` creation time we have the following state: 
backend = ["dog" => 1, "cat" => 2], overlay = []

# 2. Next `set_storage("doggy" => 3)` is called
backend = ["dog" => 1, "cat" => 2], overlay = ["doggy" => 3]

# 3. Next `clear_prefix("dog")` is called (and we iterate only over backend keys)
backend = ["dog" => 1, "cat" => 2], overlay = ["dog" => None, "doggy" => 3]

# 4. Transaction commits
backend = ["cat" => 2, "doggy" => 3]

Metadata

Metadata

Assignees

No one assigned

    Labels

    I3-bugThe node fails to follow expected behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions