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

Refactor and simplify chain informations #1477

Closed
lumtis opened this issue Dec 7, 2023 · 0 comments · Fixed by #2071
Closed

Refactor and simplify chain informations #1477

lumtis opened this issue Dec 7, 2023 · 0 comments · Fixed by #2071
Assignees
Labels
code-quality Code quality improvement refactor

Comments

@lumtis
Copy link
Member

lumtis commented Dec 7, 2023

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
}
@lumtis lumtis self-assigned this Dec 11, 2023
@lumtis lumtis transferred this issue from another repository Dec 21, 2023
@lumtis lumtis added this to the v12 milestone Dec 21, 2023
@lumtis lumtis removed this from the v12 milestone Jan 2, 2024
@lumtis lumtis added refactor code-quality Code quality improvement labels Feb 6, 2024
@lumtis lumtis removed their assignment Apr 10, 2024
@lumtis lumtis added this to the v17 milestone Apr 15, 2024
@kingpinXD kingpinXD self-assigned this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality Code quality improvement refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants