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

PoC: running Rollkit Adapter #8

Closed
1 task
rphmeier opened this issue Nov 14, 2023 · 2 comments · Fixed by #49
Closed
1 task

PoC: running Rollkit Adapter #8

rphmeier opened this issue Nov 14, 2023 · 2 comments · Fixed by #49
Assignees

Comments

@rphmeier
Copy link
Contributor

rphmeier commented Nov 14, 2023

  • Investigate API
@pepyakin
Copy link
Contributor

So basically the API of an adapter is specified by this interface:

// DA defines very generic interface for interaction with Data Availability layers.
type DA interface {
	// Get returns Blob for each given ID, or an error.
	//
	// Error should be returned if ID is not formatted properly, there is no Blob for given ID or any other client-level
	// error occurred (dropped connection, timeout, etc).
	Get(ids []ID) ([]Blob, error)

	// GetIDs returns IDs of all Blobs located in DA at given height.
	GetIDs(height uint64) ([]ID, error)

	// Commit creates a Commitment for each given Blob.
	Commit(blobs []Blob) ([]Commitment, error)

	// Submit submits the Blobs to Data Availability layer.
	//
	// This method is synchronous. Upon successful submission to Data Availability layer, it returns ID identifying blob
	// in DA and Proof of inclusion.
	Submit(blobs []Blob) ([]ID, []Proof, error)

	// Validate validates Commitments against the corresponding Proofs. This should be possible without retrieving the Blobs.
	Validate(ids []ID, proofs []Proof) ([]bool, error)
}

// Blob is the data submitted/received from DA interface.
type Blob = []byte

// ID should contain serialized data required by the implementation to find blob in Data Availability layer.
type ID = []byte

// Commitment should contain serialized cryptographic commitment to Blob value.
type Commitment = []byte

// Proof should contain serialized proof of inclusion (publication) of Blob in Data Availability layer.
type Proof = []byte

Some comments:

  1. A struct that implements this interface must be parametrized by the namespace (or whatever identifier required) upon creation.
  2. Commitment means a default hash. The status quo for sugondat is SHA256, same as Celestia.
  3. Validate takes []ID but the doc mentions Commitments. celestia-da implements ID to actually be (height, commitment).

@pepyakin pepyakin mentioned this issue Nov 16, 2023
@pepyakin
Copy link
Contributor

This turns out not to be an easy task. So far I haven't figured out how to change the standard DA adapter to a custom one. I threw a net to some discords, let's see what can I catch.

pepyakin added a commit that referenced this issue Nov 23, 2023
This is mostly the gm tutorial with a sugondat adapter

Closes #8
pepyakin added a commit that referenced this issue Nov 24, 2023
This is mostly the gm tutorial with a sugondat adapter

Closes #8
pepyakin added a commit that referenced this issue Nov 24, 2023
This is mostly the gm tutorial with a sugondat adapter

Closes #8
pepyakin added a commit that referenced this issue Nov 24, 2023
This is mostly the gm tutorial with a sugondat adapter

Closes #8
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 a pull request may close this issue.

2 participants