Skip to content

Data Availability layer API #8

@tzdybal

Description

@tzdybal

To keep the greatest flexibility, we start with the following very limited interface and extend it only if necessary for implementing using LazyLedger as a DA layer (certainly in a way that would not limit developers to use other DA layers though):

// TODO define an enum of different non-happy-path cases
// that might need to be handled by Optimint independent of
// the underlying DA chain.
type StatusCode uint64

type ResultSubmitBlock struct {
  // Code is to determine if the action succeeded.
  Code StatusCode
  // Not sure if this needs to be bubbled up to other
  // parts of Optimint.
  // Hash hash.Hash
}

type DataAvailabilityLayerClient interface {
  Start() error
  Stop() error

  // SubmitBlock submits the passed in block to the DA layer.
  // This should create a transaction which (potentially)
  // triggers a state transition in the DA layer.
  SubmitBlock(block types.Block) ResultSubmitBlock
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C:data-availabilityComponent: Data Availability layer abstraction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions