Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions aggsender/aggsender.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@
return nil, fmt.Errorf("error creating verifier flow: %w", err)
}

l1GERQuerier, err := query.NewL1GERDataQuerier(
cfg.GlobalExitRootL1Addr, aggkittypes.LatestBlock, l1Client, // TODO configurable finality

Check warning on line 186 in aggsender/aggsender.go

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this TODO comment.

See more on https://sonarcloud.io/project/issues?id=agglayer_aggkit&issues=AZqh51DYBKDjml9YAYJ7&open=AZqh51DYBKDjml9YAYJ7&pullRequest=1317
)
if err != nil {
return nil, fmt.Errorf("error creating L1GER data querier: %w", err)
}

localValidator := validator.NewLocalValidator(
logger,
storage,
Expand All @@ -191,6 +198,7 @@
query.NewL1InfoTreeDataQuerier(l1Client, l1InfoTreeSyncer),
certQuerier,
query.NewLERDataQuerier(cfg.RollupCreationBlockL1, rollupDataQuerier),
l1GERQuerier,
),
)

Expand Down
11 changes: 9 additions & 2 deletions aggsender/aggsender_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
aggkitcommon "github.com/agglayer/aggkit/common"
"github.com/agglayer/aggkit/grpc"
signertypes "github.com/agglayer/go_signer/signer/types"
"github.com/ethereum/go-ethereum/common"
)

var (
Expand All @@ -29,14 +30,15 @@ func NewAggsenderValidator(ctx context.Context,
logger aggkitcommon.Logger,
cfg validator.Config,
flow types.AggsenderVerifierFlow,
l1InfoTreeDataQuerier validator.L1InfoTreeRootByLeafQuerier,
l1InfoTreeDataQuerier types.L1InfoTreeDataQuerier,
aggLayerClient agglayer.AggLayerClientCertificateIDQuerier,
certQuerier types.CertificateQuerier,
aggchainFEPQuerier types.AggchainFEPRollupQuerier,
lerQuerier types.LERQuerier,
l1GERQuerier types.L1GERQuerier,
signer signertypes.Signer) (*AggsenderValidator, error) {
validatorCert := validator.NewAggsenderValidator(
logger, flow, l1InfoTreeDataQuerier, certQuerier, lerQuerier)
logger, flow, l1InfoTreeDataQuerier, certQuerier, lerQuerier, l1GERQuerier)
grpcServer, err := grpc.NewServer(cfg.ServerConfig)
if err != nil {
return nil, err
Expand All @@ -63,3 +65,8 @@ func (a *AggsenderValidator) Start(ctx context.Context) {
func (a *AggsenderValidator) ValidateCertificate(ctx context.Context, params types.VerifyIncomingRequest) error {
return a.validator.ValidateCertificate(ctx, params)
}

// ValidateGER validates the GlobalExitRoot that needs to be injected.
func (a *AggsenderValidator) ValidateGER(ctx context.Context, ger common.Hash) error {
return a.validator.ValidateGER(ctx, ger)
}
2 changes: 2 additions & 0 deletions aggsender/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ type Config struct {
// GlobalExitRootL2Addr is the address of the GlobalExitRootManager contract on l2 sovereign chain
// this address is needed for the AggchainProof mode of the AggSender
GlobalExitRootL2Addr ethCommon.Address `mapstructure:"GlobalExitRootL2"`
// GlobalExitRootL1Addr is the address of the GlobalExitRootManager contract on l1 chain
GlobalExitRootL1Addr ethCommon.Address `mapstructure:"GlobalExitRootL1"`
// SovereignRollupAddr is the address of the sovereign rollup contract on L1
SovereignRollupAddr ethCommon.Address `mapstructure:"SovereignRollupAddr"`
// RequireStorageContentCompatibility is true it's mandatory that data stored in the database
Expand Down
2 changes: 1 addition & 1 deletion aggsender/flows/builder_flow_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func NewBuilderFlow(
commonFlowComponents.L1InfoTreeDataQuerier,
optimisticSigner,
commonFlowComponents.BaseFlow,
query.NewGERDataQuerier(commonFlowComponents.L1InfoTreeDataQuerier, l2GERReader),
query.NewL2GERDataQuerier(commonFlowComponents.L1InfoTreeDataQuerier, l2GERReader),
commonFlowComponents.L2BridgeQuerier,
)

Expand Down
96 changes: 96 additions & 0 deletions aggsender/mocks/mock_agglayer_ger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions aggsender/mocks/mock_certificate_validate_and_signer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 51 additions & 1 deletion aggsender/mocks/mock_certificate_validator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading