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 #36

Merged
merged 14 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: Report a bug
about: Something with Xgon is not working as expected
about: Something with XGON is not working as expected
title: ''
labels: 'type:bug'
assignees: ''
---

#### System information

Xgon Node version: `v0.0.X-RCXX`
XGON Node version: `v0.0.X-RCXX`
OS & Version: `Windows/Linux/OSX`
Commit hash : (if `develop`)
Network: `Mainnet/Testnet`
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Xgon Node
# XGON Node

Xgon Node is a Go implementation of a node that operates the Xgon Network.
XGON Node is a Go implementation of a node that operates the XGON Network.

## About the Xgon network
## About the XGON network

Since this is an implementation of a protocol it's fundamental to understand it, [here]() you can find the specification of the protocol.

Glossary:

- L1: Base blockchain where the rollup smart contracts are deployed. It's Ethereum or a testnet of Ethereum, but it could be any EVM compatible blockchain.
- L2: the rollup network aka the Xgon network.
- Batch: a group of transactions that are executed/proved, using the [Xgon prover]() and sent to / synchronized from L1
- L2: the rollup network aka the XGON network.
- Batch: a group of transactions that are executed/proved, using the [XGON prover]() and sent to / synchronized from L1
- Sequencer: the actor that is responsible for selecting transactions, putting them in a specific order, and sending them in batches to L1
- Trusted sequencer: sequencer that has special privileges, there can only be one trusted sequencer. The privileges granted to the trusted sequencer allow it to forecast the batches that will be applied to L1. This way it can commit to a specific sequence before interacting with L1. This is done to achieve fast finality and reduce costs associated with using the network (lower gas fees)
- Permissionless sequencer: sequencer role that can be performed by anyone. It has competitive disadvantages compared to the trusted sequencer (slow finality, MEV attacks). Its main purpose is to provide censorship resistance and unstoppability features to the network.
Expand All @@ -20,7 +20,7 @@ Glossary:
- Trusted state: state reached through processing transactions that have been shared by the trusted sequencer. This state is considered trusted as the trusted sequencer could commit to a certain sequence, and then send a different one to L1
- Virtual state: state reached through processing transactions that have already been submitted to L1. These transactions are sent in batches by either trusted or permissionless sequencers. Those batches are also called virtual batches. Note that this state is trustless as it relies on L1 security assumptions
- Consolidated state: state that is proven on-chain by submitting a ZKP (Zero Knowledge Proof) that proves the execution of a sequence of the last virtual batch.
- Invalid transaction: a transaction that can't be processed and doesn't affect the state. Note that such a transaction could be included in a virtual batch. The reason for a transaction to be invalid could be related to the Ethereum protocol (invalid nonce, not enough balance, ...) or due to limitations introduced by the Xgon (each batch can make use of a limited amount of resources such as the total amount of keccak hashes that can be computed)
- Invalid transaction: a transaction that can't be processed and doesn't affect the state. Note that such a transaction could be included in a virtual batch. The reason for a transaction to be invalid could be related to the Ethereum protocol (invalid nonce, not enough balance, ...) or due to limitations introduced by the XGON (each batch can make use of a limited amount of resources such as the total amount of keccak hashes that can be computed)
- Reverted transaction: a transaction that is executed, but is reverted (because of smart contract logic). The main difference with *invalid transaction* is that this transaction modifies the state, at least to increment nonce of the sender.
- Proof of Efficiency (PoE): name of the protocol used by the network, it's enforced by the [smart contracts](https://github.com/okx/xgon-contracts)

Expand Down Expand Up @@ -63,8 +63,8 @@ Required services and components:

There must be only one synchronizer, and it's recommended that it has exclusive access to an executor instance, although it's not necessary. This role can perfectly be run in a single instance, however, the JSON RPC and executor services can benefit from running in multiple instances, if the performance decreases due to the number of requests received

- [`Xgon RPC endpoints`](./docs/json-rpc-endpoints.md)
- [`Xgon RPC Custom endpoints documentation`](./docs/zkEVM-custom-endpoints.md)
- [`XGON RPC endpoints`](./docs/json-rpc-endpoints.md)
- [`XGON RPC Custom endpoints documentation`](./docs/zkEVM-custom-endpoints.md)

### Trusted sequencer

Expand Down
8 changes: 4 additions & 4 deletions docs/components/sequencer.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Component: Sequencer

## Xgon Sequencer:
## XGON Sequencer:

The Xgon Sequencer is an optional but ancillary module that proposes new batches using transactions stored in the Pool Database.
The XGON Sequencer is an optional but ancillary module that proposes new batches using transactions stored in the Pool Database.

## Running:

The preferred way to run the Xgon Sequencer component is via Docker and Docker Compose.
The preferred way to run the XGON Sequencer component is via Docker and Docker Compose.

```bash
docker pull okx/xgon-node
```

To orchestrate multiple deployments of the different Xgon Node components, a `docker-compose.yaml` file for Docker Compose can be used:
To orchestrate multiple deployments of the different XGON Node components, a `docker-compose.yaml` file for Docker Compose can be used:

