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.
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.
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.
cmd/rollapp/da/switch.go
Outdated
|
|
||
| pterm.Info.Println("updating dymint configuration") | ||
|
|
||
| _ = tomlconfig.UpdateFieldInFile( |
There was a problem hiding this comment.
we need to include avail da_config + da_layer and also previous, to allow the transition
There was a problem hiding this comment.
Can you explain further?
There was a problem hiding this comment.
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.
this part still doesn't seem to be implemented @anhductn2001
| 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.
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.
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: