celestiaorg / celestiaorg/nmt

perf: split namespace and data into separate parameters in Push to enable direct usage of rsmt2d buffers

Open
#306 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
122
Forks
53
Avg merge
1d 15h
Merged PRs (30d)
5

Description

The idea is that right now in rsmt2d we always copy the data that goes into `leaves`, we do that, because for extended square we replace the first `namespaceSize` bytes of the leaf with parity namespace (for ODS we use the data as is). If we split the parameters (i.e. `namespace` and `data`), we could actually not copy the leaf and just take the same byte pointer from `rsmt2d`. I tried doing this in a branch and this is the best option of all performance-wise (it is better than copy the data, even if we reuse the buffers in which we are copying).

Contributor guide

Open the contributing guide

Research direction

Start by tracing Push and its leaves handling, then review how rsmt2d buffers are passed for extended-square and ODS cases. The change is complete when namespace and data are separate parameters and the existing paths can use rsmt2d's buffers directly without copying leaf data.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.