Skip to content

Refactor and simplify chain informations #1477

@lumtis

Description

@lumtis

We currently have information about chains in:
https://github.com/zeta-chain/node-private/blob/develop/common/chain.go
https://github.com/zeta-chain/node-private/blob/develop/common/chains.go

The current way to represent information is IMO a bit messy, we define chain IDs for the different network, then. we define functions to determine if the chain ID is Ethereum, support EVM, is external, is testnet, etc...

It would be clearer I think to add the information in the Chain object itself, and directly retrieve the information from it.

Example of structure:

type Chain struct{
  ChainID int64 // identifier
  ChainName string
  IsExternal bool // external or zetachain
  Network [ZETACHAIN|BITCOIN|ETHEREUM|BSC|...] // the actual network
  NetworkType [PRIVNET|TESTNET|MAINNET]
  VM [NO_VM|EVM|COSMWASM]                                // vm of smart contract platform if any
  Consensus [BITCOIN|ETHEREUM||TENDERMINT] // the underlying consensus, this allow to reuse a specific header/proof system
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions