Skip to content

Commit

Permalink
Meag rewordings (#1978)
Browse files Browse the repository at this point in the history
* ETD subnet-evm vs CustomVM

* ETD: native vs erc20

* ETD: to burn or not to burn

* finish explaining

* Update cmd/subnetcmd/create.go

Signed-off-by: Meaghan FitzGerald <meag.fitz@avalabs.org>

---------

Signed-off-by: Meaghan FitzGerald <meag.fitz@avalabs.org>
  • Loading branch information
meaghanfitzgerald authored Jun 26, 2024
1 parent 41776a0 commit cc495c5
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions cmd/subnetcmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ can create a custom, user-generated genesis with a custom VM by providing
the path to your genesis and VM binaries with the --genesis and --vm flags.
By default, running the command with a subnetName that already exists
causes the command to fail. If youd like to overwrite an existing
causes the command to fail. If you'd like to overwrite an existing
configuration, pass the -f flag.`,
Args: cobrautils.ExactArgs(1),
RunE: createSubnetConfig,
Expand Down Expand Up @@ -206,8 +206,9 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
case customVMOption:
subnetTypeStr = models.CustomVM
case explainOption:
ux.Logger.PrintToUser("The difference is...")
ux.Logger.PrintToUser("")
ux.Logger.PrintToUser("Virtual machines are the blueprint the defines the application-level logic of a blockchain. It determines the language and rules for writing and executing smart contracts, as well as other blockchain logic.")
ux.Logger.PrintToUser("Subnet-EVM is a EVM-compatible virtual machine that supports smart contract development in Solidity. This VM is an out-of-box solution for Subnet deployers who want a dApp development experience that is nearly identical to Ethereum, without having to manage or create a custom virtual machine. For more information, please visit: https://github.com/ava-labs/subnet-evm")
ux.Logger.PrintToUser("Custom VMs created with the HyperSDK or writen from scratch in golang or rust can be deployed on Avalanche using the second option. More information can be found in the docs at https://docs.avax.network/learn/avalanche/virtual-machines.")
continue
}
break
Expand Down Expand Up @@ -322,8 +323,8 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
case externalTokenOption:
externalGasToken = true
case explainOption:
ux.Logger.PrintToUser("The difference is...")
ux.Logger.PrintToUser("")
ux.Logger.PrintToUser("Gas tokens exist because blockchains have limited resources. Native tokens the default gas token, and are non-programmable unless wrapped by an ERC-20 token contract.")
ux.Logger.PrintToUser("If desired, ERC-20 tokens can be deployed on other blockchains and used as the gas token enabled by a bridge. When a transaction is initiated, the ERC-20 amount will be locked on the source chain, a message will be relayed to the Subnet, and then the token will be minted to the sender's address using the Native Minter precompile. This means users with a balance of that ERC-20 on a separate chain can use it to pay for gas on the Subnet.")
continue
}
break
Expand Down Expand Up @@ -354,15 +355,15 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
return err
}
case explainOption:
ux.Logger.PrintToUser("The difference is...")
ux.Logger.PrintToUser("")
ux.Logger.PrintToUser("The two gas fee variables that have the largest impact on performance are the gas limit, the maximum amount of gas that fits in a block, and the gas target, the expected amount of gas consumed in a rolling ten-second period.")
ux.Logger.PrintToUser("By increasing the gas limit, you can fit more transactions into a single block which in turn increases your max throughput. Increasing the gas target has the same effect; if the targeted amount of gas is not consumed, the dynamic fee algorithm will decrease the base fee until it reaches the minimum.")
ux.Logger.PrintToUser("There is a long-term risk of increasing your gas parameters. By allowing more transactions to occur on your network, the network state will increase at a faster rate, meaning infrastructure costs and requirements will increase.")
continue
}
break
}
dontChangeFeeSettingsOption := "I am fine with the gas fee configuration set in the genesis (Fee Manager Precompile OFF)"
changeFeeSettingsOption := "I want to be able to adjust gas pricing if necessary - recommended for production (Fee Manager Precompile ON)"
explainOption = "Explain the difference"
options = []string{dontChangeFeeSettingsOption, changeFeeSettingsOption, explainOption}
for {
option, err := app.Prompt.CaptureList(
Expand All @@ -378,10 +379,7 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
case explainOption:
ux.Logger.PrintToUser("The difference is...")
ux.Logger.PrintToUser("")
continue
//missing case for dontChangeFeeSettingsOption
}
break
}
Expand All @@ -404,8 +402,7 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
return err
}
case explainOption:
ux.Logger.PrintToUser("The difference is...")
ux.Logger.PrintToUser("")
ux.Logger.PrintToUser("The fee reward mechanism can be configured with a stateful precompile contract called the RewardManager. The configuration can include burning fees, sending fees to a predefined address, or enabling fees to be collected by block producers. For more info, please visit: https://docs.avax.network/build/subnet/upgrade/customize-a-subnet#changing-fee-reward-mechanisms")
continue
}
break
Expand All @@ -431,7 +428,7 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
options := []string{interoperatingBlockchainOption, isolatedBlockchainOption, explainOption}
for {
option, err := app.Prompt.CaptureList(
"Do you want to connect your blockchain with other blockchains or C-Chain? (Deploy Teleporter and Registry)",
"Do you want to connect your blockchain with other blockchains or the C-Chain? (Deploy Teleporter along with its Registry)",
options,
)
if err != nil {
Expand All @@ -443,8 +440,7 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
case isolatedBlockchainOption:
useTeleporter = false
case explainOption:
ux.Logger.PrintToUser("The difference is...")
ux.Logger.PrintToUser("")
ux.Logger.PrintToUser("Avalanche already enables native interoperability between blockchains with the VM-agnostic Avalanche Warp Messaging protocol (AWM). Teleporter is a messaging protocol built on top of AWM that provides a developer-friendly interface for sending and receiving cross-chain messages to and from EVM-compatible blockchains.")
continue
}
break
Expand Down Expand Up @@ -482,7 +478,7 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
options := []string{anyoneCanSubmitTransactionsOption, approvedCanSubmitTransactionsOption, explainOption}
for {
option, err := app.Prompt.CaptureList(
"Do you want to allow only certain addresses to interact with your blockchain? (Transaction Allowlist Precompile)",
"Do you want to allow only certain user addresses to interact with your blockchain? (Transaction Allow List Precompile)",
options,
)
if err != nil {
Expand All @@ -495,8 +491,7 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
return err
}
case explainOption:
ux.Logger.PrintToUser("The difference is...")
ux.Logger.PrintToUser("")
ux.Logger.PrintToUser("The Transaction Allow List is a precompile contract that allows you to specify a list of addresses that are allowed to submit transactions to your blockchain. This is useful for permissioning your blockchain, similar to a whitelist, and can be used to prevent spam and unwanted transactions on your chain. This prevents any unauthorized users from sending transactions or deploying smart contracts on your blockchain. For more information, please visit: https://docs.avax.network/build/subnet/upgrade/customize-a-subnet#restricting-who-can-submit-transactions.")
continue
}
break
Expand All @@ -506,7 +501,7 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
options = []string{anyoneCanDeployContractsOption, approvedCanDeployContractsOption, explainOption}
for {
option, err := app.Prompt.CaptureList(
"Do you want to allow only certain addresses to deploy smart contracts on your blockchain? (Contract Deployer Allowlist)",
"Do you want to allow only certain addresses to deploy smart contracts on your blockchain? (Contract Deployer Allow List)",
options,
)
if err != nil {
Expand All @@ -519,15 +514,13 @@ func createSubnetConfig(cmd *cobra.Command, args []string) error {
return err
}
case explainOption:
ux.Logger.PrintToUser("The difference is...")
ux.Logger.PrintToUser("")
ux.Logger.PrintToUser("While you may wish to allow anyone to submit transactions to your blockchain, you may want to restrict who can deploy smart contracts and create dApps on your chain. The Smart Contract Deployer Allow List is a precompile contract that allows you to specify a list of addresses that are allowed to deploy smart contracts on your blockchain. For more information, please visit: https://docs.avax.network/build/subnet/upgrade/customize-a-subnet#restricting-smart-contract-deployers.")
continue
}
break
}
case explainOption:
ux.Logger.PrintToUser("The difference is...")
ux.Logger.PrintToUser("")
ux.Logger.PrintToUser("You can permission your chain at different levels of interaction with EVM-Precompiles. These precompiles act as whitelists, preventing unapproved users from deploying smart contracts, sending transactions, or interacting with your blockchain. You may choose to apply as many or as little of these rules as you see fit.")
continue
}
break
Expand Down

0 comments on commit cc495c5

Please sign in to comment.