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 Op-Stack adapter #9

Open
1 task
rphmeier opened this issue Nov 14, 2023 · 2 comments
Open
1 task

PoC: running Op-Stack adapter #9

rphmeier opened this issue Nov 14, 2023 · 2 comments
Assignees

Comments

@rphmeier
Copy link
Contributor

rphmeier commented Nov 14, 2023

  • Investigate API
@pepyakin
Copy link
Contributor

pepyakin commented Nov 16, 2023

The API of OP stack according to this.

// We will re-use some terminology from op-node codebase
// Ref is a reference to some object, so FrameRef is a reference to a frame
// DAChain allows reading and writing data to the DA layer

// FrameRef contains data to lookup a frame by its reference
// Here it contains the block height and the tx index at which the transaction
// was included, the combination of which uniquely references the frame.
type FrameRef struct {
    BlockHeight uint64
    TxIndex int64
}

// Marshal / Unmarshal
func (f *FrameRef) MarshalBinary(w io.Writer) error { ... }
func (f *FrameRef) UnmarshalBinary(r ByteReader) error { ... }

// FrameFetcher returns a Frame from the DAChain by it's FrameRef
type FrameFetcher interface {
    FetchFrame(ctx, ref FrameRef) ([]byte, error)
}

// FrameWriter writes a serialized Frame to the DAChain and returns its FrameRef
type FrameWriter interface {
    WriteFrame(ctx, []byte) (FrameRef, error)
}

// DAChain satisifes both read/write on the DAChain
type DAChain interface {
    FrameFetcher
    FrameWriter
}

and here is the actual impl of Celestia

@pepyakin
Copy link
Contributor

You may ask, how are those frames created? I am not entirely sure, but it seems like the batches are created elsewhere and submitted on L1's special contract. This is what we discussed the other day, @rphmeier, where the order of batches is completely determined by L1 even though the data is stored somewhere else. Though it seems that the block height should be finalized block always. It would be ideal if L1 & DA are rooted in the same consensus. With celestia it's a bit worse.

In our case, it would be great³ to have OP deployed on Moonbeam. But I don't think it's for Sugondat Monocore Kusama

@pepyakin pepyakin self-assigned this Nov 16, 2023
@pepyakin pepyakin mentioned this issue Nov 16, 2023
@pepyakin pepyakin removed this from the Sugondat Monocore Kusama milestone Dec 11, 2023
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

No branches or pull requests

2 participants