```yaml
xgon-sequencer:
Expand Down
2 changes: 1 addition & 1 deletion docs/networks.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Xgon testnet networks
# XGON testnet networks

| Network Name | ChainID | RPC URL | Explorer | Bridge Info |
|--------------|---------|---------|----------|------------------|
Expand Down
14 changes: 7 additions & 7 deletions docs/running_local.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

This documentation will help you running the following components:

- Xgon Node Databases
- XGON Node Databases
- Explorer Databases
- L1 Network
- Prover
- Xgon Node components
- XGON Node components
- Explorers

## Requirements
Expand Down Expand Up @@ -93,23 +93,23 @@ make run-approve-matic
## Accessing the environment

- **Databases**:
- Xgon Node *State* Database
- XGON Node *State* Database
- `Type:` Postgres DB
- `User:` state_user
- `Password:` state_password
- `Database:` state-db
- `Host:` localhost
- `Port:` 5432
- `Url:` <postgres://state_user:srare_password@localhost:5432/state-db>
- Xgon Node *Pool* Database
- XGON Node *Pool* Database
- `Type:` Postgres DB
- `User:` pool_user
- `Password:` pool_password
- `Database:` pool_db
- `Host:` localhost
- `Port:` 5433
- `Url:` <postgres://pool_user:pool_password@localhost:5433/pool_db>
- Xgon Node *JSON-RPC* Database
- XGON Node *JSON-RPC* Database
- `Type:` Postgres DB
- `User:` rpc_user
- `Password:` rpc_password
Expand Down Expand Up @@ -139,7 +139,7 @@ make run-approve-matic
- `Host:` localhost
- `Port:` 8545
- `Url:` <http://localhost:8545>
- Xgon Node
- XGON Node
- `Type:` JSON RPC
- `Host:` localhost
- `Port:` 8123
Expand Down Expand Up @@ -173,7 +173,7 @@ To configure your Metamask to use your local environment, follow these steps:
3. On the left menu, click on Networks
4. Click on `Add Network` button
5. Fill up the L2 network information
1. `Network Name:` Xgon - Local
1. `Network Name:` XGON - Local
2. `New RPC URL:` <http://localhost:8123>
3. `ChainID:` 1001
4. `Currency Symbol:` ETH
Expand Down
4 changes: 2 additions & 2 deletions docs/zkEVM-custom-endpoints.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Xgon custom endpoints
# XGON custom endpoints

The Xgon Node JSON RPC server works as is when compared to the official Ethereum JSON RPC, but there are some extra information that also needs to be shared when talking about a L2 Networks, in our case we have information about Batches, Proofs, L1 transactions and much more
The XGON Node JSON RPC server works as is when compared to the official Ethereum JSON RPC, but there are some extra information that also needs to be shared when talking about a L2 Networks, in our case we have information about Batches, Proofs, L1 transactions and much more

In order to allow users to consume this information, a custom set of endpoints were created to provide this information, they are provided under the prefix `zkevm_`

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ require (
github.com/segmentio/kafka-go v0.4.43
)

replace github.com/0xPolygon/cdk-data-availability => github.com/okx/Xgon-data-availability v0.0.0-20231017042200-1e5db80e4477
replace github.com/0xPolygon/cdk-data-availability => github.com/okx/xgon-data-availability v0.0.0-20231017042200-1e5db80e4477

replace github.com/0xPolygonHermez/zkevm-node => ./
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA
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-data-availability v0.0.0-20231017042200-1e5db80e4477 h1:Mj+q/we7aSzHXDTXR1FI5xxGDGSVqvpWXtBMVmSxnPE=
github.com/okx/Xgon-data-availability v0.0.0-20231017042200-1e5db80e4477/go.mod h1:++uQ54YCTm+SA8J58giwd2Zy64VhA39VKONy2cMcN6o=
github.com/okx/xgon-data-availability v0.0.0-20231017042200-1e5db80e4477 h1:hvjY7KBUhOvCHxrTVgMyID/YfcRWTLBMXJkET0QvLks=
github.com/okx/xgon-data-availability v0.0.0-20231017042200-1e5db80e4477/go.mod h1:++uQ54YCTm+SA8J58giwd2Zy64VhA39VKONy2cMcN6o=
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
4 changes: 2 additions & 2 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,8 @@ generate-mocks: ## Generates mocks for the tests, using mockery tool
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=poolInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=poolMock --filename=mock_pool.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=zkEVMClientInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=zkEVMClientMock --filename=mock_zkevmclient.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=Tx --srcpkg=github.com/jackc/pgx/v4 --output=../synchronizer --outpkg=synchronizer --structname=dbTxMock --filename=mock_dbtx.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ClientFactoryInterface --srcpkg=github.com/okx/Xgon-data-availability/client --output=../synchronizer --outpkg=synchronizer --structname=dataCommitteeClientFactoryMock --filename=mock_datacommitteeclientfactory.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ClientInterface --srcpkg=github.com/okx/Xgon-data-availability/client --output=../synchronizer --outpkg=synchronizer --structname=dataCommitteeClientMock --filename=mock_datacommitteeclient.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ClientFactoryInterface --srcpkg=github.com/okx/xgon-data-availability/client --output=../synchronizer --outpkg=synchronizer --structname=dataCommitteeClientFactoryMock --filename=mock_datacommitteeclientfactory.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ClientInterface --srcpkg=github.com/okx/xgon-data-availability/client --output=../synchronizer --outpkg=synchronizer --structname=dataCommitteeClientMock --filename=mock_datacommitteeclient.go

export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=GasPricer --srcpkg=github.com/ethereum/go-ethereum --output=../etherman --outpkg=etherman --structname=etherscanMock --filename=mock_etherscan.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=GasPricer --srcpkg=github.com/ethereum/go-ethereum --output=../etherman --outpkg=etherman --structname=ethGasStationMock --filename=mock_ethgasstation.go
Expand Down
2 changes: 1 addition & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ services:
command:
- "/bin/sh"
- "-c"
- "/app/xgon-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components rpc --http.api eth,net,debug,Xgon,txpool,web3"
- "/app/xgon-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components rpc --http.api eth,net,debug,zkevm,txpool,web3"

xgon-explorer-l2-db:
container_name: xgon-explorer-l2-db
Expand Down