types

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NilStr = "nil"
	NAStr  = "N/A"
)
View Source
const (
	CertificateTypeUnknownStr    string = ""
	CertificateTypePPStr         string = "pp"
	CertificateTypeFEPStr        string = "fep"
	CertificateTypeOptimisticStr string = "optimistic"

	CertificateTypeUnknown    CertificateType = 0
	CertificateTypePP         CertificateType = 1
	CertificateTypeFEP        CertificateType = 2
	CertificateTypeOptimistic CertificateType = 3
)

Variables

View Source
var (
	BlockRangeZero = BlockRange{}
)
View Source
var EmptyLER = common.HexToHash("0x27ae5ba08d7291c96c8cbddcc148bf48a6d68c7974b94356f53754ef6171d757")

Functions

This section is empty.

Types

type AggProofPublicValuesQuerier added in v0.7.0

type AggProofPublicValuesQuerier interface {
	GetAggregationProofPublicValuesData(lastProvenBlock, requestedEndBlock uint64,
		l1InfoTreeLeafHash common.Hash) (*AggregationProofPublicValues, error)
}

AggProofPublicValuesQuerier defines an interface for querying aggregation proof public values.

type AggchainFEPRollupQuerier added in v0.7.0

type AggchainFEPRollupQuerier interface {
	StartL2Block() uint64
	GetLastSettledL2Block() (uint64, error)
	IsFEP() bool
}

AggchainFEPRollupQuerier is an interface defining functions that an AggchainFEPRollupQuerier should implement

type AggchainProof added in v0.3.0

type AggchainProof struct {
	LastProvenBlock uint64
	EndBlock        uint64
	CustomChainData []byte
	LocalExitRoot   common.Hash
	AggchainParams  common.Hash
	Context         map[string][]byte
	SP1StarkProof   *SP1StarkProof
	Signature       []byte
}

func (*AggchainProof) String added in v0.3.0

func (a *AggchainProof) String() string

type AggchainProofClientInterface added in v0.4.0

type AggchainProofClientInterface interface {
	GenerateAggchainProof(ctx context.Context, req *AggchainProofRequest) (*AggchainProof, error)
	GenerateOptimisticAggchainProof(req *AggchainProofRequest, signature []byte) (*AggchainProof, error)
}

AggchainProofClientInterface defines an interface for aggchain proof client

type AggchainProofQuerier added in v0.7.0

type AggchainProofQuerier interface {
	GenerateAggchainProof(
		ctx context.Context,
		lastProvenBlock, toBlock uint64,
		certBuildParams *CertificateBuildParams,
	) (*AggchainProof, *treetypes.Root, error)
}

AggchainProofQuerier is an interface defining functions that an AggchainProofQuerier should implement

type AggchainProofRequest added in v0.4.0

type AggchainProofRequest struct {
	LastProvenBlock                    uint64
	RequestedEndBlock                  uint64
	L1InfoTreeRootHash                 common.Hash
	L1InfoTreeLeaf                     l1infotreesync.L1InfoTreeLeaf
	L1InfoTreeMerkleProof              agglayer.MerkleProof
	GERLeavesWithBlockNumber           map[common.Hash]*agglayer.ProvenInsertedGERWithBlockNumber
	ImportedBridgeExitsWithBlockNumber []*agglayer.ImportedBridgeExitWithBlockNumber
}

func NewAggchainProofRequest added in v0.4.0

func NewAggchainProofRequest(
	lastProvenBlock, requestedEndBlock uint64,
	l1InfoTreeRootHash common.Hash,
	l1InfoTreeLeaf l1infotreesync.L1InfoTreeLeaf,
	l1InfoTreeMerkleProof agglayer.MerkleProof,
	gerLeavesWithBlockNumber map[common.Hash]*agglayer.ProvenInsertedGERWithBlockNumber,
	importedBridgeExitsWithBlockNumber []*agglayer.ImportedBridgeExitWithBlockNumber,
) *AggchainProofRequest

func (*AggchainProofRequest) String added in v0.4.0

func (r *AggchainProofRequest) String() string

type AggregationProofPublicValues added in v0.7.0

type AggregationProofPublicValues struct {
	L1Head           common.Hash
	L2PreRoot        common.Hash
	ClaimRoot        common.Hash
	L2BlockNumber    uint64
	RollupConfigHash common.Hash
	MultiBlockVKey   common.Hash
	ProverAddress    common.Address
}

AggregationProofPublicValues represents the public values used in the aggregation proof.

func (*AggregationProofPublicValues) Hash added in v0.7.0

