Skip to content

Commit

Permalink
Merge pull request #13 from 0xPolygon/cdk
Browse files Browse the repository at this point in the history
Rename to cdk
  • Loading branch information
arnaubennassar authored Aug 28, 2023
2 parents 29fc20d + 298a66f commit 53a4ff4
Show file tree
Hide file tree
Showing 269 changed files with 2,356 additions and 2,356 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-docker-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: |
hermeznetwork/supernets2-node:develop
hermeznetwork/cdk-validium-node:develop
2 changes: 1 addition & 1 deletion .github/workflows/push-docker-tagged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: |
hermeznetwork/supernets2-node:${{ github.ref_name }}
hermeznetwork/cdk-validium-node:${{ github.ref_name }}
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
go-version: [ 1.19.x ]
goarch: [ "amd64" ]
e2e-group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, supernets2-1 ]
e2e-group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, cdk-validium-1 ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
.env
out.dat

cmd/__debug_bin
**__debug_bin

.venv
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN cd /src && make build

# CONTAINER FOR RUNNING BINARY
FROM alpine:3.18.0
COPY --from=build /src/dist/supernets2-node /app/supernets2-node
COPY --from=build /src/dist/cdk-validium-node /app/cdk-validium-node
RUN apk update && apk add postgresql15-client
EXPOSE 8123
CMD ["/bin/sh", "-c", "/app/supernets2-node run"]
CMD ["/bin/sh", "-c", "/app/cdk-validium-node run"]
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ endif
GOBASE := $(shell pwd)
GOBIN := $(GOBASE)/dist
GOENVVARS := GOBIN=$(GOBIN) CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH)
GOBINARY := supernets2-node
GOBINARY := cdk-validium-node
GOCMD := $(GOBASE)/cmd

LDFLAGS += -X 'github.com/0xPolygonHermez/zkevm-node.Version=$(VERSION)'
LDFLAGS += -X 'github.com/0xPolygonHermez/zkevm-node.GitRev=$(GITREV)'
LDFLAGS += -X 'github.com/0xPolygonHermez/zkevm-node.GitBranch=$(GITBRANCH)'
LDFLAGS += -X 'github.com/0xPolygonHermez/zkevm-node.BuildDate=$(DATE)'
LDFLAGS += -X 'github.com/0xPolygon/cdk-validium-node.Version=$(VERSION)'
LDFLAGS += -X 'github.com/0xPolygon/cdk-validium-node.GitRev=$(GITREV)'
LDFLAGS += -X 'github.com/0xPolygon/cdk-validium-node.GitBranch=$(GITBRANCH)'
LDFLAGS += -X 'github.com/0xPolygon/cdk-validium-node.BuildDate=$(DATE)'

# Variables
VENV = .venv
Expand All @@ -35,11 +35,11 @@ build: ## Builds the binary locally into ./dist

.PHONY: build-docker
build-docker: ## Builds a docker image with the node binary
docker build -t supernets2-node -f ./Dockerfile .
docker build -t cdk-validium-node -f ./Dockerfile .

.PHONY: build-docker-nc
build-docker-nc: ## Builds a docker image with the node binary - but without build cache
docker build --no-cache=true -t supernets2-node -f ./Dockerfile .
docker build --no-cache=true -t cdk-validium-node -f ./Dockerfile .

.PHONY: install-linter
install-linter: ## Installs the linter
Expand Down
16 changes: 8 additions & 8 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
"time"
"unicode"

