Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebranding to x1 #11

Merged
merged 8 commits into from
Nov 14, 2023
Merged
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ RUN cd /src && make build

# CONTAINER FOR RUNNING BINARY
FROM alpine:3.16.0
COPY --from=build /src/dist/xgon-data-availability /app/xgon-data-availability
COPY --from=build /src/dist/x1-data-availability /app/x1-data-availability
EXPOSE 8444
CMD ["/bin/sh", "-c", "/app/xgon-data-availability run"]
CMD ["/bin/sh", "-c", "/app/x1-data-availability run"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ GOBASE := $(shell pwd)
GOBIN := $(GOBASE)/dist
GOOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
GOENVVARS := GOBIN=$(GOBIN) CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(ARCH)
GOBINARY := xgon-data-availability
GOBINARY := x1-data-availability
GOCMD := $(GOBASE)/cmd

LDFLAGS += -X 'github.com/0xPolygon/cdk-data-availability.Version=$(VERSION)'
Expand All @@ -55,11 +55,11 @@ build: ## Builds the binary locally into ./dist

.PHONY: build-docker
build-docker: ## Builds a docker image with the node binary
docker build -t xgon-data-availability -f ./Dockerfile .
docker build -t x1-data-availability -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 xgon-data-availability -f ./Dockerfile .
docker build --no-cache=true -t x1-data-availability -f ./Dockerfile .

.PHONY: install-linter
install-linter: ## Installs the linter
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# Xgon Data Availability
### Data Availability Layer for Xgon Validium
# X1 Data Availability
### Data Availability Layer for X1 Validium

The Xgon-data-availability project is a specialized Data Availability Node (DA Node) that is part of Xgon's CDK (Chain Development Kit) Validium.
The x1-data-availability project is a specialized Data Availability Node (DA Node) that is part of X1's CDK (Chain Development Kit) Validium.

## Overview of Validium
The Xgon Validium solution is made up of several components; start with the [Xgon Node](https://github.com/okx/Xgon-node). For quick reference, the complete list of components are outlined below:
The X1 Validium solution is made up of several components; start with the [X1 Node](https://github.com/okx/x1-node). For quick reference, the complete list of components are outlined below:

| Component | Description |
| ----------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [Xgon Node](https://github.com/okx/Xgon-node) | Node implementation for the Xgon networks in Validium mode |
| [Xgon Contracts](https://github.com/okx/Xgon-contracts) | Smart contract implementation for the Xgon networks in Validium mode |
| [Xgon Data Availability](https://github.com/okx/Xgon-data-availability) | Data availability implementation for the Xgon networks |
| [Prover / Executor](https://github.com/okx/Xgon-prover) | zkEVM engine and prover implementation |
| [Bridge Service](https://github.com/okx/Xgon-bridge-service) | Bridge service implementation for Xgon networks |
| [X1 Node](https://github.com/okx/x1-node) | Node implementation for the X1 networks in Validium mode |
| [X1 Contracts](https://github.com/okx/x1-contracts) | Smart contract implementation for the X1 networks in Validium mode |
| [X1 Data Availability](https://github.com/okx/x1-data-availability) | Data availability implementation for the X1 networks |
| [Prover / Executor](https://github.com/okx/x1-prover) | zkEVM engine and prover implementation |
| [Bridge Service](https://github.com/okx/x1-bridge-service) | Bridge service implementation for X1 networks |

---

## Introduction

As blockchain networks grow, the volume of data that needs to be stored and validated increases, posing challenges in scalability and efficiency. Storing all data on-chain can lead to bloated blockchains, slow transactions, and high fees.

Data Availability Nodes facilitate a separation between transaction execution and data storage. They allow transaction data to reside off-chain while remaining accessible for validation. This significantly improves scalability and reduces costs. Within the framework of Xgon's CDK, Data Availability Committees (DAC) members run DA nodes to ensure the security, accessibility, and reliability of off-chain data.
Data Availability Nodes facilitate a separation between transaction execution and data storage. They allow transaction data to reside off-chain while remaining accessible for validation. This significantly improves scalability and reduces costs. Within the framework of X1's CDK, Data Availability Committees (DAC) members run DA nodes to ensure the security, accessibility, and reliability of off-chain data.

To learn more about how the data availability layer works in the validium, please see the CDK documentation [here](https://wiki.polygon.technology/docs/cdk/dac-overview/).

### Off-Chain Data

The off-chain data is stored in a distributed manner and managed by a data availability committee, ensuring that it is available for validation. The data availability committee is defined as a core smart contract, available [here](https://github.com/okx/Xgon-contracts/blob/main/contracts/DataCommittee.sol). This is crucial for the Validium model, where data computation happens off-chain but needs to be verifiable on-chain.
The off-chain data is stored in a distributed manner and managed by a data availability committee, ensuring that it is available for validation. The data availability committee is defined as a core smart contract, available [here](https://github.com/okx/x1-contracts/blob/main/contracts/DataCommittee.sol). This is crucial for the Validium model, where data computation happens off-chain but needs to be verifiable on-chain.

## License

The xgon-node project is licensed under the [GNU Affero General Public License](LICENSE) free software license.
The x1-node project is licensed under the [GNU Affero General Public License](LICENSE) free software license.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/urfave/cli/v2"
)

const appName = "xgon-data-availability"
const appName = "x1-data-availability"

var (
configFileFlag = cli.StringFlag{
Expand Down
2 changes: 1 addition & 1 deletion config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Outputs = ["stderr"]
User = "committee_user"
Password = "committee_password"
Name = "committee_db"
Host = "xgon-data-availability-db"
Host = "x1-data-availability-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/0xPolygonHermez/zkevm-node => github.com/okx/Xgon-node v0.2.6-RC3.0.20231023052616-8330009ec637
replace github.com/0xPolygonHermez/zkevm-node => github.com/okx/x1-node v0.2.6-RC3.0.20231111032632-500782b44703

replace github.com/0xPolygon/cdk-data-availability => ./
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/okx/Xgon-node v0.2.6-RC3.0.20231023052616-8330009ec637 h1:/ZxAgoMycmuVJ0tN6FjBGU1w0fsP4pAkoW3g2Z8VnIs=
github.com/okx/Xgon-node v0.2.6-RC3.0.20231023052616-8330009ec637/go.mod h1:n3w21Wec5I+ISPbcMhThQd/CPuzwpSjt7HEz1VwnoFo=
github.com/okx/x1-node v0.2.6-RC3.0.20231111032632-500782b44703 h1:QuU91pKZ+MtWaKCUmqUdVARp/JHTUUT8h+mZNnHYHrw=
github.com/okx/x1-node v0.2.6-RC3.0.20231111032632-500782b44703/go.mod h1:Rl9oH8vGAqtP27RxRyQm4HzuXnphQIR7hs16IoLX4Rw=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
Expand Down
70 changes: 35 additions & 35 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ STOP := docker compose down

.PHONY: run
run: ## Runs a full node for e2e
docker compose up -d xgon-state-db
docker compose up -d xgon-pool-db
docker compose up -d xgon-event-db
docker compose up -d xgon-data-availability-db
docker compose up -d xgon-mock-l1-network
docker compose up -d x1-state-db
docker compose up -d x1-pool-db
docker compose up -d x1-event-db
docker compose up -d x1-data-availability-db
docker compose up -d x1-mock-l1-network
sleep 1
docker compose up -d xgon-prover
docker compose up -d xgon-approve
docker compose up -d x1-prover
docker compose up -d x1-approve
sleep 3
docker compose up -d xgon-sync
docker compose up -d x1-sync
sleep 2
docker compose up -d xgon-eth-tx-manager
docker compose up -d xgon-sequencer
docker compose up -d xgon-sequence-sender
docker compose up -d xgon-l2gaspricer
docker compose up -d xgon-aggregator
docker compose up -d xgon-json-rpc
docker compose up -d x1-eth-tx-manager
docker compose up -d x1-sequencer
docker compose up -d x1-sequence-sender
docker compose up -d x1-l2gaspricer
docker compose up -d x1-aggregator
docker compose up -d x1-json-rpc
sleep 2
docker compose up -d xgon-data-availability
docker compose up -d x1-data-availability

.PHONY: stop
stop: ## Stop a full data node
Expand Down Expand Up @@ -49,52 +49,52 @@ help: ## Prints this help

.PHONY: run-node
run-node: ## Runs the node
docker compose up -d xgon-eth-tx-manager
docker compose up -d xgon-sync
docker compose up -d x1-eth-tx-manager
docker compose up -d x1-sync
sleep 2
docker compose up -d xgon-sequencer
docker compose up -d xgon-sequence-sender
docker compose up -d xgon-l2gaspricer
docker compose up -d xgon-aggregator
docker compose up -d xgon-json-rpc
docker compose up -d x1-sequencer
docker compose up -d x1-sequence-sender
docker compose up -d x1-l2gaspricer
docker compose up -d x1-aggregator
docker compose up -d x1-json-rpc

.PHONY: stop-node
stop-node: ## Stops the node
docker compose stop xgon-sequencer && docker compose rm -f xgon-sequencer
docker compose stop xgon-sequence-sender && docker compose rm -f xgon-sequence-sender
docker compose stop xgon-json-rpc && docker compose rm -f xgon-json-rpc
docker compose stop xgon-l2gaspricer && docker compose rm -f xgon-l2gaspricer
docker compose stop xgon-aggregator && docker compose rm -f xgon-aggregator
docker compose stop xgon-sync && docker compose rm -f xgon-sync
docker compose stop xgon-eth-tx-manager && docker compose rm -f xgon-eth-tx-manager
docker compose stop x1-sequencer && docker compose rm -f x1-sequencer
docker compose stop x1-sequence-sender && docker compose rm -f x1-sequence-sender
docker compose stop x1-json-rpc && docker compose rm -f x1-json-rpc
docker compose stop x1-l2gaspricer && docker compose rm -f x1-l2gaspricer
docker compose stop x1-aggregator && docker compose rm -f x1-aggregator
docker compose stop x1-sync && docker compose rm -f x1-sync
docker compose stop x1-eth-tx-manager && docker compose rm -f x1-eth-tx-manager

.PHONY: run-network
run-network: ## Runs the l1 network
docker compose up -d xgon-mock-l1-network
docker compose up -d x1-mock-l1-network

.PHONY: stop-network
stop-network: ## Stops the l1 network
docker compose stop xgon-mock-l1-network && docker compose rm -f xgon-mock-l1-network
docker compose stop x1-mock-l1-network && docker compose rm -f x1-mock-l1-network

.PHONY: run-approve-matic
run-approve-matic: ## Runs approve in node container
docker compose up -d xgon-approve
docker compose up -d x1-approve

.PHONY: stop-approve-matic
stop-approve-matic: ## Stops approve in node container
docker compose stop xgon-approve && docker compose rm -f xgon-approve
docker compose stop x1-approve && docker compose rm -f x1-approve

### manual utility to stop dac nodes that were started by e2e, but not stopped by e2e ###
.PHONY: stop-dac-nodes
stop-dac-nodes:
for i in 0 1 2 3 4 ; do \
(docker kill xgon-data-availability-$$i || true) && (docker rm xgon-data-availability-$$i || true) ; \
(docker kill x1-data-availability-$$i || true) && (docker rm x1-data-availability-$$i || true) ; \
done

.PHONY: stop-dac-dbs
stop-dac-dbs:
for i in 0 1 2 3 4 ; do \
(docker kill xgon-data-node-db-$$i || true) && (docker rm xgon-data-node-db-$$i || true); \
(docker kill x1-data-node-db-$$i || true) && (docker rm x1-data-node-db-$$i || true); \
done

.PHONY: stop-dacs
Expand Down
6 changes: 3 additions & 3 deletions test/config/test.da.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PrivateKey = {Path = "/pk/test-member.keystore", Password = "testonly"}

[L1]
WsURL = "ws://xgon-mock-l1-network:8546"
RpcURL = "http://xgon-mock-l1-network:8545"
WsURL = "ws://x1-mock-l1-network:8546"
RpcURL = "http://x1-mock-l1-network:8545"
ZkEVMAddress = "0x0D9088C72Cd4F08e9dDe474D8F5394147f64b22C"
DataCommitteeAddress = "0x6Ae5b0863dBF3477335c0102DBF432aFf04ceb22"
Timeout = "3m"
Expand All @@ -17,7 +17,7 @@ Outputs = ["stderr"]
User = "committee_user"
Password = "committee_password"
Name = "committee_db"
Host = "xgon-data-availability-db"
Host = "x1-data-availability-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand Down
6 changes: 3 additions & 3 deletions test/config/test.docker.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PrivateKey = {Path = "/pk/test-member.keystore", Password = "testonly"}

[L1]
WsURL = "ws://xgon-mock-l1-network:8546"
RpcURL = "http://xgon-mock-l1-network:8545"
WsURL = "ws://x1-mock-l1-network:8546"
RpcURL = "http://x1-mock-l1-network:8545"
ZkEVMAddress = "0x0D9088C72Cd4F08e9dDe474D8F5394147f64b22C"
DataCommitteeAddress = "0x6Ae5b0863dBF3477335c0102DBF432aFf04ceb22"
Timeout = "3m"
Expand All @@ -18,7 +18,7 @@ Outputs = ["stderr"]
User = "committee_user"
Password = "committee_password"
Name = "committee_db"
Host = "xgon-data-availability-db"
Host = "x1-data-availability-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand Down
7 changes: 4 additions & 3 deletions test/config/test.genesis.config.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions test/config/test.node.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Outputs = ["stderr"]
User = "state_user"
Password = "state_password"
Name = "state_db"
Host = "xgon-state-db"
Host = "x1-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand All @@ -27,13 +27,13 @@ PollMinAllowedGasPriceInterval = "15s"
User = "pool_user"
Password = "pool_password"
Name = "pool_db"
Host = "xgon-pool-db"
Host = "x1-pool-db"
Port = "5432"
EnableLog = false
MaxConns = 200

[Etherman]
URL = "http://xgon-mock-l1-network:8545"
URL = "http://x1-mock-l1-network:8545"
ForkIDChunkSize = 20000
MultiGasProvider = false
[Etherscan]
Expand Down Expand Up @@ -132,10 +132,10 @@ DefaultGasPriceWei = 1000000000
MaxGasPriceWei = 0

[MTClient]
URI = "xgon-prover:50061"
URI = "x1-prover:50061"

[Executor]
URI = "xgon-prover:50071"
URI = "x1-prover:50071"
MaxGRPCMessageSize = 100000000

[Metrics]
Expand All @@ -151,7 +151,7 @@ ProfilingEnabled = true
User = "event_user"
Password = "event_password"
Name = "event_db"
Host = "xgon-event-db"
Host = "x1-event-db"
Port = "5432"
EnableLog = false
MaxConns = 200
Expand All @@ -160,7 +160,7 @@ ProfilingEnabled = true
User = "prover_user"
Password = "prover_pass"
Name = "prover_db"
Host = "xgon-state-db"
Host = "x1-state-db"
Port = "5432"
EnableLog = false
MaxConns = 200
4 changes: 2 additions & 2 deletions test/config/test.prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
"hashDBURL": "local",
"aggregatorServerPort": 50081,
"aggregatorClientPort": 50081,
"aggregatorClientHost": "xgon-aggregator",
"aggregatorClientHost": "x1-aggregator",
"mapConstPolsFile": false,
"mapConstantsTreeFile": false,
"inputFile": "input_executor_0.json",
"inputFile2": "input_executor_1.json",
"keccakScriptFile": "config/scripts/keccak_script.json",
"storageRomFile": "config/scripts/storage_sm_rom.json",
"outputPath": "output",
"databaseURL": "postgresql://prover_user:prover_pass@xgon-state-db:5432/prover_db",
"databaseURL": "postgresql://prover_user:prover_pass@x1-state-db:5432/prover_db",
"dbNodesTableName": "state.nodes",
"dbProgramTableName": "state.program",
"dbMultiWrite": true,
Expand Down
Loading