rollup

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 8 Imported by: 60

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeL2OutputRoot

func ComputeL2OutputRoot(l2OutputRootVersion eth.Bytes32, blockHash common.Hash, blockRoot common.Hash, storageRoot common.Hash) eth.Bytes32

Types

type Config

type Config struct {
	// Genesis anchor point of the rollup
	Genesis Genesis `json:"genesis"`
	// Seconds per L2 block
	BlockTime uint64 `json:"block_time"`
	// Sequencer batches may not be more than MaxSequencerDrift seconds after
	// the L1 timestamp of the sequencing window end.
	//
	// Note: When L1 has many 1 second consecutive blocks, and L2 grows at fixed 2 seconds,
	// the L2 time may still grow beyond this difference.
	MaxSequencerDrift uint64 `json:"max_sequencer_drift"`
	// Number of epochs (L1 blocks) per sequencing window, including the epoch L1 origin block itself
	SeqWindowSize uint64 `json:"seq_window_size"`
	// Number of seconds (w.r.t. L1 time) that a frame can be valid when included in L1
	ChannelTimeout uint64 `json:"channel_timeout"`
	// Required to verify L1 signatures
	L1ChainID *big.Int `json:"l1_chain_id"`
	// Required to identify the L2 network and create p2p signatures unique for this chain.
	L2ChainID *big.Int `json:"l2_chain_id"`

	// Address of the key the sequencer uses to sign blocks on the P2P layer
	P2PSequencerAddress common.Address `json:"p2p_sequencer_address"`

	// L2 address used to send all priority fees to, also known as the coinbase address in the block.
	FeeRecipientAddress common.Address `json:"fee_recipient_address"`
	// L1 address that batches are sent to.
	BatchInboxAddress common.Address `json:"batch_inbox_address"`
	// Acceptable batch-sender address
	BatchSenderAddress common.Address `json:"batch_sender_address"`
	// L1 Deposit Contract Address
	DepositContractAddress common.Address `json:"deposit_contract_address"`
}

func (*Config) Check

func (cfg *Config) Check() error

Check verifies that the given configuration makes sense

func (*Config) L1Signer

func (c *Config) L1Signer() types.Signer

type Epoch

type Epoch uint64

type Genesis

type Genesis struct {
	// The L1 block that the rollup starts *after* (no derived transactions)
	L1 eth.BlockID `json:"l1"`
	// The L2 block the rollup starts from (no transactions, pre-configured state)
	L2 eth.BlockID `json:"l2"`
	// Timestamp of L2 block
	L2Time uint64 `json:"l2_time"`
}

Directories

Path Synopsis
Package derive provides the data transformation functions that take L1 data and turn it into L2 blocks and results.
Package derive provides the data transformation functions that take L1 data and turn it into L2 blocks and results.
The sync package is responsible for reconciling L1 and L2.
The sync package is responsible for reconciling L1 and L2.

Jump to

Keyboard shortcuts

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