Hash calculates the hash of the AggregationProofPublicValues using ABI encoding.

func (*AggregationProofPublicValues) String added in v0.7.0

String returns a string representation of the AggregationProofPublicValues.

type AggsenderBuilderFlow added in v0.7.0

type AggsenderBuilderFlow interface {
	// CheckInitialStatus checks the initial status for the flow it's ok
	CheckInitialStatus(ctx context.Context) error
	// GetCertificateBuildParams returns the parameters to build a certificate
	GetCertificateBuildParams(ctx context.Context) (*CertificateBuildParams, error)
	// BuildCertificate builds a certificate based on the buildParams
	BuildCertificate(ctx context.Context,
		buildParams *CertificateBuildParams) (*agglayertypes.Certificate, error)
	// GenerateBuildParams generates the build parameters based on the preParams
	GenerateBuildParams(ctx context.Context,
		preParams *CertificatePreBuildParams) (*CertificateBuildParams, error)
	// UpdateAggchainData updates the aggchain data field for the given certificate
	UpdateAggchainData(cert *agglayertypes.Certificate, multisig *agglayertypes.Multisig) error
	// Signer is the signer used to sign the certificate
	Signer() signertypes.Signer
}

AggsenderBuilderFlow is an interface that defines the methods to manage the flow of the AggSender based on the different prover types

type AggsenderFlowBaser added in v0.4.0

type AggsenderFlowBaser interface {
	GetCertificateBuildParamsInternal(
		ctx context.Context, certType CertificateType) (*CertificateBuildParams, error)
	BuildCertificate(ctx context.Context,
		certParams *CertificateBuildParams,
		lastSentCertificate *CertificateHeader,
		allowEmptyCert bool) (*agglayertypes.Certificate, error)
	GetNewLocalExitRoot(ctx context.Context,
		certParams *CertificateBuildParams) (common.Hash, error)
	VerifyBuildParams(ctx context.Context, fullCert *CertificateBuildParams) error
	VerifyBlockRangeGaps(
		ctx context.Context,
		lastSentCertificate *CertificateHeader,
		newFromBlock, newToBlock uint64) error
	ConvertClaimToImportedBridgeExit(claim bridgesync.Claim) (*agglayertypes.ImportedBridgeExit, error)
	StartL2Block() uint64
	GeneratePreBuildParams(ctx context.Context,
		certType CertificateType) (*CertificatePreBuildParams, error)
	GenerateBuildParams(ctx context.Context,
		preParams CertificatePreBuildParams) (*CertificateBuildParams, error)
	LimitCertSize(certParams *CertificateBuildParams) (*CertificateBuildParams, error)
}

type AggsenderInfo

type AggsenderInfo struct {
	AggsenderStatus          AggsenderStatus `json:"aggsender_status"`
	Version                  zkevm.FullVersion
	EpochNotifierDescription string        `json:"epoch_notifier_description"`
	NetworkID                uint32        `json:"network_id"`
	Mode                     AggsenderMode `json:"mode"`
}

type AggsenderMode added in v0.3.0

type AggsenderMode string
const (
	PessimisticProofMode AggsenderMode = "PessimisticProof"
	AggchainProofMode    AggsenderMode = "AggchainProof"
	AutoMode             AggsenderMode = "Auto"
)

func NewAggsenderMode added in v0.7.0

func NewAggsenderMode(mode string) (AggsenderMode, error)

func (*AggsenderMode) Scan added in v0.7.0

func (c *AggsenderMode) Scan(value interface{}) error

meddler support for store as string

func (AggsenderMode) String added in v0.7.0

func (m AggsenderMode) String() string

func (*AggsenderMode) Validate added in v0.7.0

func (c *AggsenderMode) Validate() error

type AggsenderStatus

type AggsenderStatus struct {
	Running   bool                `json:"running"`
	StartTime time.Time           `json:"start_time"`
	Status    AggsenderStatusType `json:"status"`
	LastError string              `json:"last_error"`
}

func (*AggsenderStatus) SetLastError

func (a *AggsenderStatus) SetLastError(err error)

func (*AggsenderStatus) Start

func (a *AggsenderStatus) Start(startTime time.Time)

type AggsenderStatusType

type AggsenderStatusType string
const (
	StatusNone                 AggsenderStatusType = "none"
	StatusCheckingInitialStage AggsenderStatusType = "checking_initial_stage"
	StatusCertificateStage     AggsenderStatusType = "certificate_stage"
)

type AggsenderVerifierFlow added in v0.7.0

