common

package
v0.5.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SEQUENCE_SENDER name to identify the sequence-sender component
	SEQUENCE_SENDER = "sequence-sender" //nolint:stylecheck
	// AGGREGATOR name to identify the aggregator component
	AGGREGATOR = "aggregator"
	// AGGORACLE name to identify the aggoracle component
	AGGORACLE = "aggoracle"
	// RPC name to identify the rpc component
	RPC = "rpc"
	// CLAIM_SPONSOR name to identify the claim sponsor component
	CLAIM_SPONSOR = "claim-sponsor" //nolint:stylecheck
	// PROVER name to identify the prover component
	PROVER = "prover"
	// AGGSENDER name to identify the aggsender component
	AGGSENDER = "aggsender"
	// L1INFOTREESYNC name to identify the l1infotreesync component
	L1INFOTREESYNC = "l1infotreesync"
)

Variables

This section is empty.

Functions

func BigIntToLittleEndianBytes added in v0.4.0

func BigIntToLittleEndianBytes(n *big.Int) []byte

BigIntToLittleEndianBytes converts a big.Int to a 32-byte little-endian representation. big.Int is capped to 32 bytes

func BytesToUint32

func BytesToUint32(bytes []byte) uint32

BytesToUint32 converts a byte slice to a uint32

func BytesToUint64

func BytesToUint64(bytes []byte) uint64

BytesToUint64 converts a byte slice to a uint64

func CalculateAccInputHash

func CalculateAccInputHash(
	logger *log.Logger,
	oldAccInputHash common.Hash,
	batchData []byte,
	l1InfoRoot common.Hash,
	timestampLimit uint64,
	sequencerAddr common.Address,
	forcedBlockhashL1 common.Hash,
) common.Hash

CalculateAccInputHash computes the hash of accumulated input data for a given batch.

func NewKeyFromKeystore added in v0.4.0

func NewKeyFromKeystore(cfg types.KeystoreFileConfig) (*ecdsa.PrivateKey, error)

NewKeyFromKeystore creates a private key from a keystore file

func Uint32ToBytes

func Uint32ToBytes(num uint32) []byte

Uint32ToBytes converts a uint32 to a byte slice in big-endian order

func Uint64ToBytes

func Uint64ToBytes(num uint64) []byte

Uint64ToBytes converts a uint64 to a byte slice

Types

type Config

type Config struct {
	// IsValidiumMode has the value true if the sequence sender is running in validium mode.
	IsValidiumMode bool `mapstructure:"IsValidiumMode"`
	// NetworkID is the networkID of the CDK being run
	NetworkID uint32 `mapstructure:"NetworkID"`
	// Contract Versions: elderberry, banana
	ContractVersions string            `mapstructure:"ContractVersions"`
	Translator       translator.Config `mapstructure:"Translator"`
}

Config holds the configuration for the CDK.

Jump to

Keyboard shortcuts

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