Skip to content

Commit

Permalink
feat(pkg/chains): add a CCTXGateway field to chain static data (#…
Browse files Browse the repository at this point in the history
…2279)

* proto gen

* add field to chains

* make generate

* changelog

* fix test

* update comment

* make format
  • Loading branch information
lumtis authored May 29, 2024
1 parent 42fe69c commit 180fcef
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 44 deletions.
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,
}

// 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

0 comments on commit 180fcef

Please sign in to comment.