-
Notifications
You must be signed in to change notification settings - Fork 76
feat: support switch DA to Avail #1321
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
base: main
Are you sure you want to change the base?
Conversation
cmd/rollapp/da/switch.go
Outdated
| pterm.Info.Println("Proposal Tx hash: ", txHash) | ||
| } | ||
|
|
||
| daConfig := dalayer.GetSequencerDAConfig(consts.NodeType.Sequencer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetSequencerDAConfig creates new config (at least for celestia), overwriting namespace. we should use another function or refactor it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it only does that with Celestia. Actually I haven't added the ability to switch from da to Celestia yet so can we consider it in future PRs? @srene
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd/rollapp/da/switch.go
Outdated
|
|
||
| pterm.Info.Println("updating dymint configuration") | ||
|
|
||
| _ = tomlconfig.UpdateFieldInFile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to include avail da_config + da_layer and also previous, to allow the transition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain further?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the updated value should be old + new DA, that way the system will know where to transfer from and to where. For example, if the current DA is Celestia and the rollapp is transferred to Avail, then the config should contain both.
[]string{string("avail", "celestia")},
and
_ = tomlconfig.UpdateFieldInFile(
dymintConfigPath,
"da_config",
daConfig,
)
daConfig should contain both, the "current" celestia da config and the future avail da config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part still doesn't seem to be implemented @anhductn2001
artemijspavlovs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Long: ``, | ||
| Args: cobra.MaximumNArgs(0), | ||
| Run: func(cmd *cobra.Command, args []string) { | ||
| envs := []string{"avail"} // TODO: support more DAs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env is not descriptive
| keyName, _ := pterm.DefaultInteractiveTextInput.WithDefaultText("Enter your key name").Show() | ||
| keyring, _ := pterm.DefaultInteractiveTextInput.WithDefaultText("Enter your keyring-backend").Show() | ||
| title, _ := pterm.DefaultInteractiveTextInput.WithDefaultText("Enter your Proposal Title").Show() | ||
| description, _ := pterm.DefaultInteractiveTextInput.WithDefaultText("Enter your Proposal Description").Show() | ||
| deposit, _ := pterm.DefaultInteractiveTextInput.WithDefaultText("Enter your Proposal Deposit").Show() | ||
| newDAParam := json.RawMessage(fmt.Sprintf(`"%s"`, env)) | ||
| txHash, err := gov.ParamChangeProposal(home, keyName, keyring, | ||
| &utils.ParamChangeProposalJSON{ | ||
| Title: title, | ||
| Description: description, | ||
| Changes: utils.ParamChangesJSON{ | ||
| utils.NewParamChangeJSON("rollappparams", "da", newDAParam), | ||
| }, | ||
| Deposit: deposit + rollappConfig.Denom, | ||
| }) | ||
|
|
||
| if err != nil { | ||
| pterm.Error.Println("failed to submit proposal", err) | ||
| return | ||
| } | ||
| pterm.Info.Println("Proposal Tx hash: ", txHash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
over all good, but there are too many inputs for the user to provide, might need ux improvements in the future
PR Standards
Opening a pull request should be able to meet the following requirements
For Author:
godoccommentsFor Reviewer:
After reviewer approval: