Documentation
¶
Index ¶
- Constants
- Variables
- type AggchainProof
- type AggchainProofClientInterface
- type AggchainProofQuerier
- type AggchainProofRequest
- type AggsenderFlow
- type AggsenderFlowBaser
- type AggsenderInfo
- type AggsenderMode
- type AggsenderStatus
- type AggsenderStatusType
- type BlockNotifier
- type BlockRange
- type BridgeQuerier
- type CertStatus
- type Certificate
- type CertificateBuildParams
- func (c *CertificateBuildParams) EstimatedSize() uint
- func (c *CertificateBuildParams) IsARetry() bool
- func (c *CertificateBuildParams) IsEmpty() bool
- func (c *CertificateBuildParams) MaxDepositCount() uint32
- func (c *CertificateBuildParams) NumberOfBlocks() int
- func (c *CertificateBuildParams) NumberOfBridges() int
- func (c *CertificateBuildParams) NumberOfClaims() int
- func (c *CertificateBuildParams) Range(fromBlock, toBlock uint64) (*CertificateBuildParams, error)
- func (c *CertificateBuildParams) String() string
- type CertificateHeader
- type CertificateL1InfoTreeData
- type CertificateMetadata
- type CertificatePreBuildParams
- type CertificateSource
- type CertificateStatusChecker
- type CertificateType
- type CertificateValidateAndSigner
- type CertificateValidator
- type ChainGERReader
- type EpochEvent
- type EpochNotifier
- type EpochStatus
- type EventNewBlock
- type GERQuerier
- type GenericSubscriber
- type HealthCheckResponse
- type HealthCheckStatus
- type L1InfoTreeDataQuerier
- type L1InfoTreeSyncer
- type L2BridgeSyncer
- type LERQuerier
- type LocalExitRootQuery
- type Logger
- type MaxL2BlockNumberLimiterInterface
- type OptimisticModeQuerier
- type OptimisticSigner
- type RollupDataQuerier
- type SP1StarkProof
- type ValidatorClient
- type VerifyIncomingRequest
Constants ¶
const ( CertificateMetadataV0 = uint8(0) // Pre v1 metadata, only ToBlock is stored CertificateMetadataV1 = uint8(1) // Post v1 metadata, FromBlock, Offset, CreatedAt are stored CertificateMetadataV2 = uint8(2) // Same V1 + CertType LatestCertificateMetadataVersion = CertificateMetadataV2 )
const ( CertificateTypeUnknownStr string = "" CertificateTypePPStr string = "pp" CertificateTypeFEPStr string = "fep" CertificateTypeOptimisticStr string = "optimistic" CertificateTypeUnknown CertificateType = 0 CertificateTypePP CertificateType = 1 CertificateTypeFEP CertificateType = 2 CertificateTypeOptimistic CertificateType = 3 )
const NilStr = "nil"
Variables ¶
var (
BlockRangeZero = BlockRange{}
)
Functions ¶
This section is empty.
Types ¶
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 AggsenderFlow ¶ added in v0.3.0
type AggsenderFlow 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)
}
AggsenderFlow 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"`
}
type AggsenderMode ¶ added in v0.3.0
type AggsenderMode string
const ( PessimisticProofMode AggsenderMode = "PessimisticProof" AggchainProofMode AggsenderMode = "AggchainProof" )
func (AggsenderMode) String ¶ added in v0.7.0
func (m AggsenderMode) String() string
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 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
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) 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
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) DetermineCertType ¶ added in v0.4.0
func (c *Certificate) DetermineCertType(startL2Block uint64) CertificateType
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) ID ¶ added in v0.4.0
func (c *CertificateHeader) ID() string
ID returns a string with the unique identifier of the cerificate (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 CertificateMetadata ¶
type CertificateMetadata struct {
// ToBlock contains the pre v1 value stored in the metadata certificate field
// is not stored in the hash post v1
ToBlock uint64
// FromBlock is the block number from which the certificate contains data
FromBlock uint64
// Offset is the number of blocks from the FromBlock that the certificate contains
Offset uint32
// CreatedAt is the timestamp when the certificate was created
CreatedAt uint32
// Version is the version of the metadata
Version uint8
// CertType is the type of certificate
CertType uint8 // version >= V2
}
func NewCertificateMetadata ¶
func NewCertificateMetadata(fromBlock uint64, offset uint32, createdAt uint32, certType uint8) *CertificateMetadata
NewCertificateMetadata returns a new CertificateMetadata from the given hash
func NewCertificateMetadataFromHash ¶
func NewCertificateMetadataFromHash(hash common.Hash) (*CertificateMetadata, error)
NewCertificateMetadataFromHash returns a new CertificateMetadata from the given hash
func (*CertificateMetadata) BlockRange ¶
func (c *CertificateMetadata) BlockRange() (BlockRange, error)
func (*CertificateMetadata) CertificateType ¶
func (c *CertificateMetadata) CertificateType() CertificateType
func (*CertificateMetadata) String ¶
func (c *CertificateMetadata) String() string
func (*CertificateMetadata) ToHash ¶
func (c *CertificateMetadata) ToHash() common.Hash
ToHash returns the hash of the metadata
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 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 {
CheckPendingCertificatesStatus(ctx context.Context) CertStatus
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
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,
) ([]byte, error)
String() string
}
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
}
type EpochStatus ¶ added in v0.0.2
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 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 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)
}
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)
}
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
BlockFinality() aggkittypes.BlockNumberFinality
GetLastProcessedBlock(ctx context.Context) (uint64, error)
}
L2BridgeSyncer is an interface defining functions that an L2BridgeSyncer should implement
type LERQuerier ¶ added in v0.5.0
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 OptimisticModeQuerier ¶ added in v0.4.0
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)
}
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 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,
) ([]byte, error)
}
ValidatorClient is an interface defining functions that a ValidatorClient should implement
type VerifyIncomingRequest ¶ added in v0.7.0
type VerifyIncomingRequest struct {
Certificate *agglayertypes.Certificate
PreviousCertificate *agglayertypes.CertificateHeader
}