flows

package
v0.3.0-beta3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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,
	maxCertSize uint,
	bridgeMetaDataAsHash bool,
	gerL2Address common.Address,
	sovereignRollupAddr common.Address,
	aggkitProverClient grpc.AggchainProofClientInterface,
	storage db.AggSenderStorage,
	l1InfoTreeSyncer types.L1InfoTreeSyncer,
	l2Syncer types.L2BridgeSyncer,
	l1Client types.EthClient,
	l2Client types.EthClient,
	requireNoFEPBlockGap bool) (*AggchainProverFlow, error)

NewAggchainProverFlow returns a new instance of the AggchainProverFlow

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,
	claims []bridgesync.Claim,
) (*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 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,
	maxCertSize uint,
	bridgeMetaDataAsHash bool,
	storage db.AggSenderStorage,
	l1InfoTreeSyncer types.L1InfoTreeSyncer,
	l2Syncer types.L2BridgeSyncer,
	l1Client types.EthClient,
	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

func (p *PPFlow) CheckInitialStatus(ctx context.Context) error

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

Jump to

Keyboard shortcuts

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