optimistic

package
v0.6.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOptimistic

NewOptimistic creates a new instance of OptimisticSignatureCalculatorImpl and OptimisticModeQuerierFromContract.

Types

type Config

type Config struct {
	// SovereignRollupAddr is the L1 address of the AggchainFEP contract.
	SovereignRollupAddr ethCommon.Address `mapstructure:"SovereignRollupAddr"`
	// TrustedSequencerKey is the private key used to sign the optimistic proofs, must be trustedSequencer.
	TrustedSequencerKey signertypes.SignerConfig `mapstructure:"TrustedSequencerKey"`
	// OpNodeURL is the URL of the OpNode service used to fetch aggregation proof public value
	OpNodeURL string `mapstructure:"OpNodeURL"`
	// RequireKeyMatchTrustedSequencer Enable sanity check that the signer public key matches
	// the trusted sequencer address.
	// This is useful to ensure that the signer is the trusted sequencer, and not a random signer.
	RequireKeyMatchTrustedSequencer bool `mapstructure:"RequireKeyMatchTrustedSequencer"`
}

Config holds the configuration for the Optimistic Mode

type FEPContractQuerier

type FEPContractQuerier interface {
	RollupConfigHash(opts *bind.CallOpts) ([32]byte, error)
	RangeVkeyCommitment(opts *bind.CallOpts) ([32]byte, error)
	OptimisticMode(opts *bind.CallOpts) (bool, error)
}

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

type OpNodeClienter

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

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

type OptimisticAggregationProofPublicValuesQuerier

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

OptimisticAggregationProofPublicValuesQuerier defines an interface for querying aggregation proof public values in optimistic mode.

type OptimisticAggregationProofPublicValuesQuery

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

OptimisticAggregationProofPublicValuesQuery implements OptimisticAggregationProofPublicValuesQuerier

func NewOptimisticAggregationProofPublicValuesQuery

func NewOptimisticAggregationProofPublicValuesQuery(
	aggchainFEPContract FEPContractQuerier,
	aggchainFEPAddr common.Address,
	opNodeClient OpNodeClienter,
	proverAddress common.Address,
) *OptimisticAggregationProofPublicValuesQuery

NewOptimisticAggregationProofPublicValuesQuery creates a new instance of OptimisticAggregationProofPublicValuesQuery

func (*OptimisticAggregationProofPublicValuesQuery) GetAggregationProofPublicValuesData

func (o *OptimisticAggregationProofPublicValuesQuery) GetAggregationProofPublicValuesData(
	lastProvenBlock, requestedEndBlock uint64,
	l1InfoTreeLeafHash common.Hash) (*optimistichash.AggregationProofPublicValues, error)

GetAggregationProofPublicValuesData retrieves the AggregationProofPublicValue required for the optimistic aggregation proof

type OptimisticModeQuerierFromContract

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

func NewOptimisticModeQuerierFromContract

func NewOptimisticModeQuerierFromContract(aggchainFEPAddr common.Address,
	backend aggkittypes.BaseEthereumClienter) (*OptimisticModeQuerierFromContract, error)

func (*OptimisticModeQuerierFromContract) IsOptimisticModeOn

func (q *OptimisticModeQuerierFromContract) IsOptimisticModeOn() (bool, error)

type OptimisticSignatureCalculatorImpl

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

OptimisticSignatureCalculatorImpl implements the OptimisticSignatureCalculator interface.

func NewOptimisticSignatureCalculatorImpl

func NewOptimisticSignatureCalculatorImpl(
	ctx context.Context,
	logger *log.Logger,
	l1Client aggkittypes.BaseEthereumClienter,
	cfg Config,
) (*OptimisticSignatureCalculatorImpl, error)

NewOptimisticSignatureCalculatorImpl creates a new instance of OptimisticSignatureCalculatorImpl.

func (*OptimisticSignatureCalculatorImpl) Sign

func (o *OptimisticSignatureCalculatorImpl) Sign(ctx context.Context,
	aggchainReq types.AggchainProofRequest,
	newLocalExitRoot common.Hash,
	claims []bridgesync.Claim,
) ([]byte, string, error)

Sign calculate hash and sign it. It returns the signed hash, extra data for logging, and an error if any.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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