sunrise

package module
v0.0.0-...-27398b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

README

Sunrise OP DA Server

This repo implements a Sunrise DA Server for Alt-DA mode using generic commitments.

The sunrise-op-da-server connects to a sunrise-node running as a sidecar process.

sunrise da-server accepts the following flags for sunrise storage

    --sunrise.server value             (default: "http://localhost:26658") ($OP_PLASMA_DA_SERVER_SUNRISE_SERVER)
          sunrise server endpoint

    --sunrise.data-shard-count value   (default: 10)                    ($OP_PLASMA_DA_SERVER_SUNRISE_DATA_SHARD_COUNT)
          sunrise data shard count

    --sunrise.parity-shard-count value (default: 10)                    ($OP_PLASMA_DA_SERVER_SUNRISE_PARITY_SHARD_COUNT)
          sunrise parity shard count

The sunrise server endpoint should be set to the sunrise-data backend, usually http://127.0.0.1:8000.

How to run testnet with da-server

Prerequisites

You should use at least the following compatible op* versions when running your chain.

Run Sunrise Node

You can refer the sunrise repo for the setup and running of the sunrise node along with the sunrise-data.

Setup DA server

da-server
      --sunrise.server=http://localhost:8000
      --sunrise.data_shard_count=10
      --sunrise.parity_shard_count=10

Configure Your op-node

  • Spin up your OP chain as usual but set --altda.enabled=true and point both op-batcher and op-node to the DA server.
  • No configuration changes are required for op-geth or op-proposer.
   Alt-DA (EXPERIMENTAL)

   
    --altda.da-server value                                               ($OP_NODE_ALTDA_DA_SERVER)
          HTTP address of a DA Server
   
    --altda.enabled                    (default: false)                   ($OP_NODE_ALTDA_ENABLED)
          Enable Alt-DA mode
   
    --altda.verify-on-read             (default: true)                    ($OP_NODE_ALTDA_VERIFY_ON_READ)
          Verify input data matches the commitments from the DA storage service

Configure Your Batcher

  • Set --altda.enabled=true and --altda.da-service=true.
  • Provide the URL for --atlda.da-server=$DA_SERVER_HTTP_URL.
    --altda.da-server value                                               ($OP_BATCHER_ALTDA_DA_SERVER)
          HTTP address of a DA Server
   
    --altda.da-service                 (default: false)                   ($OP_BATCHER_ALTDA_DA_SERVICE)
          Use DA service type where commitments are generated by the DA server
   
    --altda.enabled                    (default: false)                   ($OP_BATCHER_ALTDA_ENABLED)
          Enable Alt-DA mode
   
    --altda.verify-on-read             (default: true)                    ($OP_BATCHER_ALTDA_VERIFY_ON_READ)
          Verify input data matches the commitments from the DA storage service

Documentation

Index

Constants

View Source
const VersionByte = 0x0c

Variables

This section is empty.

Functions

func Decode

func Decode(comm []byte) ([]byte, error)

Types

type SunriseConfig

type SunriseConfig struct {
	URL              string
	DataShardCount   int
	ParityShardCount int
}

type SunriseServer

type SunriseServer struct {
	// contains filtered or unexported fields
}

func NewSunriseServer

func NewSunriseServer(host string, port int, store *SunriseStore, log log.Logger) *SunriseServer

func (*SunriseServer) Endpoint

func (b *SunriseServer) Endpoint() string

func (*SunriseServer) HandleGet

func (d *SunriseServer) HandleGet(w http.ResponseWriter, r *http.Request)

func (*SunriseServer) HandlePut

func (d *SunriseServer) HandlePut(w http.ResponseWriter, r *http.Request)

func (*SunriseServer) Start

func (d *SunriseServer) Start() error

func (*SunriseServer) Stop

func (b *SunriseServer) Stop() error

type SunriseStore

type SunriseStore struct {
	Log        log.Logger
	Config     SunriseConfig
	GetTimeout time.Duration
	Namespace  []byte
}

SunriseStore implements DAStorage with sunrise-data backend

func NewSunriseStore

func NewSunriseStore(cfg SunriseConfig, log log.Logger) *SunriseStore

NewSunriseStore returns a sunrise store.

func (*SunriseStore) Get

func (d *SunriseStore) Get(ctx context.Context, comm []byte) ([]byte, error)

func (*SunriseStore) Put

func (d *SunriseStore) Put(ctx context.Context, data []byte) ([]byte, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL