query

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0, MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoProofBuiltYet = &grpc.GRPCError{
	Code:    codes.Unavailable,
	Message: "Proposer service has not built any proof yet",
}

Functions

func GetTrustedSignerAddr added in v0.7.0

func GetTrustedSignerAddr(aggchainFEPContract types.FEPContractQuerier) (common.Address, error)

GetTrustedSignerAddr retrieves the trusted signer address from the AggchainFEP contract

func NewAggchainFEPQuerier added in v0.7.0

func NewAggchainFEPQuerier(
	logger *log.Logger,
	aggsenderMode types.AggsenderMode,
	aggchainFEPAddr common.Address,
	l1Client aggkittypes.BaseEthereumClienter) (types.AggchainFEPRollupQuerier, error)

NewAggchainFEPQuerier creates a new AggchainFEP querier instance for interacting with the AggchainFEP contract.

The function handles two scenarios: 1. If aggchainFEPAddr is the zero address, it returns a no-op querier for PP networks without AggchainFEP contract 2. If a valid address is provided, it creates a real querier that connects to the AggchainFEP contract

Parameters:

  • logger: Logger instance for recording operations and errors
  • aggchainFEPAddr: The Ethereum address of the AggchainFEP contract
  • l1Client: Ethereum client interface for L1 blockchain interactions

Returns:

  • types.AggchainFEPQuerier: Either a no-op or real querier implementation
  • error: Any error encountered during contract initialization or starting block number retrieval

The function will fail if:

  • The AggchainFEP contract caller cannot be created
  • The starting block number cannot be retrieved from the contract

func NewAggchainProofQuery added in v0.7.0

func NewAggchainProofQuery(
	log types.Logger,
	aggchainproofclient types.AggchainProofClientInterface,
	l1InfoTreeDataQuerier types.L1InfoTreeDataQuerier,
	optimisticSigner types.OptimisticSigner,
	lerQuerier types.LocalExitRootQuery,
	gerQuerier types.GERQuerier,
	bridgeQuerier types.BridgeQuerier,
) *aggchainProofQuery

NewAggchainProofQuery creates a new instance of aggchainProofQuery with the provided dependencies.

func NewBridgeDataQuerier

func NewBridgeDataQuerier(
	log types.Logger,
	bridgeSyncer types.L2BridgeSyncer,
	delayBetweenRetries time.Duration,
	agglayerBridgeL2Reader types.AgglayerBridgeL2Reader,
) *bridgeDataQuerier

NewBridgeDataQuerier returns a new instance of the BridgeDataQuerier

func NewCertificateQuerier added in v0.7.0

func NewCertificateQuerier(
	bridgeSyncer types.L2BridgeSyncer,
	aggchainFEPQuerier types.AggchainFEPRollupQuerier,
	agglayerClient agglayer.AgglayerClientInterface,
) types.CertificateQuerier

func NewFEPInputsQuery added in v0.8.0

func NewFEPInputsQuery(
	aggchainFEPContract types.FEPContractQuerier,
	aggchainFEPAddr common.Address,
	opNodeClient types.OpNodeClienter,
) types.FEPInputsQuerier

NewFEPInputsQuery creates a new instance of FEPInputsQuery

func NewGERDataQuerier

func NewGERDataQuerier(
	l1InfoTreeQuerier types.L1InfoTreeDataQuerier,
	chainGERReader types.ChainGERReader) types.GERQuerier

NewGERDataQuerier returns a new instance of the GERQuerier

func NewLERDataQuerier added in v0.5.0

func NewLERDataQuerier(
	l1GenesisBlock uint64,
	rollupDataQuerier types.RollupDataQuerier) types.LERQuerier

NewLERDataQuerier creates a new instance of LERQuerier for querying Layer 1 Ethereum Rollup data. It initializes the RollupManager contract using the provided address and Ethereum client.

Parameters:

  • l1GenesisBlock: The block number of the Layer 1 genesis block.
  • l1Client: An implementation of BaseEthereumClienter for interacting with the Ethereum network.

Returns:

  • types.LERQuerier: An initialized LERQuerier for querying rollup data.

Types

type AggProofPublicValuesQuery added in v0.7.0

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

AggProofPublicValuesQuery implements AggProofPublicValuesQuerier

func NewAggProofPublicValuesQuery added in v0.7.0

func NewAggProofPublicValuesQuery(
	aggchainFEPContract types.FEPContractQuerier,
	aggchainFEPAddr common.Address,
	opNodeClient types.OpNodeClienter,
	proverAddress common.Address,
) *AggProofPublicValuesQuery

NewAggProofPublicValuesQuery creates a new instance of AggProofPublicValuesQuery

func (*AggProofPublicValuesQuery) GetAggregationProofPublicValuesData added in v0.7.0

func (a *AggProofPublicValuesQuery) GetAggregationProofPublicValuesData(
	lastProvenBlock, requestedEndBlock uint64,
	l1InfoTreeLeafHash common.Hash) (*types.AggregationProofPublicValues, error)

GetAggregationProofPublicValuesData retrieves the AggregationProofPublicValue required for the aggchain proof

type BaseMultisigCommitteeQuery added in v0.7.0

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

func NewBaseMultisigCommitteeQuery added in v0.7.0

func NewBaseMultisigCommitteeQuery(sovereignRollupAddr common.Address,
	l1Client aggkittypes.BaseEthereumClienter,
	overrideURL *CommitteeOverride) (*BaseMultisigCommitteeQuery, error)

NewBaseMultisigCommitteeQuery creates a new instance of BaseMultisigCommitteeQuery

func (*BaseMultisigCommitteeQuery) ContractMode added in v0.7.0

