Skip to content

Commit

Permalink
feat: remove syncers and import the aggkit (#256)
Browse files Browse the repository at this point in the history
* feat: remove `aggoracle` component (#251)

* remove aggoracle component

* improve Rust build perf and cleanup

* handle error when unmarashaling versions.json

* feat: remove `aggsender` component (#252)

* remove aggsender component

* fix: remove build-tools

* feat: mockery generate (#255)

* mockery generate

* Update .mockery.yaml

Co-authored-by: Stefan Negovanović <93934272+Stefan-Ethernal@users.noreply.github.com>

* review comments

* review comment

---------

Co-authored-by: Stefan Negovanović <93934272+Stefan-Ethernal@users.noreply.github.com>

* wip

* feat: fix BuildVersions during cargo build (#258)

* fix DAC imports

* remove unused code

* chore: remove empty docker-compose.yml

* fix build.rs

* remove hex package

* remove log package

* remove db package

* go mod tidy and fix in the proof

* chore: remove redundant file

* feat: remove bridge service (feat. claim sponsor, bridgesync, reorg detector l2 and corresponding config params)

* chore: format and fix docs

* chore: move bats e2e tests from fep folder

* fix: path for batch_verification_monitor script

---------

Co-authored-by: Stefan Negovanović <93934272+Stefan-Ethernal@users.noreply.github.com>
Co-authored-by: Arpit Temani <temaniarpit27@gmail.com>
Co-authored-by: Toni Ramírez <58293609+ToniRamirezM@users.noreply.github.com>
Co-authored-by: Stefan Negovanović <stefan@ethernal.tech>
  • Loading branch information
5 people committed Feb 18, 2025
1 parent f7ed61b commit bad184a
Show file tree
Hide file tree
Showing 210 changed files with 194 additions and 21,702 deletions.
63 changes: 0 additions & 63 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,49 +39,11 @@ packages:
AggregatorService_ChannelServer:
config:
mockname: ChannelMock
github.com/0xPolygon/cdk/bridgesync:
config:
dir: "{{ .InterfaceDir }}/mocks"
interfaces:
ReorgDetector:
EthClienter:
github.com/0xPolygon/cdk/dataavailability:
config:
dir: "{{ .InterfaceDir }}/mocks_da"
all: true
outpkg: "mocks_da"
github.com/0xPolygon/cdk/db:
config:
dir: "{{ .InterfaceDir }}/../aggregator/mocks"
mockname: "{{ .InterfaceName }}Mock"
interfaces:
Txer:
github.com/0xPolygon/cdk/l1infotreesync:
config:
dir: "{{ .InterfaceDir }}/mocks"
interfaces:
EthClienter:
github.com/0xPolygon/cdk/reorgdetector:
config:
dir: "{{ .InterfaceDir }}"
outpkg: "{{ .PackageName }}"
mockname: "{{ .InterfaceName }}Mock"
interfaces:
EthClient:
github.com/0xPolygon/cdk/rpc/client:
config:
interfaces:
BridgeClientInterface:
ClientInterface:
ClientFactoryInterface:
github.com/0xPolygon/cdk/rpc:
config:
dir: "{{ .InterfaceDir }}/mocks"
interfaces:
Bridger:
LastGERer:
L1InfoTreer:
ClaimSponsorer:
github.com/0xPolygon/cdk/sequencesender:
config:
dir: "{{ .InterfaceDir }}/mocks"
Expand Down Expand Up @@ -111,28 +73,3 @@ packages:
- dir: "{{ .InterfaceDir }}/mocks_txbuilder"
outpkg: "mocks_txbuilder"
mockname: "{{ .InterfaceName | camelcase | firstUpper }}"
github.com/0xPolygon/cdk/sync:
config:
dir: "{{ .InterfaceDir }}"
outpkg: "{{ .PackageName }}"
mockname: "{{ .InterfaceName }}Mock"
inpackage: true
interfaces:
ReorgDetector:
configs:
- dir: "{{ .InterfaceDir }}/../l1infotreesync/mocks"
outpkg: "mocks"
mockname: "{{ .InterfaceName }}Mock"
inpackage: false
- dir: "{{ .InterfaceDir }}"
outpkg: "{{ .PackageName }}"
mockname: "{{ .InterfaceName }}Mock"
processorInterface:
config:
mockname: "ProcessorMock"
evmDownloaderFull:
config:
mockname: "EVMDownloaderMock"
EthClienter:
config:
mockname: "L2Mock"
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ check-docker:
check-docker-compose:
@which docker-compose > /dev/null || (echo "Error: docker-compose is not installed" && exit 1)

# Check for Protoc
# Check for protoc
.PHONY: check-protoc
check-protoc:
@which protoc > /dev/null || (echo "Error: Protoc is not installed" && exit 1)
@which protoc > /dev/null || (echo "Error: protoc is not installed" && exit 1)

# Check for Curl
# Check for curl
.PHONY: check-curl
check-curl:
@which curl > /dev/null || (echo "Error: curl is not installed" && exit 1)
Expand Down
2 changes: 1 addition & 1 deletion agglayer/mock_agglayer_client_interface.go

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

4 changes: 2 additions & 2 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
"github.com/0xPolygon/cdk/aggregator/prover"
cdkcommon "github.com/0xPolygon/cdk/common"
"github.com/0xPolygon/cdk/config/types"
"github.com/0xPolygon/cdk/l1infotree"
"github.com/0xPolygon/cdk/log"
"github.com/0xPolygon/cdk/rpc"
"github.com/0xPolygon/cdk/state"
"github.com/0xPolygon/zkevm-ethtx-manager/ethtxmanager"
Expand All @@ -33,6 +31,8 @@ import (
"github.com/0xPolygonHermez/zkevm-synchronizer-l1/state/entities"
"github.com/0xPolygonHermez/zkevm-synchronizer-l1/synchronizer"
"github.com/0xPolygonHermez/zkevm-synchronizer-l1/synchronizer/l1_check_block"
"github.com/agglayer/aggkit/l1infotree"
"github.com/agglayer/aggkit/log"
"github.com/ethereum/go-ethereum/common"
"go.uber.org/zap/zapcore"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
mocks "github.com/0xPolygon/cdk/aggregator/mocks"
"github.com/0xPolygon/cdk/aggregator/prover"
"github.com/0xPolygon/cdk/config/types"
"github.com/0xPolygon/cdk/log"
rpctypes "github.com/0xPolygon/cdk/rpc/types"
"github.com/0xPolygon/cdk/state"
"github.com/0xPolygonHermez/zkevm-synchronizer-l1/synchronizer"
"github.com/agglayer/aggkit/log"
"github.com/ethereum/go-ethereum/common"
ethTypes "github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"math/big"

"github.com/0xPolygon/cdk/config/types"
"github.com/0xPolygon/cdk/log"
"github.com/0xPolygon/zkevm-ethtx-manager/ethtxmanager"
syncronizerConfig "github.com/0xPolygonHermez/zkevm-synchronizer-l1/config"
"github.com/agglayer/aggkit/log"
)

// SettlementBackend is the type of the settlement backend
Expand Down
2 changes: 1 addition & 1 deletion aggregator/db/dbstorage/dbstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"database/sql"

"github.com/0xPolygon/cdk/db"
"github.com/agglayer/aggkit/db"
)

// DBStorage implements the Storage interface
Expand Down
4 changes: 2 additions & 2 deletions aggregator/db/dbstorage/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"fmt"
"time"

"github.com/0xPolygon/cdk/db"
"github.com/0xPolygon/cdk/state"
"github.com/agglayer/aggkit/db"
)

// CheckProofExistsForBatch checks if the batch is already included in any proof
Expand Down Expand Up @@ -170,7 +170,7 @@ func (d *DBStorage) GetProofsToAggregate(ctx context.Context, dbTx db.Txer) (*st
&createdAt1, &updatedAt1,
&proof2.BatchNumber, &proof2.BatchNumberFinal, &proof2.Proof, &proof2.ProofID,
&proof2.InputProver, &proof2.Prover, &proof2.ProverID, &generatingSince2,
&createdAt1, &updatedAt1,
&createdAt2, &updatedAt2,
)

if generatingSince1 != nil {
Expand Down
2 changes: 1 addition & 1 deletion aggregator/db/dbstorage/sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package dbstorage
import (
"context"

"github.com/0xPolygon/cdk/db"
"github.com/0xPolygon/cdk/state"
"github.com/agglayer/aggkit/db"
)

// AddSequence stores the sequence information to allow the aggregator verify sequences.
Expand Down
2 changes: 1 addition & 1 deletion aggregator/db/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/0xPolygon/cdk/log"
"github.com/agglayer/aggkit/log"
"github.com/jackc/pgx/v4"
)

Expand Down
4 changes: 2 additions & 2 deletions aggregator/db/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"embed"
"fmt"

"github.com/0xPolygon/cdk/db"
"github.com/0xPolygon/cdk/log"
"github.com/agglayer/aggkit/db"
"github.com/agglayer/aggkit/log"
migrate "github.com/rubenv/sql-migrate"
)

Expand Down
2 changes: 1 addition & 1 deletion aggregator/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (

ethmanTypes "github.com/0xPolygon/cdk/aggregator/ethmantypes"
"github.com/0xPolygon/cdk/aggregator/prover"
"github.com/0xPolygon/cdk/db"
"github.com/0xPolygon/cdk/rpc/types"
"github.com/0xPolygon/cdk/state"
"github.com/0xPolygon/zkevm-ethtx-manager/ethtxmanager"
ethtxtypes "github.com/0xPolygon/zkevm-ethtx-manager/types"
"github.com/agglayer/aggkit/db"
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto/kzg4844"
Expand Down
2 changes: 1 addition & 1 deletion aggregator/mocks/mock_eth_tx_manager_client.go

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

2 changes: 1 addition & 1 deletion aggregator/mocks/mock_etherman.go

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

2 changes: 1 addition & 1 deletion aggregator/mocks/mock_prover_interface.go

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

2 changes: 1 addition & 1 deletion aggregator/mocks/mock_rpc_interface.go

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

4 changes: 2 additions & 2 deletions aggregator/mocks/mock_storage_interface.go

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

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

2 changes: 1 addition & 1 deletion aggregator/prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"time"

"github.com/0xPolygon/cdk/config/types"
"github.com/0xPolygon/cdk/log"
"github.com/agglayer/aggkit/log"
"github.com/ethereum/go-ethereum/common"
"github.com/iden3/go-iden3-crypto/poseidon"
)
Expand Down
2 changes: 1 addition & 1 deletion aggregator/prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/0xPolygon/cdk/aggregator/prover"
"github.com/0xPolygon/cdk/aggregator/prover/mocks"
"github.com/0xPolygon/cdk/config/types"
"github.com/0xPolygon/cdk/log"
"github.com/agglayer/aggkit/log"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
Expand Down
Loading

0 comments on commit bad184a

Please sign in to comment.