type AggsenderVerifierFlow interface {
	// BuildCertificate builds a certificate based on the buildParams
	BuildCertificate(ctx context.Context,
		buildParams *CertificateBuildParams) (*agglayertypes.Certificate, error)
	// GenerateBuildParams generates the build parameters based on the preParams
	GenerateBuildParams(ctx context.Context,
		preParams *CertificatePreBuildParams) (*CertificateBuildParams, error)
	// VerifyCertificate verifies the certificate field for the given certificate
	VerifyCertificate(
		ctx context.Context,
		cert *agglayertypes.Certificate,
		lastBlockInCert uint64,
		lastSettledBlock uint64) error
}

AggsenderVerifierFlow is an interface that defines the methods to verify the certificate

type BlockNotifier

type BlockNotifier interface {
	// NotifyEpochStarted notifies the epoch has started.
	Subscribe(id string) <-chan EventNewBlock
	GetCurrentBlockNumber() uint64
	String() string
}

BlockNotifier is the interface that wraps the basic methods to notify a new block.

type BlockRange added in v0.5.0

type BlockRange struct {
	FromBlock uint64
	ToBlock   uint64
}

BlockRange represents a range of blocks with inclusive starting (FromBlock) and ending (ToBlock) block numbers.

func NewBlockRange added in v0.5.0

func NewBlockRange(fromBlock, toBlock uint64) BlockRange

NewBlockRange creates and returns a new BlockRange with the specified fromBlock and toBlock values.

func (BlockRange) CountBlocks added in v0.5.0

func (b BlockRange) CountBlocks() uint64

CountBlocks returns the total number of blocks in the BlockRange, inclusive of both FromBlock and ToBlock. If both FromBlock and ToBlock are zero, or if FromBlock is greater than ToBlock, it returns 0.

func (BlockRange) Gap added in v0.5.0

func (b BlockRange) Gap(other BlockRange) BlockRange

Gap returns the BlockRange representing the gap between the receiver BlockRange (b) and another BlockRange (other). If the two ranges overlap or are adjacent (touching), it returns an empty BlockRange. If there is a gap, it returns the range of blocks strictly between b and other. The direction of the gap depends on the relative positions of the two ranges.

func (BlockRange) Greater added in v0.5.2

func (b BlockRange) Greater(other BlockRange) bool

Greater returns true if the receiver BlockRange (b) is strictly greater than the other BlockRange (other). [ 10 - 50 ] > [ 1 - 9 ] = true [ 10 - 50 ] > [ 5 - 15 ] = false (overlap) [ 10 - 50 ] > [ 51 - 100 ] = false (not greater)

func (BlockRange) IsEmpty added in v0.5.0

func (b BlockRange) IsEmpty() bool

IsEmpty returns true if the BlockRange contains no blocks.

func (BlockRange) IsNextContigousBlock added in v0.7.0

func (b BlockRange) IsNextContigousBlock(next BlockRange) bool

IsNextContigousBlock checks if 'next' BlockRange is exactly the next contiguous block so the way to use this is: previousBlockRange.IsNextContigousBlock(nextBlockRange)

func (BlockRange) String added in v0.5.0

func (b BlockRange) String() string

String returns a string representation of the BlockRange in the format "FromBlock: <from>, ToBlock: <to>".

type BridgeQuerier added in v0.4.0

type BridgeQuerier interface {
	GetBridgesAndClaims(
		ctx context.Context,
		fromBlock, toBlock uint64,
	) ([]bridgesync.Bridge, []bridgesync.Claim, error)
	GetExitRootByIndex(ctx context.Context, index uint32) (common.Hash, error)
	GetLastProcessedBlock(ctx context.Context) (uint64, error)
	OriginNetwork() uint32
	WaitForSyncerToCatchUp(ctx context.Context, block uint64) error
}

BridgeQuerier is an interface defining functions that an BridgeQuerier should implement

type CertStatus added in v0.4.0

type CertStatus struct {
	ExistPendingCerts   bool
	ExistNewInErrorCert bool
}

CertStatus holds the status of pending and in error certificates

type Certificate added in v0.4.0

type Certificate struct {
	Header            *CertificateHeader
	SignedCertificate *string        `meddler:"signed_certificate"`
	AggchainProof     *AggchainProof `meddler:"aggchain_proof,aggchainproof"`
	// ExtraData is a no structured data used to debug or extra info for this certificate
	ExtraData string `meddler:"extra_data"`
}

func (*Certificate) String added in v0.4.0

func (c *Certificate) String() string

type CertificateBuildParams

type CertificateBuildParams struct {
	FromBlock                      uint64
	ToBlock                        uint64
	Bridges                        []bridgesync.Bridge
	Claims                         []bridgesync.Claim
	CreatedAt                      uint32
	RetryCount                     int
	LastSentCertificate            *CertificateHeader
	L1InfoTreeRootFromWhichToProve common.Hash
	L1InfoTreeLeafCount            uint32
	AggchainProof                  *AggchainProof
	CertificateType                CertificateType
	ExtraData                      string
}

CertificateBuildParams is a struct that holds the parameters to build a certificate

func (*CertificateBuildParams) EstimatedSize

func (c *CertificateBuildParams) EstimatedSize() uint

EstimatedSize returns the estimated size of the certificate

func (*CertificateBuildParams) IsARetry added in v0.4.0

func (c *CertificateBuildParams) IsARetry() bool

IsARetry returns true if the certificate is a retry

func (*CertificateBuildParams) IsEmpty

func (c *CertificateBuildParams) IsEmpty() bool

IsEmpty returns true if the certificate is empty

func (*CertificateBuildParams) MaxDepositCount

func (c *CertificateBuildParams) MaxDepositCount() uint32

MaxDepoitCount returns the maximum deposit count in the certificate

func (*CertificateBuildParams) NumberOfBlocks

func (c *CertificateBuildParams) NumberOfBlocks() int

NumberOfBlocks returns the number of blocks in the certificate

func (*CertificateBuildParams) NumberOfBridges

func (c *CertificateBuildParams) NumberOfBridges() int

NumberOfBridges returns the number of bridges in the certificate

func (*CertificateBuildParams) NumberOfClaims

func (c *CertificateBuildParams) NumberOfClaims() int

NumberOfClaims returns the number of claims in the certificate

func (*CertificateBuildParams) Range

func (c *CertificateBuildParams) Range(fromBlock, toBlock uint64) (*CertificateBuildParams, error)

Range create a new CertificateBuildParams with the given range

func (*CertificateBuildParams) String

func (c *CertificateBuildParams) String() string

type CertificateHeader added in v0.4.0

type CertificateHeader struct {
	Height                  uint64                          `meddler:"height"`
	RetryCount              int                             `meddler:"retry_count"`
	CertificateID           common.Hash                     `meddler:"certificate_id,hash"`
	PreviousLocalExitRoot   *common.Hash                    `meddler:"previous_local_exit_root,hash"`
	NewLocalExitRoot        common.Hash                     `meddler:"new_local_exit_root,hash"`
	FromBlock               uint64                          `meddler:"from_block"`
	ToBlock                 uint64                          `meddler:"to_block"`
	Status                  agglayertypes.CertificateStatus `meddler:"status"`
	CreatedAt               uint32                          `meddler:"created_at"`
	UpdatedAt               uint32                          `meddler:"updated_at"`
	FinalizedL1InfoTreeRoot *common.Hash                    `meddler:"finalized_l1_info_tree_root,hash"`
	L1InfoTreeLeafCount     uint32                          `meddler:"l1_info_tree_leaf_count"`
	// CertType must be private but there are a lot of code that create CertificateInfo directly
	// so I add a GetCertType() that is not idiomatic but helps to determine the kind of certificate
	CertType CertificateType `meddler:"cert_type"`
	// This is the origin of this data, it can be from the AggLayer or from the local sender
	CertSource CertificateSource `meddler:"cert_source"`
}

func (*CertificateHeader) ElapsedTimeSinceCreation added in v0.4.0

func (c *CertificateHeader) ElapsedTimeSinceCreation() time.Duration

ElapsedTimeSinceCreation returns the time elapsed since the certificate was created.

func (*CertificateHeader) ElapsedTimeSinceCreationString added in v0.7.0

func (c *CertificateHeader) ElapsedTimeSinceCreationString() string

ElapsedTimeSinceCreationString returns the time elapsed since the certificate was created as a string

func (*CertificateHeader) ID added in v0.4.0

func (c *CertificateHeader) ID() string

ID returns a string with the unique identifier of the certificate (height+certificateID)

func (*CertificateHeader) IsClosed added in v0.4.0

func (c *CertificateHeader) IsClosed() bool

IsClosed returns true if the certificate is closed (settled or inError)

func (*CertificateHeader) StatusString added in v0.4.0

func (c *CertificateHeader) StatusString() string

StatusString returns the string representation of the status

func (*CertificateHeader) String added in v0.4.0

