Documentation
¶
Index ¶
- func NewBaseFlow(log types.Logger, l2BridgeQuerier types.BridgeQuerier, ...) *baseFlow
- func NewFlow(ctx context.Context, cfg config.Config, logger *log.Logger, ...) (types.AggsenderFlow, error)
- type AggchainProverFlow
- func (a *AggchainProverFlow) BuildCertificate(ctx context.Context, buildParams *types.CertificateBuildParams) (*agglayertypes.Certificate, error)
- func (a *AggchainProverFlow) CheckInitialStatus(ctx context.Context) error
- func (a *AggchainProverFlow) GenerateAggchainProof(ctx context.Context, lastProvenBlock, toBlock uint64, ...) (*types.AggchainProof, *treetypes.Root, error)
- func (a *AggchainProverFlow) GetCertificateBuildParams(ctx context.Context) (*types.CertificateBuildParams, error)
- type AggchainProverFlowConfig
- type BaseFlowConfig
- type PPFlow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBaseFlow ¶ added in v0.4.0
func NewBaseFlow( log types.Logger, l2BridgeQuerier types.BridgeQuerier, storage db.AggSenderStorage, l1InfoTreeDataQuerier types.L1InfoTreeDataQuerier, cfg BaseFlowConfig, ) *baseFlow
NewBaseFlow creates a new instance of the base flow
func NewFlow ¶ added in v0.4.0
func NewFlow( ctx context.Context, cfg config.Config, logger *log.Logger, storage db.AggSenderStorage, l1Client types.EthClient, l2Client types.EthClient, l1InfoTreeSyncer types.L1InfoTreeSyncer, l2Syncer types.L2BridgeSyncer, ) (types.AggsenderFlow, error)
NewFlow creates a new Aggsender flow based on the provided configuration.
Types ¶
type AggchainProverFlow ¶
type AggchainProverFlow struct {
// contains filtered or unexported fields
}
AggchainProverFlow is a struct that holds the logic for the AggchainProver prover type flow
func NewAggchainProverFlow ¶
func NewAggchainProverFlow( log types.Logger, baseFlow types.AggsenderFlowBaser, aggChainProverConfig AggchainProverFlowConfig, aggkitProverClient types.AggchainProofClientInterface, storage db.AggSenderStorage, l1InfoTreeQuerier types.L1InfoTreeDataQuerier, l2BridgeQuerier types.BridgeQuerier, gerQuerier types.GERQuerier, l1Client types.EthClient, signer signertypes.Signer, optimisticModeQuerier types.OptimisticModeQuerier, optimisticSigner types.OptimisticSigner, ) *AggchainProverFlow
NewAggchainProverFlow returns a new instance of the AggchainProverFlow injecting baseFlow instead of creating it
func (*AggchainProverFlow) BuildCertificate ¶
func (a *AggchainProverFlow) BuildCertificate(ctx context.Context, buildParams *types.CertificateBuildParams) (*agglayertypes.Certificate, error)
BuildCertificate builds a certificate based on the buildParams this function is the implementation of the FlowManager interface
func (*AggchainProverFlow) CheckInitialStatus ¶
func (a *AggchainProverFlow) CheckInitialStatus(ctx context.Context) error
CheckInitialStatus checks that initial status is correct. For AggchainProverFlow checks that starting block and last certificate match
func (*AggchainProverFlow) GenerateAggchainProof ¶
func (a *AggchainProverFlow) GenerateAggchainProof( ctx context.Context, lastProvenBlock, toBlock uint64, certBuildParams *types.CertificateBuildParams, ) (*types.AggchainProof, *treetypes.Root, error)
GenerateAggchainProof calls the aggkit prover to generate the aggchain proof for the given block range
func (*AggchainProverFlow) GetCertificateBuildParams ¶
func (a *AggchainProverFlow) GetCertificateBuildParams(ctx context.Context) (*types.CertificateBuildParams, error)
GetCertificateBuildParams returns the parameters to build a certificate this function is the implementation of the FlowManager interface What differentiates this function from the regular PP flow is that, if the last sent certificate is in error, we need to resend the exact same certificate also, it calls the aggchain prover to get the aggchain proof
type AggchainProverFlowConfig ¶ added in v0.4.0
type AggchainProverFlowConfig struct {
// contains filtered or unexported fields
}
AggchainProverFlowConfig holds the configuration for the AggchainProverFlow
func NewAggchainProverFlowConfig ¶ added in v0.4.0
func NewAggchainProverFlowConfig( requireNoFEPBlockGap bool, ) AggchainProverFlowConfig
NewAggchainProverFlowConfig creates a new AggchainProverFlowConfig with the given base flow config
func NewAggchainProverFlowConfigDefault ¶ added in v0.4.0
func NewAggchainProverFlowConfigDefault() AggchainProverFlowConfig
NewAggchainProverFlowConfigDefault returns a default configuration for the AggchainProverFlow
type BaseFlowConfig ¶ added in v0.4.0
type BaseFlowConfig struct {
// MaxCertSize is the maximum size of the certificate in bytes. 0 means no limit
MaxCertSize uint
// StartL2Block is the L2 block number from which to start sending certificates.
// It is used to determine the first block to include in the certificate.
// It can be 0
StartL2Block uint64
}
BaseFlowConfig is a struct that holds the configuration for the base flow
func NewBaseFlowConfig ¶ added in v0.4.0
func NewBaseFlowConfig(maxCertSize uint, startL2Block uint64) BaseFlowConfig
// NewBaseFlowConfig returns a BaseFlowConfig with the specified maxCertSize and startL2Block
func NewBaseFlowConfigDefault ¶ added in v0.4.0
func NewBaseFlowConfigDefault() BaseFlowConfig
NewBaseFlowConfigDefault returns a BaseFlowConfig with default values
type PPFlow ¶
type PPFlow struct {
// contains filtered or unexported fields
}
PPFlow is a struct that holds the logic for the regular pessimistic proof flow
func NewPPFlow ¶
func NewPPFlow(log types.Logger, baseFlow types.AggsenderFlowBaser, storage db.AggSenderStorage, l1InfoTreeQuerier types.L1InfoTreeDataQuerier, l2BridgeQuerier types.BridgeQuerier, signer signertypes.Signer) *PPFlow
NewPPFlow returns a new instance of the PPFlow
func (*PPFlow) BuildCertificate ¶
func (p *PPFlow) BuildCertificate(ctx context.Context, buildParams *types.CertificateBuildParams) (*agglayertypes.Certificate, error)
BuildCertificate builds a certificate based on the buildParams this function is the implementation of the FlowManager interface
func (*PPFlow) CheckInitialStatus ¶
CheckInitialStatus checks that initial status is correct. For PPFlow there are no special checks to do, so it just returns nil
func (*PPFlow) GetCertificateBuildParams ¶
func (p *PPFlow) GetCertificateBuildParams(ctx context.Context) (*types.CertificateBuildParams, error)
GetCertificateBuildParams returns the parameters to build a certificate this function is the implementation of the FlowManager interface