func (m *BaseMultisigCommitteeQuery) ContractMode() (types.AggsenderMode, error)

ContractMode returns the mode of the multisig contract (PP or FEP)

func (*BaseMultisigCommitteeQuery) GetMultisigCommittee added in v0.7.0

func (m *BaseMultisigCommitteeQuery) GetMultisigCommittee(
	ctx context.Context, blockNum *big.Int) (*types.MultisigCommittee, error)

GetMultisigCommittee reads the multisig committee from the smart contract for a certain block

func (*BaseMultisigCommitteeQuery) ResolveAutoMode added in v0.7.0

func (m *BaseMultisigCommitteeQuery) ResolveAutoMode(cfgMode types.AggsenderMode) (types.AggsenderMode, error)

type CommitteeOverride added in v0.7.0

type CommitteeOverride struct {
	// oldURL -> newURL
	URLMapping map[string]string
}

CommitteeOverride is used to override the URLs of the committee members

func (*CommitteeOverride) ReplaceURL added in v0.7.0

ReplaceURL replaces the URLs of the committee members with the ones in the override map

func (*CommitteeOverride) String added in v0.7.0

func (c *CommitteeOverride) String() string

type FEPInputsQuery added in v0.8.0

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

func (*FEPInputsQuery) GetAggchainParams added in v0.8.0

func (f *FEPInputsQuery) GetAggchainParams(
	lastProvenBlock, requestedEndBlock uint64,
	l1InfoTreeLeafHash common.Hash) (*types.AggchainParams, error)

GetAggchainParams generates the aggchain parameters required for the verification of aggchain proof

func (*FEPInputsQuery) GetPublicInputs added in v0.8.0

func (f *FEPInputsQuery) GetPublicInputs(
	lastProvenBlock, requestedEndBlock uint64,
	l1InfoTreeLeafHash common.Hash) (*types.AggregationProofPublicValues, error)

GetPublicInputs retrieves the public inputs required for the verification of aggchain proof

type L1InfoTreeDataQuerier

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

L1InfoTreeDataQuerier is a struct that holds the logic to query the L1 Info tree data

func NewL1InfoTreeDataQuerier

func NewL1InfoTreeDataQuerier(
	l1Client aggkittypes.BaseEthereumClienter,
	l1GERAddr common.Address,
	l1InfoTreeSyncer types.L1InfoTreeSyncer) (*L1InfoTreeDataQuerier, error)

NewL1InfoTreeDataQuerier returns a new instance of the L1InfoTreeDataQuery

func (*L1InfoTreeDataQuerier) DoesGERExistsOnL1 added in v0.8.0

func (l *L1InfoTreeDataQuerier) DoesGERExistsOnL1(
	ger common.Hash,
) (bool, error)

func (*L1InfoTreeDataQuerier) GetFinalizedL1InfoTreeData

func (l *L1InfoTreeDataQuerier) GetFinalizedL1InfoTreeData(
	ctx context.Context,
	finalizedL1InfoTreeRootHash common.Hash,
	finalizedL1InfoTreeLeafCount uint32,
) (treetypes.Proof, *l1infotreesync.L1InfoTreeLeaf, error)

GetFinalizedL1InfoTreeData retrieves the L1 info tree leaf and its merkle proof for a finalized L1 info tree state. It takes the finalized L1 info tree root hash and leaf count to fetch the last leaf in the tree and generate a merkle proof from that leaf to the specified root hash.

Parameters:

  • ctx: Context for cancellation and timeouts
  • finalizedL1InfoTreeRootHash: The root hash of the finalized L1 info tree
  • finalizedL1InfoTreeLeafCount: The total number of leaves in the finalized L1 info tree

Returns:

  • treetypes.Proof: The merkle proof from the leaf to the root
  • *l1infotreesync.L1InfoTreeLeaf: The last leaf in the finalized tree
  • error: Any error that occurred during the operation

func (*L1InfoTreeDataQuerier) GetInfoByIndex added in v0.7.0

func (l *L1InfoTreeDataQuerier) GetInfoByIndex(
	ctx context.Context, index uint32) (*l1infotreesync.L1InfoTreeLeaf, error)

GetInfoByIndex returns the L1 Info tree leaf for the given index

func (*L1InfoTreeDataQuerier) GetL1InfoRootByLeafIndex added in v0.7.0

func (l *L1InfoTreeDataQuerier) GetL1InfoRootByLeafIndex(ctx context.Context,
	leafIndex uint32) (*treetypes.Root, error)

GetL1InfoRootByLeafIndex returns the L1 Info tree root tha corresponds to the given leaf index

func (*L1InfoTreeDataQuerier) GetLatestFinalizedL1InfoRoot

func (l *L1InfoTreeDataQuerier) GetLatestFinalizedL1InfoRoot(ctx context.Context) (
	*treetypes.Root, *l1infotreesync.L1InfoTreeLeaf, error)

GetLatestFinalizedL1InfoRoot returns the latest processed l1 info tree root based on the latest finalized l1 block

func (*L1InfoTreeDataQuerier) GetProofForGER

func (l *L1InfoTreeDataQuerier) GetProofForGER(
	ctx context.Context, ger, rootFromWhichToProve common.Hash) (
	*l1infotreesync.L1InfoTreeLeaf, treetypes.Proof, error)

GetProofForGER returns the L1 Info tree leaf and the merkle proof for the given GER

func (*L1InfoTreeDataQuerier) IsGERFinalized added in v0.8.0

func (l *L1InfoTreeDataQuerier) IsGERFinalized(
	ger common.Hash,
	finalizedL1InfoLeafCount uint32) (bool, error)

IsGERFinalized checks if the given global exit root is finalized

Jump to

Keyboard shortcuts

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