iotex-core icon indicating copy to clipboard operation
iotex-core copied to clipboard

Move config definition into corresponding components

Open CoderZhi opened this issue 3 years ago • 5 comments

Right now, most of the configs of different components are defined in config/config.go, and config is used in different components. As a result, the dependency is very complex that loop dependency is a common problem.

What would you like to be added: Move config definitions into corresponding components.

Why is this needed: Independent component

CoderZhi avatar Jun 07 '21 21:06 CoderZhi

Example 1: https://github.com/iotexproject/iotex-core/pull/2673 Example 2: https://github.com/iotexproject/iotex-core/pull/2695

CoderZhi avatar Jun 07 '21 21:06 CoderZhi

https://iotex.larksuite.com/docs/docusUF0iZ9n3JF4CamxsQAfCLe#

CoderZhi avatar Jul 07 '21 23:07 CoderZhi

create 1 PR for moving each struct, like Consensus struct {}, BlockSync struct {}

dustinxie avatar Jul 28 '21 23:07 dustinxie

All unmoved config definitions in config.go directly or indirectly import action package. However, if the config structs in config.go are moved to their responding package, there will be a loop dependency. Because action package needs to read ChainID in config package.

Liuhaai avatar Sep 04 '21 03:09 Liuhaai

Dependency would be decoupled after the pr https://github.com/iotexproject/iotex-core/pull/3035 is merged

Liuhaai avatar Jan 29 '22 20:01 Liuhaai

has been split into #3739 #3736 #3735 #3721

millken avatar Dec 27 '22 10:12 millken