arbnode

package module
v0.0.0-...-682b0a2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 24 Imported by: 0

README

PoC Batch Poster in Rust

A Proof of Concept implementation of a Nitro Batch Poster in Rust.

Nitro is the latest implementation of the Arbitrum L2. Its architecture is composed of a batch poster, responsible of aggregating transactions and periodically sending them the Parent L1 chain (Ethereum).

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBatchPosterConfig = BatchPosterConfig{
	Enable:                             false,
	DisableDasFallbackStoreDataOnChain: false,
	MaxBatchSize:                       100000,
	BatchPollDelay:                     time.Second * 10,
	PostingErrorDelay:                  time.Second * 10,
	MaxBatchPostInterval:               time.Hour,
	CompressionLevel:                   brotli.DefaultCompression,
	DASRetentionPeriod:                 time.Hour * 24 * 15,
	GasRefunderAddress:                 "",
	ExtraBatchGas:                      50_000,
	DataPoster:                         dataposter.DefaultDataPosterConfig,
}
View Source
var TestBatchPosterConfig = BatchPosterConfig{
	Enable:               true,
	MaxBatchSize:         100000,
	BatchPollDelay:       time.Millisecond * 10,
	PostingErrorDelay:    time.Millisecond * 10,
	MaxBatchPostInterval: 0,
	CompressionLevel:     2,
	DASRetentionPeriod:   time.Hour * 24 * 15,
	GasRefunderAddress:   "",
	ExtraBatchGas:        10_000,
	DataPoster:           dataposter.TestDataPosterConfig,
}

Functions

func BatchPosterConfigAddOptions

func BatchPosterConfigAddOptions(prefix string, f *flag.FlagSet)

Types

type BatchPoster

type BatchPoster struct {
	stopwaiter.StopWaiter
	// contains filtered or unexported fields
}

func NewBatchPoster

func NewBatchPoster(l1Reader *headerreader.HeaderReader, inbox *InboxTracker, streamer *TransactionStreamer, syncMonitor *SyncMonitor, config BatchPosterConfigFetcher, contractAddress common.Address, transactOpts *bind.TransactOpts, daWriter das.DataAvailabilityServiceWriter) (*BatchPoster, error)

func (*BatchPoster) Start

func (b *BatchPoster) Start(ctxIn context.Context)

func (*BatchPoster) StopAndWait

func (b *BatchPoster) StopAndWait()

type BatchPosterConfig

type BatchPosterConfig struct {
	Enable                             bool                        `koanf:"enable"`
	DisableDasFallbackStoreDataOnChain bool                        `koanf:"disable-das-fallback-store-data-on-chain" reload:"hot"`
	MaxBatchSize                       int                         `koanf:"max-size" reload:"hot"`
	MaxBatchPostInterval               time.Duration               `koanf:"max-interval" reload:"hot"`
	BatchPollDelay                     time.Duration               `koanf:"poll-delay" reload:"hot"`
	PostingErrorDelay                  time.Duration               `koanf:"error-delay" reload:"hot"`
	CompressionLevel                   int                         `koanf:"compression-level" reload:"hot"`
	DASRetentionPeriod                 time.Duration               `koanf:"das-retention-period" reload:"hot"`
	GasRefunderAddress                 string                      `koanf:"gas-refunder-address" reload:"hot"`
	DataPoster                         dataposter.DataPosterConfig `koanf:"data-poster" reload:"hot"`
	RedisUrl                           string                      `koanf:"redis-url"`
	RedisLock                          SimpleRedisLockConfig       `koanf:"redis-lock" reload:"hot"`
	ExtraBatchGas                      uint64                      `koanf:"extra-batch-gas" reload:"hot"`
}

func (*BatchPosterConfig) Validate

func (c *BatchPosterConfig) Validate() error

type BatchPosterConfigFetcher

type BatchPosterConfigFetcher func() *BatchPosterConfig

Jump to

Keyboard shortcuts

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