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

[Code]: Clean up old DAO modules #139

Closed
jolestar opened this issue Sep 20, 2022 · 5 comments
Closed

[Code]: Clean up old DAO modules #139

jolestar opened this issue Sep 20, 2022 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@jolestar
Copy link
Member

No description provided.

@jolestar jolestar added the enhancement New feature or request label Sep 20, 2022
@jolestar jolestar added this to the v12 milestone Sep 20, 2022
@jolestar jolestar mentioned this issue Sep 20, 2022
7 tasks
@jolestar
Copy link
Member Author

jolestar commented Sep 21, 2022

尝试做了一下这个任务,面临一个难题:

清理掉旧的 DAO 初始化相关的代码,Genesis 完全按照新的 DAO 初始化,这样整体逻辑比较清晰,不会受旧代码的干扰。但这样做 Genesis 初始化和链上升级的逻辑差异会比较大。

链上升级的逻辑是:

Old Genesis state --> Upgrade script ---> New Genesis state

所以当前 Genesis 初始化的时候一定程度也模拟了链上升级,先初始化成旧版本的,再升级成新的。这样的话旧的代码就比较难清理掉。

但如果直接初始化新 Genesis 状态,只是在 Upgrade script 中做一些状态迁移,别人可能看不懂旧的状态是怎么产生的,当然这个也可以通过看 Git 历史来明白。因为当前链上状态就是用旧版本的 Genesis initialize 方法来初始化的,
新的 initialize 方法的修改并不会影响已经生成的 Genesis 状态。

@WGB5445 @0xpause @baichuan3 @welbon @sanlee42 有没有建议。

@WGB5445
Copy link
Collaborator

WGB5445 commented Sep 21, 2022

在其他可以升级的 Move项目中也会遇到相同的问题,我的解决方式偏向于维护一个完全不需要升级的全新版本,但维护成本较高,但是代码结构清晰,halley 测试网可以直接部署,实验新特性等。

在以太坊上的代理合约升级有没有类似的问题?

我这里的建议是:
对于长期维护的网络没法完全移除某些模块,统一放在某个 deprecation 文件夹,删除对应测试代码(防止mpm 升级导致无法正确执行)

@pause125
Copy link
Collaborator

我偏向于只保留最新代码,逐步清理不再使用的代码。至于状态的变迁过程,可以通过文档记录 。一般的开发者和用户应该也不怎么关系历史状态怎么来的

@jolestar
Copy link
Member Author

@0xpause 这个你能来试着搞一搞吗?

@pause125
Copy link
Collaborator

@0xpause 这个你能来试着搞一搞吗?

可以的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants