optimistic

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0, MIT Imports: 14 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

func (Config) Validate added in v0.7.0

func (c Config) Validate() error

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,
	aggchainFEPContract types.FEPContractQuerier,
	chainID uint64,
	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