func (c *CertificateHeader) String() string

type CertificateL1InfoTreeData added in v0.7.0

type CertificateL1InfoTreeData struct {
	L1InfoTreeRootToProve common.Hash
	L1InfoTreeLeafCount   uint32
}

CertificateL1InfoTreeData is a struct that holds the L1 info tree root and leaf count that is used to prove the L1 info tree in the certificate

func (*CertificateL1InfoTreeData) String added in v0.7.0

func (c *CertificateL1InfoTreeData) String() string

type CertificatePreBuildParams added in v0.7.0

type CertificatePreBuildParams struct {
	BlockRange          BlockRange
	RetryCount          int
	CertificateType     CertificateType
	LastSentCertificate *CertificateHeader
	L1InfoTreeToProve   *CertificateL1InfoTreeData
	CreatedAt           uint32
}

CertificatePreBuildParams is a struct that holds the parameters to pre-build a certificate basically it's used for generate CertificateBuildParams that add bridges

func (*CertificatePreBuildParams) String added in v0.7.0

func (c *CertificatePreBuildParams) String() string

type CertificateQuerier added in v0.7.0

type CertificateQuerier interface {
	GetLastSettledCertificateToBlock(
		ctx context.Context,
		cert *agglayertypes.CertificateHeader) (uint64, error)
	GetNewCertificateToBlock(
		ctx context.Context,
		cert *agglayertypes.Certificate) (uint64, error)
	CalculateCertificateType(cert *agglayertypes.Certificate, certToBlock uint64) CertificateType
	CalculateCertificateTypeFromToBlock(certToBlock uint64) CertificateType
}

CertificateQuerier is an interface defining functions that a CertificateQuerier should implement

type CertificateSource added in v0.4.0

type CertificateSource string
const (
	CertificateSourceAggLayer CertificateSource = "agglayer"
	CertificateSourceLocal    CertificateSource = "local"
	CertificateSourceUnknown  CertificateSource = ""
)

func (CertificateSource) String added in v0.4.0

func (c CertificateSource) String() string

type CertificateStatusChecker added in v0.4.0

type CertificateStatusChecker interface {
	CheckPeriodicallyStatus(ctx context.Context) (CertStatus, error)
	CheckInitialStatus(
		ctx context.Context,
		delayBetweenRetries time.Duration,
		aggsenderStatus *AggsenderStatus)
}

CertificateStatusChecker is an interface defining functions that a CertificateStatusChecker should implement

type CertificateType added in v0.4.0

type CertificateType uint8

func NewCertificateTypeFromInt added in v0.4.0

func NewCertificateTypeFromInt(v uint8) CertificateType

func NewCertificateTypeFromStr added in v0.4.0

func NewCertificateTypeFromStr(v string) (CertificateType, error)

func (*CertificateType) Scan added in v0.4.0

func (c *CertificateType) Scan(value interface{}) error

meddler support for store as string

func (CertificateType) String added in v0.4.0

func (c CertificateType) String() string

func (CertificateType) ToInt added in v0.4.0

func (c CertificateType) ToInt() uint8

func (CertificateType) Value added in v0.4.0

func (c CertificateType) Value() (driver.Value, error)

meddler support for store as string

type CertificateValidateAndSigner added in v0.7.0

type CertificateValidateAndSigner interface {
	// HealthCheck checks the health of the validator service
	HealthCheck(ctx context.Context) (*HealthCheckResponse, error)
	// ValidateAndSignCertificate validates the certificate and signs it if valid.
	ValidateAndSignCertificate(
		ctx context.Context,
		certificate *agglayertypes.Certificate,
		lastL2BlockInCert uint64,
	) ([]byte, error)
	URL() string
	String() string
	Address() common.Address
	Index() uint32
}

CertificateValidateAndSigner is an interface to attach a certificate validator and signer to aggsender regular flow

type CertificateValidator added in v0.7.0

type CertificateValidator interface {
	ValidateCertificate(ctx context.Context, params VerifyIncomingRequest) error
}

type ChainGERReader added in v0.3.0

type ChainGERReader interface {
	GetInjectedGERsForRange(ctx context.Context,
		fromBlock, toBlock uint64) (map[common.Hash]l2gersync.GlobalExitRootInfo, error)
}

ChainGERReader is an interface defining functions that an ChainGERReader should implement

type EpochEvent

type EpochEvent struct {
	Epoch uint64
	// ExtraInfo if a detailed information about the epoch that depends on implementation
	ExtraInfo fmt.Stringer
}

