From 4949def9e73f8fd6cf141e29afdf6fea348e6b70 Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:38:07 -0600 Subject: [PATCH 01/12] Update README.md 01 --- cmd/mycelo/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/mycelo/README.md b/cmd/mycelo/README.md index c645a7d2d1..b5f5a8f228 100644 --- a/cmd/mycelo/README.md +++ b/cmd/mycelo/README.md @@ -1,7 +1,7 @@ # Mycelo -`mycelo` is a developer utility to easy running celo blockchain testnets and related jobs around testnets. +`mycelo` is a developer utility to easily run celo blockchain testnets and related jobs around testnets. Its main advantage over previous solutions is that it's able to create a `genesis.json` where all core conctracts are already deployed in it. Eventually it can be extended to support other cases, like e2e tests, load tests, and other operations. @@ -10,7 +10,7 @@ Its main advantage over previous solutions is that it's able to create a `genesi There are 2 main use cases for mycelo: 1. Run a local tesnet - 2. Create a genesis.json to be used in another testnet that will be run on a CloudProvider/Kubernetes + 2. Create a `genesis.json` to be used in another testnet that will be run on a CloudProvider/Kubernetes ### Generating a genesis.json @@ -40,7 +40,7 @@ Genesis creation has many configuration options, for that `mycelo` use the conce mycelo genesis --template=[local|loadtest|monorepo] ``` -Additionally, you can override template options via command line, chedk `mycelo genesis --help` for options: +Additionally, you can override template options via command line, check `mycelo genesis --help` for options: ```bash --validators value Number of Validators (default: 0) @@ -52,7 +52,7 @@ Additionally, you can override template options via command line, chedk `mycelo ### Configuring Genesis (Advanced) -If that's not enough, you can ask mycelo to generate a genesis-config file that you can then customize and use to generate genesis +If that's not enough, you can ask mycelo to generate a `genesis-config` file that you can then customize and use to generate genesis ```bash mycelo genesis-config path/to/env @@ -66,7 +66,7 @@ Next step is to customize those files with your desired options, and then run: mycelo genesis-from-config path/to/env ``` -This command will read those file, and generate a `genesis.json` on the env folder +This command will read those files, and generate a `genesis.json` on the env folder ### Running a local testnet @@ -99,7 +99,7 @@ You can run a simple load bot with: mycelo load-bot path/to/env ``` -This will generate cUSD transfer on each of the developers account of the enviroment. +This will generate cUSD transfer on each of the developers account in the enviroment. This feature is still experimental and needs more work, but it's already usable. From 6f57c515cfaa46e5450777b9b3c25dfa68365bc9 Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:42:36 -0600 Subject: [PATCH 02/12] Update genesis_commands.go 01 --- cmd/mycelo/genesis_commands.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/mycelo/genesis_commands.go b/cmd/mycelo/genesis_commands.go index a54ed8a6e7..2812e98785 100644 --- a/cmd/mycelo/genesis_commands.go +++ b/cmd/mycelo/genesis_commands.go @@ -67,7 +67,7 @@ var templateFlags = []cli.Flag{ var buildpathFlag = cli.StringFlag{ Name: "buildpath", - Usage: "Directory where smartcontract truffle build file live", + Usage: "Directory where smartcontract truffle build file resides", } var newEnvFlag = cli.StringFlag{ From 2c18fbdeff4d1e9006afef411e6aa4511e17107e Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:44:53 -0600 Subject: [PATCH 03/12] Update main.go 01 --- cmd/mycelo/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/mycelo/main.go b/cmd/mycelo/main.go index 55b409ba7c..bdea216af8 100644 --- a/cmd/mycelo/main.go +++ b/cmd/mycelo/main.go @@ -103,7 +103,7 @@ var loadTestMixFeeCurrencyFlag = cli.BoolFlag{ var initValidatorsCommand = cli.Command{ Name: "validator-init", - Usage: "Setup all validators nodes", + Usage: "Setup all validator nodes", ArgsUsage: "[envdir]", Action: validatorInit, Flags: []cli.Flag{gethPathFlag}, From 097ab2a7b17a8b982e6dc10027f966fa356d7868 Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:10:39 -0600 Subject: [PATCH 04/12] Update README.md 01 --- cmd/evm/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/evm/README.md b/cmd/evm/README.md index 1a029ab709..a0eedd70ac 100644 --- a/cmd/evm/README.md +++ b/cmd/evm/README.md @@ -4,14 +4,14 @@ The `evm t8n` tool is a stateless state transition utility. It is a utility which can 1. Take a prestate, including -- Accounts, -- Block context information, +- Accounts +- Block context information - Previous blockshashes (*optional) -2. Apply a set of transactions, -3. Apply a mining-reward (*optional), -4. And generate a post-state, including -- State root, transaction root, receipt root, -- Information about rejected transactions, +2. Apply a set of transactions +3. Apply a mining-reward (*optional) +4. Generate a post-state, including +- State root, transaction root, receipt root +- Information about rejected transactions - Optionally: a full or partial post-state dump ## Specification @@ -53,10 +53,10 @@ There are a few (not many) errors that can occur, those are defined below. #### EVM-based errors (`2` to `9`) - Other EVM error. Exit code `2` -- Failed configuration: when a non-supported or invalid fork was specified. Exit code `3`. +- Failed configuration: when a non-supported or invalid fork was specified. Exit code `3` - Block history is not supplied, but needed for a `BLOCKHASH` operation. If `BLOCKHASH` is invoked targeting a block which history has not been provided for, the program will - exit with code `4`. + exit with code `4` #### IO errors (`10`-`20`) @@ -319,7 +319,7 @@ rlpdump -hex $(cat signed_txs.rlp | jq -r ) 02f864010280820fa08284d09411111111111111111111111111111111111111118080c080a0d4ec563b6568cd42d998fc4134b36933c6568d01533b5adf08769270243c6c7fa072bf7c21eac6bbeae5143371eef26d5e279637f3bd73482b55979d76d935b1e9, ] ``` -Now, we can now use those (or any other already signed transactions), as input, like so: +Now, we can use those (or any other already signed transactions), as input, like so: ``` ./evm t8n --state.fork=London --input.alloc=./testdata/13/alloc.json --input.txs=./signed_txs.rlp --input.env=./testdata/13/env.json --output.result=alloc_rlptx.json INFO [07-27|11:53:41.253] Trie dumping started root=e4b924..6aef61 From d6ac354af79484ff1f1a8cabea8e4a7f542ab49b Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:15:51 -0600 Subject: [PATCH 05/12] Update core_contracts.go 01 --- mycelo/env/core_contracts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mycelo/env/core_contracts.go b/mycelo/env/core_contracts.go index 5f62830cbd..dc5cb046b3 100644 --- a/mycelo/env/core_contracts.go +++ b/mycelo/env/core_contracts.go @@ -111,7 +111,7 @@ func Libraries() []string { return libraries } func LibraryAddressFor(name string) (common.Address, error) { address, ok := libraryAddresses[name] if !ok { - return common.ZeroAddress, fmt.Errorf("can't find genesis address for %s", name) + return common.ZeroAddress, fmt.Errorf("can't find library address for %s", name) } return address, nil } From bf1335214ac96d5acdb38b4adc822feda40e2640 Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:29:10 -0600 Subject: [PATCH 06/12] Update node.go 01 --- mycelo/cluster/node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mycelo/cluster/node.go b/mycelo/cluster/node.go index 0c28831cba..4dfd071f23 100644 --- a/mycelo/cluster/node.go +++ b/mycelo/cluster/node.go @@ -72,7 +72,7 @@ func (n *Node) SetStaticNodes(enodeUrls ...string) error { } //nolint:gosec if err = ioutil.WriteFile(n.staticNodesFile(), staticNodesRaw, 0644); err != nil { - return fmt.Errorf("Can't serialize static nodes: %w", err) + return fmt.Errorf("Can't write file in order to serialize static nodes: %w", err) } return nil From d526f7178da997e9429698e40cca345b9c6c880b Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:39:32 -0600 Subject: [PATCH 07/12] Update main.go 01 --- mycelo/internal/scripts/generate/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mycelo/internal/scripts/generate/main.go b/mycelo/internal/scripts/generate/main.go index 8978393a0c..7636c6a8d6 100644 --- a/mycelo/internal/scripts/generate/main.go +++ b/mycelo/internal/scripts/generate/main.go @@ -20,7 +20,7 @@ import ( func readABI(truffleJsonFile string) (string, error) { jsonData, err := ioutil.ReadFile(truffleJsonFile) if err != nil { - return "", fmt.Errorf("Can't read build fild for %s: %w", truffleJsonFile, err) + return "", fmt.Errorf("Can't read build file for %s: %w", truffleJsonFile, err) } var data struct { @@ -71,7 +71,7 @@ var contractNames = []string{ "FeeHandler", } -var buildPath = flag.String("buildpath", "", "the folder where truffle contract build live (on monorepo ./packages/protocol/build/contracts )") +var buildPath = flag.String("buildpath", "", "the folder where truffle contract build resides (on monorepo ./packages/protocol/build/contracts )") var outPath = flag.String("outpath", "./mycelo/contract", "relative path to mycelo/contract package") func main() { From 78c73047fba135af2801dc23d42eff4a4f21a9ea Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:42:14 -0600 Subject: [PATCH 08/12] Update bot.go 01 --- mycelo/loadbot/bot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mycelo/loadbot/bot.go b/mycelo/loadbot/bot.go index 221a6175a9..9e3944e73a 100644 --- a/mycelo/loadbot/bot.go +++ b/mycelo/loadbot/bot.go @@ -147,7 +147,7 @@ func runTransaction(ctx context.Context, client *ethclient.Client, chainID *big. transactor.GasLimit = GasForTransferWithComment } - tx, err := stableToken.TxObj(transactor, "transferWithComment", txCfg.Recipient, txCfg.Value, "need to proivde some long comment to make it similar to an encrypted comment").Send() + tx, err := stableToken.TxObj(transactor, "transferWithComment", txCfg.Recipient, txCfg.Value, "need to provide some long comment to make it similar to an encrypted comment").Send() if err != nil { if err != context.Canceled { fmt.Printf("Error sending transaction: %v\n", err) From 195e7ff834a8ad525a67eef28161bebb487fe88c Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:00:28 -0600 Subject: [PATCH 09/12] Update block.go 01 --- miner/block.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miner/block.go b/miner/block.go index 96e774f1c9..043134ec02 100644 --- a/miner/block.go +++ b/miner/block.go @@ -99,7 +99,7 @@ func prepareBlock(w *worker) (*blockState, error) { // Initialize the block state itself state, err := w.chain.StateAt(parent.Root()) if err != nil { - return nil, fmt.Errorf("Failed to get the parent state: %w:", err) + return nil, fmt.Errorf("Failed to get the parent state: %w", err) } state.StartPrefetcher("miner") @@ -158,7 +158,7 @@ func prepareBlock(w *worker) (*blockState, error) { err := w.chain.RecoverRandomnessCache(lastCommitment, b.header.ParentHash) if err != nil { log.Error("Error in recovering randomness cache", "error", err, "number", header.Number.Uint64()) - return b, errors.New("failed to to recover the randomness cache after miss") + return b, errors.New("failed to recover the randomness cache after miss") } lastRandomnessParentHash = rawdb.ReadRandomCommitmentCache(w.db, lastCommitment) if (lastRandomnessParentHash == common.Hash{}) { From 09b365468d04437e9897a6dd0804c7ef5973153f Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:13:51 -0600 Subject: [PATCH 10/12] Update worker_test.go 01 --- miner/worker_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miner/worker_test.go b/miner/worker_test.go index a678e84ec6..f6db1d1674 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -276,7 +276,7 @@ func getAuthorizedIstanbulEngine() consensus.Istanbul { func TestEmptyWorkIstanbul(t *testing.T) { // TODO(nambrot): Fix this - t.Skip("Disabled due to flakyness") + t.Skip("Disabled due to flakiness") testEmptyWork(t, istanbulChainConfig, getAuthorizedIstanbulEngine(), false, true) testEmptyWork(t, istanbulChainConfig, getAuthorizedIstanbulEngine(), true, false) } From dcb857dab6beee3a80ca4c626733bed74bfd85fa Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:24:41 -0600 Subject: [PATCH 11/12] Update url_test.go 01 --- accounts/url_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accounts/url_test.go b/accounts/url_test.go index bd6f35fa2a..8a328a9bee 100644 --- a/accounts/url_test.go +++ b/accounts/url_test.go @@ -54,7 +54,7 @@ func TestURLMarshalJSON(t *testing.T) { url := URL{Scheme: "https", Path: "ethereum.org"} json, err := url.MarshalJSON() if err != nil { - t.Errorf("unexpcted error: %v", err) + t.Errorf("unexpected error: %v", err) } if string(json) != "\"https://ethereum.org\"" { t.Errorf("expected: %v, got: %v", "\"https://ethereum.org\"", string(json)) @@ -65,13 +65,13 @@ func TestURLUnmarshalJSON(t *testing.T) { url := &URL{} err := url.UnmarshalJSON([]byte("\"https://ethereum.org\"")) if err != nil { - t.Errorf("unexpcted error: %v", err) + t.Errorf("unexpected error: %v", err) } if url.Scheme != "https" { t.Errorf("expected: %v, got: %v", "https", url.Scheme) } if url.Path != "ethereum.org" { - t.Errorf("expected: %v, got: %v", "https", url.Path) + t.Errorf("expected: %v, got: %v", "ethereum.org", url.Path) } } From a3a164ec288942895fb431ca8db90ba9d51e0489 Mon Sep 17 00:00:00 2001 From: amvp0tn3s <168793457+amvp0tn3s@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:35:59 -0600 Subject: [PATCH 12/12] Update wallet.go 01 --- accounts/usbwallet/wallet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 64c49d1fed..ae3d9f03a6 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -390,7 +390,7 @@ func (w *wallet) selfDerive() { // of legacy-ledger, the first account on the legacy-path will // be shown to the user, even if we don't actively track it if i < len(nextAddrs)-1 { - w.log.Info("Skipping trakcking first account on legacy path, use personal.deriveAccount(,, false) to track", + w.log.Info("Skipping tracking first account on legacy path, use personal.deriveAccount(,, false) to track", "path", path, "address", nextAddrs[i]) break }