Documentation
¶
Index ¶
- func NewOptimistic(ctx context.Context, logger *log.Logger, ...) (*OptimisticSignatureCalculatorImpl, *OptimisticModeQuerierFromContract, error)
- type Config
- type FEPContractQuerier
- type OpNodeClienter
- type OptimisticAggregationProofPublicValuesQuerier
- type OptimisticAggregationProofPublicValuesQuery
- type OptimisticModeQuerierFromContract
- type OptimisticSignatureCalculatorImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOptimistic ¶
func NewOptimistic(ctx context.Context, logger *log.Logger, l1Client aggkittypes.BaseEthereumClienter, cfg Config) (*OptimisticSignatureCalculatorImpl, *OptimisticModeQuerierFromContract, error)
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 ¶
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.