"github.com/0xPolygonHermez/zkevm-node/aggregator/metrics"
"github.com/0xPolygonHermez/zkevm-node/aggregator/prover"
"github.com/0xPolygonHermez/zkevm-node/config/types"
"github.com/0xPolygonHermez/zkevm-node/encoding"
ethmanTypes "github.com/0xPolygonHermez/zkevm-node/etherman/types"
"github.com/0xPolygonHermez/zkevm-node/ethtxmanager"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygon/cdk-validium-node/aggregator/metrics"
"github.com/0xPolygon/cdk-validium-node/aggregator/prover"
"github.com/0xPolygon/cdk-validium-node/config/types"
"github.com/0xPolygon/cdk-validium-node/encoding"
ethmanTypes "github.com/0xPolygon/cdk-validium-node/etherman/types"
"github.com/0xPolygon/cdk-validium-node/ethtxmanager"
"github.com/0xPolygon/cdk-validium-node/log"
"github.com/0xPolygon/cdk-validium-node/state"
"github.com/ethereum/go-ethereum/common"
"github.com/jackc/pgx/v4"
"google.golang.org/grpc"
Expand Down
14 changes: 7 additions & 7 deletions aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"testing"
"time"

"github.com/0xPolygonHermez/zkevm-node/aggregator/mocks"
"github.com/0xPolygonHermez/zkevm-node/aggregator/prover"
configTypes "github.com/0xPolygonHermez/zkevm-node/config/types"
ethmanTypes "github.com/0xPolygonHermez/zkevm-node/etherman/types"
"github.com/0xPolygonHermez/zkevm-node/ethtxmanager"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygonHermez/zkevm-node/test/testutils"
"github.com/0xPolygon/cdk-validium-node/aggregator/mocks"
"github.com/0xPolygon/cdk-validium-node/aggregator/prover"
configTypes "github.com/0xPolygon/cdk-validium-node/config/types"
ethmanTypes "github.com/0xPolygon/cdk-validium-node/etherman/types"
"github.com/0xPolygon/cdk-validium-node/ethtxmanager"
"github.com/0xPolygon/cdk-validium-node/state"
"github.com/0xPolygon/cdk-validium-node/test/testutils"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down
4 changes: 2 additions & 2 deletions aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"math/big"

"github.com/0xPolygonHermez/zkevm-node/config/types"
"github.com/0xPolygonHermez/zkevm-node/encoding"
"github.com/0xPolygon/cdk-validium-node/config/types"
"github.com/0xPolygon/cdk-validium-node/encoding"
)

// TokenAmountWithDecimals is a wrapper type that parses token amount with decimals to big int
Expand Down
8 changes: 4 additions & 4 deletions aggregator/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"context"
"math/big"

"github.com/0xPolygonHermez/zkevm-node/aggregator/prover"
ethmanTypes "github.com/0xPolygonHermez/zkevm-node/etherman/types"
"github.com/0xPolygonHermez/zkevm-node/ethtxmanager"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygon/cdk-validium-node/aggregator/prover"
ethmanTypes "github.com/0xPolygon/cdk-validium-node/etherman/types"
"github.com/0xPolygon/cdk-validium-node/ethtxmanager"
"github.com/0xPolygon/cdk-validium-node/state"
"github.com/ethereum/go-ethereum/common"
"github.com/jackc/pgx/v4"
)
Expand Down
2 changes: 1 addition & 1 deletion aggregator/metrics/metrics.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package metrics

import (
"github.com/0xPolygonHermez/zkevm-node/metrics"
"github.com/0xPolygon/cdk-validium-node/metrics"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
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_ethtxmanager.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.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_state.go

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

6 changes: 3 additions & 3 deletions aggregator/prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"net"
"time"

"github.com/0xPolygonHermez/zkevm-node/aggregator/metrics"
"github.com/0xPolygonHermez/zkevm-node/config/types"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygon/cdk-validium-node/aggregator/metrics"
"github.com/0xPolygon/cdk-validium-node/config/types"
"github.com/0xPolygon/cdk-validium-node/log"
)

