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

Shwap #2675

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft

Shwap #2675

wants to merge 32 commits into from

Conversation

Wondertan
Copy link
Member

@Wondertan Wondertan commented Sep 7, 2023

Prototype of the new storage for edses - edsfile and optimized roundtrip less ipldv2 protocol

TODO:

  • edsfile
    • Blockstore over EDSFile
    • Support for Col sample reads
    • ODS only mode
      • Support for Axis, Share and ShareWithProof
    • Measure size diff
    • Delete EDS mode
    • GetSharesByNamespace (assigned to @walldiss)
    • File streaming (Write / Read)
    • Concurrency safety for file
  • edsStore
    • Base implementation
    • Caching
    • Migrate shrex server to new storage
    • Store getter
  • ipldv2
    • Define Sample type and refactor the protocol and the Hasher
    • Migrate to proto
    • Row Sampling
    • Versioning and backwards compatibility with old protocol
    • Use heights instead of DataHash to identify block
    • Hash requested Axis roots to shorten requests
    • Retriever over v2 (IPLDv2 reconstruction getter) (assigned to @walldiss)
    • Metrics
    • IPLDv2 row based getter
      • Getter should support requesting batch of shares by idx at once
      • Store only samples by default
      • Bitswap Sessions
    • IPLDv2 Server over LN storage (blockservice) Will work as is
    • Migrate actual sampling logic over GetShares share/light: LightAvailability to use GetShares #2984

Stretch Goals:

  • Range of shares Multihash(by extending SampleID with additional uint16 that defines the end idx of range)
  • Blob requests. BlobID{DataID, Comm} -> Blob{BlobShares, ProofsToSubroot}
  • Requesting proofs only for every request
  • Reconsider DHT discovery.

Copy link
Contributor

@derrandz derrandz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the direction this is taking, this is so good to look at.

I think this would better answer to the needs specified in #2618 and would deprecate the gymnastics of reading from the car file done in #2638

(commenting for reference)

@Wondertan
Copy link
Member Author

Wondertan commented Sep 8, 2023

would deprecate the gymnastics of reading from the car file done in #2638

@derrandz, very true

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2023

Codecov Report

Merging #2675 (2baea7d) into main (303db05) will increase coverage by 0.22%.
Report is 9 commits behind head on main.
The diff coverage is 54.48%.

@@            Coverage Diff             @@
##             main    #2675      +/-   ##
==========================================
+ Coverage   51.79%   52.02%   +0.22%     
==========================================
  Files         163      173      +10     
  Lines       10854    11596     +742     
==========================================
+ Hits         5622     6033     +411     
- Misses       4738     4997     +259     
- Partials      494      566      +72     
Files Coverage Δ
share/eds/file_store.go 0.00% <0.00%> (ø)
share/ipldv2/axis_sample_hasher.go 56.00% <56.00%> (ø)
share/ipldv2/ipldv2.go 60.71% <60.71%> (ø)
share/ipldv2/share_sample_hasher.go 56.00% <56.00%> (ø)
share/eds/file_header.go 51.16% <51.16%> (ø)
share/ipldv2/axis_sample_id.go 63.07% <63.07%> (ø)
share/ipldv2/share_sample_id.go 64.17% <64.17%> (ø)
share/ipldv2/share_sample.go 71.17% <71.17%> (ø)
share/eds/ods_file.go 15.38% <15.38%> (ø)
share/ipldv2/axis_sample.go 62.36% <62.36%> (ø)
... and 2 more

... and 15 files with indirect coverage changes

return shr, nil
}

func (f *File) ShareWithProof(idx int, axis rsmt2d.Axis) (share.Share, nmt.Proof, error) {
Copy link
Contributor

@derrandz derrandz Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[feature request]: Having AxisWithProof will be super useful for search operations to retrieve all rows with their proofs and roots to be able to filter out for specific shares and their proofs by roots

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you get the whole axis, there is no proof.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, if you look at ShareWithProof, to generate a proof for that share, you have to get the whole axis, right? Retrieving an entire axis and recomputing its proof would be sufficient for the purposes I mentioned.

Copy link
Contributor

@derrandz derrandz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a small feature request to make #2618 easier to implement

@Wondertan
Copy link
Member Author

Wondertan commented Sep 22, 2023

Initial file size measurements

EDS 256:
	NEW: ods_file: 8388640(-9.36x)
	NEW: eds_file: 33554464(-2.34x)
	OLD: car_file: 78618134

EDS 128
	NEW: ods_file: 2097184(-9.36x)
	NEW: eds_file: 8388640(-2.34x)
	OLD: car_file: 19631894

@Wondertan Wondertan mentioned this pull request Dec 5, 2023
71 tasks
* Axis -> Row
	* It's not allowed anymore to request Columns
* Delete AxisType from SampleID
	* Now server decides which Row or Column comittment to choose, not client
* New SampleProofType field on Sample
	* Server's decision on the Sample proof response
* Delete AxisHash from Row(Axis)
	* We break compatibility with Bitswap stateless Content Cerification and now verification has to be done with DAH
@@ -0,0 +1,26 @@
syntax = "proto3";

Copy link

@fl0rek fl0rek Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
package share.p2p.shwap;

Or was package specifier ommited for some particular reason?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary from my understanding

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary, but other proto files specify the namespace so I expected this one too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Also, note that the name of the pkg is more like an implementation detail. The formal spec won't contain the pkg name in its proto file.

@fl0rek
Copy link

fl0rek commented Jan 1, 2024 via email

@Wondertan Wondertan changed the title ipldv2 and eds-file Shwap Jan 8, 2024
@walldiss walldiss mentioned this pull request Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants