Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPLD/NMT improvements #183

Closed
2 tasks
Tracked by #1099
Wondertan opened this issue Nov 9, 2021 · 11 comments · Fixed by #1223
Closed
2 tasks
Tracked by #1099

IPLD/NMT improvements #183

Wondertan opened this issue Nov 9, 2021 · 11 comments · Fixed by #1223
Assignees
Labels
area:ipld IPLD plugin area:shares Shares and samples optimization

Comments

@Wondertan
Copy link
Member

Wondertan commented Nov 9, 2021

Right now, we store/exchange on the network redundant data that brings no benefits, and we should fix this together during BlockSync Overhaul:

  • Remove prepended one byte from each NMT IPLD node body(here and here)
    • It is possible to indirectly get the NMT Node type without serializing it. We can look at the number of links and the data size to determine its type(leaf or non-leaf). Look here for an example.
  • Remove additional NMT IPLD node per each leaf
    • Each nmtLeafNode links to an additional IPLD Node, while it should keep that body inside itself
    • This is needed to reduce one roundtrip for DASing operation and, in general, reduce the size of each block
@evan-forbes
Copy link
Member

evan-forbes commented Nov 10, 2021

This sounds good, but I have some questions

It is possible to get NMT Node type indirectly, without serializing the type itself. WE can look at the amount of links.

would we have to know square size for that?

It is possible to get Namespace for each share encoded in inner non-leaf nodes of the NMT tree.

I think I'm missing something here. Mind elaborating on this a bit more? What if some non-leaf nodes, along with their respective leaf nodes, can't be found?

@liamsi
Copy link
Member

liamsi commented Dec 7, 2021

Referencing this here as it is highly related: #244 (comment)

@liamsi
Copy link
Member

liamsi commented Dec 7, 2021

And this: #244 (comment)

@Wondertan
Copy link
Member Author

@liamsi, I made a separate issue out of this. Even though they are related, your comments deserve a separate issue.

@Wondertan
Copy link
Member Author

#464 relies on the fact that our NMT tree looks like:

---X
-X---X
X-X-X-X
X-X-X-X

While one of the points of this issue is to make the tree look like this:

---X
-X---X
X-X-X-X

So once we fix this issue, we should also fix #464

Wondertan added a commit that referenced this issue Feb 22, 2022
Wondertan added a commit that referenced this issue Feb 23, 2022
@renaynay renaynay changed the title share: Disk/Bandwith usage optimizations for IPLD NMT and Samples [optimization] Disk/Bandwith usage optimizations for IPLD NMT and Samples Apr 26, 2022
@renaynay renaynay added area:ipld IPLD plugin enhancement New feature or request labels Apr 26, 2022
@renaynay renaynay moved this to TODO in Celestia Node Apr 26, 2022
@adlerjohn
Copy link
Member

8 bytes additional Namespace for each share via NMT wrapper
Can be avoided if we enable once

Why can't it be avoided today? Storage format is an implementation detail. So long as you can losslessly convert between formats, it doesn't matter what it's stored as.

@liamsi
Copy link
Member

liamsi commented May 5, 2022

@adlerjohn you are right. It can be avoided today. See celestiaorg/nmt#55 (comment)

@Wondertan
Copy link
Member Author

Wondertan commented May 5, 2022

@adlerjohn, it can be avoided. My understanding was that we have to store everything we commit to via nmt.Push, but I missed that we can avoid storing some pieces of shares on the fly via Visitor in nmt and add them on the fly as well. However, as pointed out in the linked nmt issue, this is somewhat hacky, and, actually, a leaky abstraction that should be avoided ideally.

@Bidon15
Copy link
Member

Bidon15 commented Jul 12, 2022

Grooming 12/07/2022:

  • if we are fine with the current stack, we need to have this implemented before Incentivized Testnet

@Bidon15 Bidon15 added optimization and removed enhancement New feature or request labels Jul 12, 2022
@Wondertan
Copy link
Member Author

We need this before incentivized testnet.

@Wondertan Wondertan changed the title [optimization] Disk/Bandwith usage optimizations for IPLD NMT and Samples IPLD/NMT improvements Sep 15, 2022
@Wondertan
Copy link
Member Author

The description is now up to date

Repository owner moved this from In Review to Done in Celestia Node Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ipld IPLD plugin area:shares Shares and samples optimization
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants