Documentation
¶
Index ¶
- Constants
- Variables
- type AggProofPublicValuesQuerier
- type AggchainFEPRollupQuerier
- type AggchainParams
- type AggchainProof
- type AggchainProofClientInterface
- type AggchainProofQuerier
- type AggchainProofRequest
- type AgglayerBridgeL2Reader
- type AggregationProofPublicValues
- type AggsenderBuilderFlow
- type AggsenderFlowBaser
- type AggsenderInfo
- type AggsenderMode
- type AggsenderStatus
- type AggsenderStatusType
- type AggsenderVerifierFlow
- type BridgeQuerier
- type CertStatus
- type Certificate
- type CertificateBuildParams
- func (c *CertificateBuildParams) AdjustToBlock(newToBlock uint64) (*CertificateBuildParams, error)
- 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) NumberOfUnclaims() int
- func (c *CertificateBuildParams) Range(fromBlock, toBlock uint64) (*CertificateBuildParams, error)
- func (c *CertificateBuildParams) String() string
- type CertificateHeader
- func (c *CertificateHeader) ElapsedTimeSinceCreation() time.Duration
- func (c *CertificateHeader) ElapsedTimeSinceCreationString() string
- func (c *CertificateHeader) ID() string
- func (c *CertificateHeader) IsClosed() bool
- func (c *CertificateHeader) StatusString() string
- func (c *CertificateHeader) String() string
- type CertificateL1InfoTreeData
- type CertificatePreBuildParams
- type CertificateQuerier
- type CertificateSendTrigger
- type CertificateSource
- type CertificateStatusChecker
- type CertificateTriggerEvent
- type CertificateType
- type CertificateValidateAndSigner
- type CertificateValidator
- type ChainGERReader
- type EpochEvent
- type EpochNotifier
- type EpochStatus
- type FEPContractQuerier
- type FEPInputsQuerier
- type GERQuerier
- type HealthCheckResponse
- type HealthCheckStatus
- type L1InfoTreeDataQuerier
- type L1InfoTreeSyncer
- type L2BridgeSyncer
- type LERQuerier
- type LocalExitRootQuery
- type Logger
- type MaxL2BlockNumberLimiterInterface
- type MultisigCommittee
- func (m *MultisigCommittee) AddSigner(info *SignerInfo) error
- func (m *MultisigCommittee) IsMember(address common.Address) bool
- func (m *MultisigCommittee) Signers() []SignerInfo
- func (m *MultisigCommittee) Size() int
- func (m *MultisigCommittee) String() string
- func (m MultisigCommittee) Threshold() uint64
- type MultisigContract
- type MultisigQuerier
- type OpNodeClienter
- type OptimisticModeQuerier
- type OptimisticSigner
- type RollupDataQuerier
- type SP1StarkProof
- type SignerInfo
- type ValidationRequest
- type ValidatorClient
- type ValidatorPoller
- type VerifyIncomingRequest
Constants ¶
const ( NilStr = "nil" NAStr = "N/A" )
const ( CertificateTypeUnknownStr string = "" CertificateTypePPStr string = "pp" CertificateTypeFEPStr string = "fep" CertificateTypeOptimisticStr string = "optimistic" CertificateTypePreconfPPStr string = "preconf_pp" CertificateTypeUnknown CertificateType = 0 CertificateTypePP CertificateType = 1 CertificateTypeFEP CertificateType = 2 CertificateTypeOptimistic CertificateType = 3 CertificateTypePreconfPP CertificateType = 4 )
Variables ¶
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 AggchainParams ¶ added in v0.8.0
type AggchainParams struct {
AggregationProofPublicValues
OptimisticMode bool
}
AggchainParams represents the parameters required for aggchain proof verification.
func (*AggchainParams) Hash ¶ added in v0.8.0
func (a *AggchainParams) Hash() (common.Hash, error)
Hash calculates the hash of the AggchainParams using a custom encoding, the same as abi.EncodePacked, since go-ethereum does not provide a function for that.
func (*AggchainParams) String ¶ added in v0.8.0
func (a *AggchainParams) String() string
String returns a string representation of the AggchainParams.
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, 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
RemovedGERs []*agglayer.RemovedGER
Unclaims []*agglayer.Unclaim
}
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, removedGers []*agglayer.RemovedGER, unclaims []*agglayer.Unclaim, ) *AggchainProofRequest
func (*AggchainProofRequest) String ¶ added in v0.4.0
func (r *AggchainProofRequest) String() string
type AgglayerBridgeL2Reader ¶ added in v0.8.0
type AgglayerBridgeL2Reader interface {
GetUnsetClaimsForBlockRange(ctx context.Context,
fromBlock, toBlock uint64) ([]bridgesynctypes.Unclaim, error)
}
AgglayerBridgeL2Reader is an interface defining functions that an AgglayerBridgeL2Reader should implement
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
TrustedSigner common.Address
AggregationVKeyHash common.Hash
}
AggregationProofPublicValues represents the public values used in the aggregation proof.
func (*AggregationProofPublicValues) Hash ¶ added in v0.7.0
func (s *AggregationProofPublicValues) Hash() (common.Hash, error)
Hash calculates the hash of the AggregationProofPublicValues using ABI encoding.
func (*AggregationProofPublicValues) String ¶ added in v0.7.0
func (s *AggregationProofPublicValues) String() string
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 aggkit.FullVersion
TriggerStatus string `json:"trigger_status"`
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" PreconfPPMode AggsenderMode = "PreconfPP" 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 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
GetUnsetClaimsForBlockRange(ctx context.Context,
fromBlock, toBlock uint64) ([]bridgesynctypes.Unclaim, 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) 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
Unclaims []bridgesynctypes.Unclaim
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) AdjustToBlock ¶ added in v0.8.0
func (c *CertificateBuildParams) AdjustToBlock(newToBlock uint64) (*CertificateBuildParams, error)
AdjustToBlock adjusts the certificate build parameters to a new target block. If newToBlock is higher than the current ToBlock, it returns an error. If newToBlock is lower than the current ToBlock, it creates new parameters with an adjusted range that includes only bridges, claims and unclaims within the new range. If newToBlock equals the current ToBlock, it returns the original parameters unchanged.
Parameters:
- newToBlock: the new target block number to adjust to
Returns:
- *CertificateBuildParams: adjusted parameters or original if no adjustment needed
- error: if newToBlock is higher than current ToBlock or if range adjustment fails
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) NumberOfUnclaims ¶ added in v0.8.0
func (c *CertificateBuildParams) NumberOfUnclaims() int
NumberOfUnclaims returns the number of unclaims 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
L1InfoTreeLeaf *l1infotreesync.L1InfoTreeLeaf
}
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 aggkitcommon.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 CertificateSendTrigger ¶ added in v0.8.0
type CertificateSendTrigger interface {
Setup(ctx context.Context)
Status() string
TriggerCh(ctx context.Context) <-chan CertificateTriggerEvent
ForceTriggerEvent()
}
CertificateSendTrigger is an interface that defines methods for setting up and managing certificate sending triggers based on specific events.
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 CertificateTriggerEvent ¶ added in v0.8.0
CertificateTriggerEvent represents an event that triggers certificate sending actions. This can be expanded in the future to include more specific methods or properties
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 any) 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,
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)
GetRemovedGERsForRange(ctx context.Context,
fromBlock, toBlock uint64) ([]*agglayertypes.RemovedGER, 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
func (EpochStatus) String ¶ added in v0.3.0
func (e EpochStatus) String() string
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) ([common.HashLength]byte, error)
OpSuccinctConfigs(opts *bind.CallOpts, arg0 [common.HashLength]byte) (struct {
AggregationVkey [common.HashLength]byte
RangeVkeyCommitment [common.HashLength]byte
RollupConfigHash [common.HashLength]byte
}, error)
}
FEPContractQuerier is an interface that defines the methods for interacting with the FEP contract.
type FEPInputsQuerier ¶ added in v0.8.0
type FEPInputsQuerier interface {
GetAggchainParams(
lastProvenBlock, requestedEndBlock uint64,
l1InfoTreeLeafHash common.Hash) (*AggchainParams, error)
}
FEPInputsQuerier defines an interface for querying FEP inputs required for aggchain proof.
type GERQuerier ¶ added in v0.4.0
type GERQuerier interface {
GetInjectedGERsProofs(
ctx context.Context,
finalizedL1InfoTreeRootHash common.Hash,
fromBlock, toBlock uint64) (map[common.Hash]*agglayertypes.ProvenInsertedGERWithBlockNumber, error)
GetRemovedGERsForRange(ctx context.Context,
fromBlock, toBlock uint64) ([]*agglayertypes.RemovedGER, error)
}
GERQuerier is an interface defining functions that an GERQuerier should implement
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
GetFinalizedL1InfoTreeData(
ctx context.Context,
finalizedL1InfoTreeRootHash common.Hash,
finalizedL1InfoTreeLeafCount uint32,
) (treetypes.Proof, *l1infotreesync.L1InfoTreeLeaf, 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)
// 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)
// IsGERFinalized checks if the given global exit root is finalized
IsGERFinalized(ger common.Hash, finalizedL1InfoLeafCount uint32) (bool, error)
// DoesGERExistsOnL1 checks if the given global exit root exists on L1
DoesGERExistsOnL1(ger common.Hash) (bool, 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)
SubscribeToSync(subscriberID string) <-chan sync.Block
}
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 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
OpNodeClienter is an interface that defines the methods for interacting with the OpNode client.
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) (agglayermanager.AgglayerManagerRollupDataReturn, 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
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
}