Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOptimistic ¶
func NewOptimistic(ctx context.Context, logger *log.Logger, l1Client aggkittypes.BaseEthereumClienter, chainID uint64, 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 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.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.