var (
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions ci/e2e-group10/forced_batches_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (

"github.com/ethereum/go-ethereum/core/types"

"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/polygonzkevmglobalexitroot"
"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/supernets2"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygonHermez/zkevm-node/test/constants"
"github.com/0xPolygonHermez/zkevm-node/test/operations"
"github.com/0xPolygon/cdk-validium-node/etherman/smartcontracts/cdkvalidium"
"github.com/0xPolygon/cdk-validium-node/etherman/smartcontracts/polygonzkevmglobalexitroot"
"github.com/0xPolygon/cdk-validium-node/log"
"github.com/0xPolygon/cdk-validium-node/state"
"github.com/0xPolygon/cdk-validium-node/test/constants"
"github.com/0xPolygon/cdk-validium-node/test/operations"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -125,8 +125,8 @@ func sendForcedBatch(t *testing.T, txs []byte, opsman *operations.Manager) (*sta
require.NoError(t, err)

// Create smc client
zkEvmAddr := common.HexToAddress(operations.DefaultL1Supernets2SmartContract)
zkEvm, err := supernets2.NewSupernets2(zkEvmAddr, ethClient)
zkEvmAddr := common.HexToAddress(operations.DefaultL1CDKValidiumSmartContract)
zkEvm, err := cdkvalidium.NewCdkvalidium(zkEvmAddr, ethClient)
require.NoError(t, err)

auth, err := operations.GetAuth(operations.DefaultSequencerPrivateKey, operations.DefaultL1ChainID)
Expand Down
18 changes: 9 additions & 9 deletions ci/e2e-group10/forced_batches_vector_group2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"testing"
"time"

"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/supernets2"
"github.com/0xPolygonHermez/zkevm-node/hex"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygonHermez/zkevm-node/test/constants"
"github.com/0xPolygonHermez/zkevm-node/test/operations"
"github.com/0xPolygonHermez/zkevm-node/test/vectors"
"github.com/0xPolygon/cdk-validium-node/etherman/smartcontracts/cdkvalidium"
"github.com/0xPolygon/cdk-validium-node/hex"
"github.com/0xPolygon/cdk-validium-node/log"
"github.com/0xPolygon/cdk-validium-node/state"
"github.com/0xPolygon/cdk-validium-node/test/constants"
"github.com/0xPolygon/cdk-validium-node/test/operations"
"github.com/0xPolygon/cdk-validium-node/test/vectors"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -140,8 +140,8 @@ func sendForcedBatchForVector(t *testing.T, txs []byte, opsman *operations.Manag
require.NoError(t, err)

// Create smc client
zkEvmAddr := common.HexToAddress(operations.DefaultL1Supernets2SmartContract)
zkEvm, err := supernets2.NewSupernets2(zkEvmAddr, ethClient)
zkEvmAddr := common.HexToAddress(operations.DefaultL1CDKValidiumSmartContract)
zkEvm, err := cdkvalidium.NewCdkvalidium(zkEvmAddr, ethClient)
require.NoError(t, err)

auth, err := operations.GetAuth(operations.DefaultSequencerPrivateKey, operations.DefaultL1ChainID)
Expand Down
18 changes: 9 additions & 9 deletions ci/e2e-group11/forced_batches_vector_group3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"testing"
"time"

"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/supernets2"
"github.com/0xPolygonHermez/zkevm-node/hex"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygonHermez/zkevm-node/test/constants"
"github.com/0xPolygonHermez/zkevm-node/test/operations"
"github.com/0xPolygonHermez/zkevm-node/test/vectors"
"github.com/0xPolygon/cdk-validium-node/etherman/smartcontracts/cdkvalidium"
"github.com/0xPolygon/cdk-validium-node/hex"
"github.com/0xPolygon/cdk-validium-node/log"
"github.com/0xPolygon/cdk-validium-node/state"
"github.com/0xPolygon/cdk-validium-node/test/constants"
"github.com/0xPolygon/cdk-validium-node/test/operations"
"github.com/0xPolygon/cdk-validium-node/test/vectors"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -144,8 +144,8 @@ func sendForcedBatchForVector(t *testing.T, txs []byte, opsman *operations.Manag
require.NoError(t, err)

// Create smc client
zkEvmAddr := common.HexToAddress(operations.DefaultL1Supernets2SmartContract)
zkEvm, err := supernets2.NewSupernets2(zkEvmAddr, ethClient)
zkEvmAddr := common.HexToAddress(operations.DefaultL1CDKValidiumSmartContract)
zkEvm, err := cdkvalidium.NewCdkvalidium(zkEvmAddr, ethClient)
require.NoError(t, err)

auth, err := operations.GetAuth(operations.DefaultSequencerPrivateKey, operations.DefaultL1ChainID)
Expand Down
18 changes: 9 additions & 9 deletions ci/e2e-group9/forced_batches_vector_group1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"testing"
"time"

"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/supernets2"
"github.com/0xPolygonHermez/zkevm-node/hex"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygonHermez/zkevm-node/test/constants"
"github.com/0xPolygonHermez/zkevm-node/test/operations"
"github.com/0xPolygonHermez/zkevm-node/test/vectors"
"github.com/0xPolygon/cdk-validium-node/etherman/smartcontracts/cdkvalidium"
"github.com/0xPolygon/cdk-validium-node/hex"
"github.com/0xPolygon/cdk-validium-node/log"
"github.com/0xPolygon/cdk-validium-node/state"
"github.com/0xPolygon/cdk-validium-node/test/constants"
"github.com/0xPolygon/cdk-validium-node/test/operations"
"github.com/0xPolygon/cdk-validium-node/test/vectors"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -145,8 +145,8 @@ func sendForcedBatchForVector(t *testing.T, txs []byte, opsman *operations.Manag
require.NoError(t, err)

// Create smc client
zkEvmAddr := common.HexToAddress(operations.DefaultL1Supernets2SmartContract)
zkEvm, err := supernets2.NewSupernets2(zkEvmAddr, ethClient)
zkEvmAddr := common.HexToAddress(operations.DefaultL1CDKValidiumSmartContract)
zkEvm, err := cdkvalidium.NewCdkvalidium(zkEvmAddr, ethClient)
require.NoError(t, err)

auth, err := operations.GetAuth(operations.DefaultSequencerPrivateKey, operations.DefaultL1ChainID)
Expand Down
10 changes: 5 additions & 5 deletions cmd/approve.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"math/big"
"strings"

"github.com/0xPolygonHermez/zkevm-node/config"
"github.com/0xPolygonHermez/zkevm-node/encoding"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygon/cdk-validium-node/config"
"github.com/0xPolygon/cdk-validium-node/encoding"
"github.com/0xPolygon/cdk-validium-node/log"
"github.com/ethereum/go-ethereum/common"
"github.com/urfave/cli/v2"
)
Expand Down Expand Up @@ -37,7 +37,7 @@ func approveTokens(ctx *cli.Context) error {

if !ctx.Bool(config.FlagYes) {
fmt.Print("*WARNING* Are you sure you want to approve ", amount.String(),
" tokens (in wei) for the smc <Name: PoE. Address: "+c.NetworkConfig.L1Config.Supernets2Addr.String()+">? [y/N]: ")
" tokens (in wei) for the smc <Name: PoE. Address: "+c.NetworkConfig.L1Config.CDKValidiumAddr.String()+">? [y/N]: ")
var input string
if _, err := fmt.Scanln(&input); err != nil {
return err
Expand All @@ -64,7 +64,7 @@ func approveTokens(ctx *cli.Context) error {
return err
}

tx, err := etherman.ApproveMatic(ctx.Context, auth.From, amount, c.NetworkConfig.L1Config.Supernets2Addr)
tx, err := etherman.ApproveMatic(ctx.Context, auth.From, amount, c.NetworkConfig.L1Config.CDKValidiumAddr)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/dumpstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"os"
"strings"

"github.com/0xPolygonHermez/zkevm-node/config"
"github.com/0xPolygonHermez/zkevm-node/db"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/0xPolygon/cdk-validium-node/config"
"github.com/0xPolygon/cdk-validium-node/db"
"github.com/0xPolygon/cdk-validium-node/state"
"github.com/urfave/cli/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/jsonschema.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/0xPolygonHermez/zkevm-node/config"
"github.com/0xPolygon/cdk-validium-node/config"
"github.com/urfave/cli/v2"
)

Expand Down
Loading

0 comments on commit 53a4ff4

Please sign in to comment.