EpochEvent is the event that notifies the neear end epoch

func (EpochEvent) String

func (e EpochEvent) String() string

type EpochNotifier

type EpochNotifier interface {
	// NotifyEpochStarted notifies the epoch is close to end.
	Subscribe(id string) <-chan EpochEvent
	// Start starts the notifier synchronously
	Start(ctx context.Context)
	// GetEpochStatus returns the current status of the epoch
	GetEpochStatus() EpochStatus
	String() string
	ForcePublishEpochEvent()
}

type EpochStatus added in v0.0.2

type EpochStatus struct {
	Epoch        uint64
	PercentEpoch float64
}

func (EpochStatus) String added in v0.3.0

func (e EpochStatus) String() string

type EventNewBlock

type EventNewBlock struct {
	BlockNumber       uint64
	BlockFinalityType aggkittypes.BlockNumberFinality
	BlockRate         time.Duration
}

type FEPContractQuerier added in v0.7.0

type FEPContractQuerier interface {
	StartingBlockNumber(opts *bind.CallOpts) (*big.Int, error)
	LatestBlockNumber(opts *bind.CallOpts) (*big.Int, error)
	GetAggchainSigners(opts *bind.CallOpts) ([]common.Address, error)
	OptimisticMode(opts *bind.CallOpts) (bool, error)
	SelectedOpSuccinctConfigName(opts *bind.CallOpts) ([32]byte, error)
	OpSuccinctConfigs(opts *bind.CallOpts, arg0 [32]byte) (struct {
		AggregationVkey     [32]byte
		RangeVkeyCommitment [32]byte
		RollupConfigHash    [32]byte
	}, error)
}

FEPContractQuerier is an interface that defines the methods for interacting with the FEP contract.

type GERQuerier added in v0.4.0

type GERQuerier interface {
	GetInjectedGERsProofs(
		ctx context.Context,
		finalizedL1InfoTreeRoot *treetypes.Root,
		fromBlock, toBlock uint64) (map[common.Hash]*agglayertypes.ProvenInsertedGERWithBlockNumber, error)
}

GERQuerier is an interface defining functions that an GERQuerier should implement

type GenericSubscriber

type GenericSubscriber[T any] interface {
	Subscribe(subscriberName string) <-chan T
	Publish(data T)
}

type HealthCheckResponse added in v0.7.0

type HealthCheckResponse struct {
	Status       HealthCheckStatus
	StatusReason string
	Version      string
}

HealthCheckResponse response for health check

func (*HealthCheckResponse) IsHealthy added in v0.7.0

func (h *HealthCheckResponse) IsHealthy() bool

IsHealthy checks if the health check response is healthy

func (*HealthCheckResponse) String added in v0.7.0

func (h *HealthCheckResponse) String() string

String returns a string representation of the HealthCheckResponse

type HealthCheckStatus added in v0.7.0

type HealthCheckStatus = string

HealthCheckStatus defines the status of a health check

const (
	HealthCheckStatusOK HealthCheckStatus = "OK"
)

type L1InfoTreeDataQuerier added in v0.3.0

type L1InfoTreeDataQuerier interface {
	// GetLatestFinalizedL1InfoRoot returns the latest processed l1 info tree root
	// based on the latest finalized l1 block
	GetLatestFinalizedL1InfoRoot(ctx context.Context) (*treetypes.Root, *l1infotreesync.L1InfoTreeLeaf, error)

	// GetFinalizedL1InfoTreeData returns the L1 Info tree data for the last finalized processed block
	// l1InfoTreeData is:
	// - merkle proof of given l1 info tree leaf
	// - the leaf data of the highest index leaf on that block and root
	// - the root of the l1 info tree on that block
	GetFinalizedL1InfoTreeData(ctx context.Context,
	) (treetypes.Proof, *l1infotreesync.L1InfoTreeLeaf, *treetypes.Root, error)

	// GetProofForGER returns the L1 Info tree leaf and the merkle proof for the given GER
	GetProofForGER(ctx context.Context, ger, rootFromWhichToProve common.Hash) (
		*l1infotreesync.L1InfoTreeLeaf, treetypes.Proof, error)

	// CheckIfClaimsArePartOfFinalizedL1InfoTree checks if the claims are part of the finalized L1 Info tree
	CheckIfClaimsArePartOfFinalizedL1InfoTree(
		finalizedL1InfoTreeRoot *treetypes.Root, claims []bridgesync.Claim) error

	// GetL1InfoRootByLeafIndex returns the L1 Info tree root for the given leaf index
	GetL1InfoRootByLeafIndex(ctx context.Context, leafCount uint32) (*treetypes.Root, error)

	// GetInfoByIndex returns the L1 Info tree leaf for the given index
	GetInfoByIndex(ctx context.Context, index uint32) (*l1infotreesync.L1InfoTreeLeaf, error)
}

L1InfoTreeDataQuerier is an interface defining functions that an L1InfoTreeDataQuerier should implement It is used to query data from the L1 Info tree

type L1InfoTreeSyncer

type L1InfoTreeSyncer interface {
	GetInfoByGlobalExitRoot(globalExitRoot common.Hash) (*l1infotreesync.L1InfoTreeLeaf, error)
	GetL1InfoTreeMerkleProofFromIndexToRoot(
		ctx context.Context, index uint32, root common.Hash,
	) (treetypes.Proof, error)
	GetL1InfoTreeRootByIndex(ctx context.Context, index uint32) (treetypes.Root, error)
	GetLastL1InfoTreeRoot(ctx context.Context) (treetypes.Root, error)
	GetProcessedBlockUntil(ctx context.Context, blockNumber uint64) (uint64, common.Hash, error)
	GetInfoByIndex(ctx context.Context, index uint32) (*l1infotreesync.L1InfoTreeLeaf, error)
	GetLatestL1InfoLeafUntilBlock(ctx context.Context, blockNum uint64) (*l1infotreesync.L1InfoTreeLeaf, error)
	IsUpToDate(ctx context.Context, l1Client aggkittypes.BaseEthereumClienter) (bool, error)
}

L1InfoTreeSyncer is an interface defining functions that an L1InfoTreeSyncer should implement

type L2BridgeSyncer

type L2BridgeSyncer interface {
	GetBlockByLER(ctx context.Context, ler common.Hash) (uint64, error)
	GetExitRootByIndex(ctx context.Context, index uint32) (treetypes.Root, error)
	GetBridges(ctx context.Context, fromBlock, toBlock uint64) ([]bridgesync.Bridge, error)
	GetClaims(ctx context.Context, fromBlock, toBlock uint64) ([]bridgesync.Claim, error)
	OriginNetwork() uint32
	GetLastProcessedBlock(ctx context.Context) (uint64, error)
	GetExitRootByHash(ctx context.Context, root common.Hash) (*treetypes.Root, error)
	GetClaimsByGlobalIndex(ctx context.Context, globalIndex *big.Int) ([]bridgesync.Claim, error)
}

L2BridgeSyncer is an interface defining functions that an L2BridgeSyncer should implement

type LERQuerier added in v0.5.0

type LERQuerier interface {
	GetLastLocalExitRoot() (common.Hash, error)
}

LERQuerier is an interface defining functions that a Local Exit Root querier should implement

type LocalExitRootQuery added in v0.7.0

type LocalExitRootQuery interface {
	GetNewLocalExitRoot(ctx context.Context,
		certParams *CertificateBuildParams) (common.Hash, error)
}

LocalExitRootQuery is an interface defining functions that a LocalExitRootQuery should implement

type Logger

type Logger interface {
	Panicf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
}

Logger is an interface that defines the methods to log messages

type MaxL2BlockNumberLimiterInterface added in v0.4.0

type MaxL2BlockNumberLimiterInterface interface {
	// AdaptCertificate is a custom handler that adjusts the certificate build parameters
	//  and return it through a new buildParams
	AdaptCertificate(
		buildParams *CertificateBuildParams) (*CertificateBuildParams, error)
}

MaxL2BlockNumberLimiterInterface is an interface defining functions that a MaxL2BlockNumberLimiter should implement

type MultisigCommittee added in v0.7.0

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

MultisigCommittee represents a set of authorized signers with a signing threshold.

func NewMultisigCommittee added in v0.7.0

func NewMultisigCommittee(signers []*SignerInfo, threshold uint64) (*MultisigCommittee, error)

NewMultisigCommittee creates a new committee and builds the address set for quick lookup.

func (*MultisigCommittee) AddSigner added in v0.7.0

func (m *MultisigCommittee) AddSigner(info *SignerInfo) error

AddSigner adds a new signer to the committee. Returns an error if the address already exists.

func (*MultisigCommittee) IsMember added in v0.7.0

func (m *MultisigCommittee) IsMember(address common.Address) bool

IsMember checks if the given address is part of the committee

func (*MultisigCommittee) Signers added in v0.7.0

func (m *MultisigCommittee) Signers() []SignerInfo

Signers returns a shallow copy of the committee's signers slice to prevent external modification of the internal slice.

func (*MultisigCommittee) Size added in v0.7.0

func (m *MultisigCommittee) Size() int

Size returns the committee size

func (*MultisigCommittee) String added in v0.7.0

func (m *MultisigCommittee) String() string

String returns a string representation of the committee

func (MultisigCommittee) Threshold added in v0.7.0

func (m MultisigCommittee) Threshold() uint64

ThresholdInt returns the signature threshold required for quorum as an int64.

type MultisigContract added in v0.7.0

type MultisigContract interface {
	Threshold(opts *bind.CallOpts) (*big.Int, error)
	GetAggchainSignerInfos(opts *bind.CallOpts) ([]aggchainbase.IAggchainSignersSignerInfo, error)
	AGGCHAINTYPE(opts *bind.CallOpts) ([2]byte, error)
	CONSENSUSTYPE(opts *bind.CallOpts) (uint32, error)
}

MultisigContract is an abstraction for Multisig smart contract

type MultisigQuerier added in v0.7.0

type MultisigQuerier interface {
	GetMultisigCommittee(ctx context.Context, blockNum *big.Int) (*MultisigCommittee, error)
	ContractMode() (AggsenderMode, error)
	ResolveAutoMode(cfgMode AggsenderMode) (AggsenderMode, error)
}

MultisigQuerier is an abstraction for querying the multisig committee

type OpNodeClienter added in v0.7.0

type OpNodeClienter interface {
	OutputAtBlockRoot(blockNum uint64) (common.Hash, error)
}

OpNodeClienter is an interface that defines the methods for interacting with the OpNode client.

type OptimisticModeQuerier added in v0.4.0

type OptimisticModeQuerier interface {
	// IsOptimisticModeOn returns true if the optimistic mode is on
	IsOptimisticModeOn() (bool, error)
}

type OptimisticSigner added in v0.4.0

type OptimisticSigner interface {
	Sign(ctx context.Context,
		aggchainReq AggchainProofRequest,
		newLocalExitRoot common.Hash,
		claims []bridgesync.Claim,
	) ([]byte, string, error)
}

OptimisticSigner is an interface for signing optimistic proofs.

type RollupDataQuerier added in v0.5.0

type RollupDataQuerier interface {
	GetRollupData(blockNumber *big.Int) (polygonrollupmanager.PolygonRollupManagerRollupDataReturn, error)
	GetRollupChainID() (uint64, error)
}

RollupDataQuerier is an interface that abstracts interaction with the rollup manager contract

type SP1StarkProof added in v0.3.0

type SP1StarkProof struct {
	// SP1 Version
	Version string
	// SP1 stark proof.
	Proof []byte
	// SP1 stark proof verification key.
	Vkey []byte
}

func (*SP1StarkProof) String added in v0.3.0

func (s *SP1StarkProof) String() string

type SignerInfo added in v0.7.0

type SignerInfo struct {
	URL     string
	Address common.Address
}

SignerInfo holds metadata for each signer.

func NewSignerInfo added in v0.7.0

func NewSignerInfo(url string, address common.Address) *SignerInfo

NewSignerInfo creates a new instance of a signer

func (*SignerInfo) String added in v0.7.0

func (s *SignerInfo) String() string

String returns a string representation of the signer

type ValidationRequest added in v0.7.0

type ValidationRequest struct {
	Certificate       *agglayertypes.Certificate
	LastL2BlockInCert uint64
}

ValidationRequest contains all parameters needed for committee validation

type ValidatorClient added in v0.7.0

type ValidatorClient interface {
	HealthCheck(ctx context.Context) (*HealthCheckResponse, error)
	ValidateCertificate(
		ctx context.Context,
		previousCertificateID *common.Hash,
		certificate *agglayertypes.Certificate,
		lastL2BlockInCert uint64,
	) ([]byte, error)
}

ValidatorClient is an interface defining functions that a ValidatorClient should implement

type ValidatorPoller added in v0.7.0

type ValidatorPoller interface {
	PollValidators(ctx context.Context, req *ValidationRequest) (*agglayertypes.Multisig, error)
}

ValidatorPoller is an interface defining functions that a ValidatorPoller should implement

type VerifyIncomingRequest added in v0.7.0

type VerifyIncomingRequest struct {
	Certificate         *agglayertypes.Certificate
	PreviousCertificate *agglayertypes.CertificateHeader
	LastL2BlockInCert   uint64
}

Jump to

Keyboard shortcuts

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