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

feat(pkg/chains): add a CCTXGateway field to chain static data #2279

Merged
merged 8 commits into from
May 29, 2024
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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* [2113](https://github.com/zeta-chain/node/pull/2113) - add zetaclientd-supervisor process
* [2154](https://github.com/zeta-chain/node/pull/2154) - add `ibccrosschain` module
* [2258](https://github.com/zeta-chain/node/pull/2258) - add Optimism and Base in static chain information
* [2279](https://github.com/zeta-chain/node/pull/2279) - add a CCTXGateway field to chain static data
* [2275](https://github.com/zeta-chain/node/pull/2275) - add ChainInfo singleton state variable in authority

### Refactor
Expand Down
15 changes: 15 additions & 0 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56744,6 +56744,18 @@ definitions:
description: |-
QueryGetPoliciesResponse is the response type for the Query/Policies RPC
method.
chainsCCTXGateway:
type: string
enum:
- zevm
- observers
default: zevm
description: |-
- zevm: zevm is the internal CCTX gateway to process outbound on the ZEVM and read
inbound events from the ZEVM only used for ZetaChain chains
- observers: observers is the CCTX gateway for chains relying on the observer set to
observe inbounds and TSS for outbounds
title: CCTXGateway describes for the chain the gateway used to handle CCTX outbounds
chainsChain:
type: object
properties:
Expand All @@ -56769,6 +56781,9 @@ definitions:
is_external:
type: boolean
title: IsExternal describe if the chain is ZetaChain or external
cctx_gateway:
$ref: '#/definitions/chainsCCTXGateway'
title: CCTXGateway is the gateway used to handle CCTX outbounds
title: |-
Chain represents static data about a blockchain network
it is identified by a unique chain ID
Expand Down
20 changes: 20 additions & 0 deletions pkg/chains/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
CctxGateway: CCTXGateway_zevm,
lumtis marked this conversation as resolved.
Show resolved Hide resolved
}

// Ethereum is Ethereum mainnet
Expand All @@ -27,6 +28,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// BscMainnet is Binance Smart Chain mainnet
Expand All @@ -38,6 +40,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// BitcoinMainnet is Bitcoin mainnet
Expand All @@ -49,6 +52,7 @@ var (
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// Polygon is Polygon mainnet
Expand All @@ -60,6 +64,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// OptimismMainnet is Optimism mainnet
Expand All @@ -71,6 +76,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_op_stack,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// BaseMainnet is Base mainnet
Expand All @@ -82,6 +88,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_op_stack,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

/**
Expand All @@ -97,6 +104,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
CctxGateway: CCTXGateway_zevm,
}

// Sepolia is Ethereum sepolia testnet
Expand All @@ -108,6 +116,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// BscTestnet is Binance Smart Chain testnet
Expand All @@ -119,6 +128,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// BitcoinTestnet is Bitcoin testnet3
Expand All @@ -130,6 +140,7 @@ var (
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// Amoy is Polygon amoy testnet
Expand All @@ -141,6 +152,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// OptimismSepolia is Optimism sepolia testnet
Expand All @@ -152,6 +164,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_op_stack,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// BaseSepolia is Base sepolia testnet
Expand All @@ -163,6 +176,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_op_stack,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

/**
Expand All @@ -179,6 +193,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
CctxGateway: CCTXGateway_zevm,
}

/**
Expand All @@ -194,6 +209,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_tendermint,
IsExternal: false,
CctxGateway: CCTXGateway_zevm,
}

// BitcoinRegtest is Bitcoin regtest (localnet)
Expand All @@ -205,6 +221,7 @@ var (
Vm: Vm_no_vm,
Consensus: Consensus_bitcoin,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// GoerliLocalnet is Ethereum local goerli (localnet)
Expand All @@ -216,6 +233,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

/**
Expand All @@ -231,6 +249,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}

// Mumbai is Polygon mumbai testnet (deprecated for amoy)
Expand All @@ -242,6 +261,7 @@ var (
Vm: Vm_evm,
Consensus: Consensus_ethereum,
IsExternal: true,
CctxGateway: CCTXGateway_observers,
}
)

Expand Down
Loading
Loading