celestiaorg / celestiaorg/nmt

Move IgnoreMaxNamespace logic to the application layer

Open
#195 0 comments 0 reactions 1 assignee Claimed by @staheri14 View on GitHub
Dominant language
Go
Stars
122
Forks
53
Avg merge
1d 15h
Merged PRs (30d)
5

Description

# Problem
In the existing NMT implementation, there is a configuration option called `IgnoreMaxNamespace` that, when enabled, enforces a customized approach for determining a node's namespace range using its left and right children (please see the [`HashNode`](https://github.com/celestiaorg/nmt/blob/4b97a09e0b64e59d8ec67eb28b3769d79f15db39/hasher.go#L281)). However, this particular feature negatively affects code readability and maintainability. Additionally, it has led to confusion and raised questions among those encountering this logic for the first time. To address these issues, it is necessary to refactor the NMT implementation and elevate it to higher-level business logic, rather than keeping it within the NMT implementation itself.

# Proposal
One potential approach involves revising the NMT constructor's signature to include a parameter that accepts a function. This function would take the namespaces of the left and right children and specify the namespace range of the parent node. Subsequently, this function can be utilized during the computation of node hashes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.