From a86a3092f3756fbc37c76a3902c687333b922362 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 4 Aug 2023 14:28:56 +0200 Subject: [PATCH 1/7] Fix gingerbread activation --- cmd/mycelo/genesis_commands.go | 5 +++-- cmd/mycelo/templates.go | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/mycelo/genesis_commands.go b/cmd/mycelo/genesis_commands.go index d5d34f9098..f8e7721d31 100644 --- a/cmd/mycelo/genesis_commands.go +++ b/cmd/mycelo/genesis_commands.go @@ -6,6 +6,7 @@ import ( "os" "path" + "github.com/celo-org/celo-blockchain/common" "github.com/celo-org/celo-blockchain/internal/fileutils" "github.com/celo-org/celo-blockchain/log" "github.com/celo-org/celo-blockchain/mycelo/env" @@ -139,6 +140,8 @@ func envFromTemplate(ctx *cli.Context, workdir string) (*env.Environment, *genes } else { gingerbreadBlock = big.NewInt(gingerbreadBlockNumber) } + } else { + gingerbreadBlock = common.Big1 } // Genesis config @@ -185,8 +188,6 @@ func envFromTemplate(ctx *cli.Context, workdir string) (*env.Environment, *genes } } - genesisConfig.Hardforks.GingerbreadBlock = gingerbreadBlock - if ctx.IsSet("forks.gingerbreadp2") { gingerbreadP2BlockNumber := ctx.Int64("forks.gingerbreadp2") if gingerbreadP2BlockNumber < 0 { diff --git a/cmd/mycelo/templates.go b/cmd/mycelo/templates.go index 9d2e70bdca..fa9b60fb4d 100644 --- a/cmd/mycelo/templates.go +++ b/cmd/mycelo/templates.go @@ -49,7 +49,6 @@ func (e localEnv) createEnv(workdir string) (*env.Environment, error) { } func (e localEnv) createGenesisConfig(env *env.Environment, gingerbreadBlock *big.Int) (*genesis.Config, error) { - genesisConfig, err := genesis.CreateCommonGenesisConfig(env.Config.ChainID, env.Accounts().AdminAccount().Address, params.IstanbulConfig{ Epoch: 10, ProposerPolicy: 2, From 6d0296c62e79ad024de0cad3244356648d23729e Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 4 Aug 2023 14:29:30 +0200 Subject: [PATCH 2/7] Fix some deprecation warnings --- mycelo/internal/utils/jsonfile.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mycelo/internal/utils/jsonfile.go b/mycelo/internal/utils/jsonfile.go index 02e7b0d0ac..210f8dd17e 100644 --- a/mycelo/internal/utils/jsonfile.go +++ b/mycelo/internal/utils/jsonfile.go @@ -2,11 +2,11 @@ package utils import ( "encoding/json" - "io/ioutil" + "os" ) func ReadJson(out interface{}, filepath string) error { - byteValue, err := ioutil.ReadFile(filepath) + byteValue, err := os.ReadFile(filepath) if err != nil { return err } @@ -20,5 +20,5 @@ func WriteJson(in interface{}, filepath string) error { return err } - return ioutil.WriteFile(filepath, byteValue, 0644) + return os.WriteFile(filepath, byteValue, 0644) } From b27bdfb7c1b7760e35dd26a10cbf75ac5a16f504 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 4 Aug 2023 14:52:59 +0200 Subject: [PATCH 3/7] Fix typos --- cmd/mycelo/genesis_commands.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/mycelo/genesis_commands.go b/cmd/mycelo/genesis_commands.go index f8e7721d31..88d3fc8d00 100644 --- a/cmd/mycelo/genesis_commands.go +++ b/cmd/mycelo/genesis_commands.go @@ -45,23 +45,23 @@ var templateFlags = []cli.Flag{ }, cli.Int64Flag{ Name: "forks.churrito", - Usage: "Optional flag to allow churrito fork overwritting (default: 0, disable: -1)", + Usage: "Optional flag to allow churrito fork overwriting (default: 0, disable: -1)", }, cli.Int64Flag{ Name: "forks.donut", - Usage: "Optional flag to allow donut fork overwritting (default: 0, disable: -1)", + Usage: "Optional flag to allow donut fork overwriting (default: 0, disable: -1)", }, cli.Int64Flag{ Name: "forks.espresso", - Usage: "Optional flag to allow espresso fork overwritting (default: 0, disable: -1)", + Usage: "Optional flag to allow espresso fork overwriting (default: 0, disable: -1)", }, cli.Int64Flag{ Name: "forks.gingerbread", - Usage: "Optional flag to allow gingerbread fork overwritting (default: 0, disable: -1)", + Usage: "Optional flag to allow gingerbread fork overwriting (default: 0, disable: -1)", }, cli.Int64Flag{ Name: "forks.gingerbreadp2", - Usage: "Optional flag to allow gingerbread p2 fork overwritting (default: 0, disable: -1)", + Usage: "Optional flag to allow gingerbread p2 fork overwriting (default: 0, disable: -1)", }, } @@ -131,7 +131,7 @@ func envFromTemplate(ctx *cli.Context, workdir string) (*env.Environment, *genes if ctx.IsSet("mnemonic") { env.Accounts().Mnemonic = ctx.String("mnemonic") } - + fmt.Println("envFromTemplate: GB block:", ctx.Int64("forks.gingerbread")) var gingerbreadBlock *big.Int if ctx.IsSet("forks.gingerbread") { gingerbreadBlockNumber := ctx.Int64("forks.gingerbread") From 8f4385935884bfc767fda5bf87f4b6f55165ea05 Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Fri, 18 Aug 2023 17:06:01 +0200 Subject: [PATCH 4/7] Remove log line --- 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 88d3fc8d00..a54ed8a6e7 100644 --- a/cmd/mycelo/genesis_commands.go +++ b/cmd/mycelo/genesis_commands.go @@ -131,7 +131,7 @@ func envFromTemplate(ctx *cli.Context, workdir string) (*env.Environment, *genes if ctx.IsSet("mnemonic") { env.Accounts().Mnemonic = ctx.String("mnemonic") } - fmt.Println("envFromTemplate: GB block:", ctx.Int64("forks.gingerbread")) + var gingerbreadBlock *big.Int if ctx.IsSet("forks.gingerbread") { gingerbreadBlockNumber := ctx.Int64("forks.gingerbread") From 583a16c15f4f19833050c18d5a1779f16e8e4d7c Mon Sep 17 00:00:00 2001 From: Gaston Ponti Date: Mon, 21 Aug 2023 10:49:25 -0300 Subject: [PATCH 5/7] Update monorepo commit --- monorepo_commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monorepo_commit b/monorepo_commit index e8a1780229..7ed28e2ce3 100644 --- a/monorepo_commit +++ b/monorepo_commit @@ -1 +1 @@ -549ff08afc86f2123abd8bb19000e248e5a86477 +e08fa22897113e0ae133cece929a74243d0414e3 From c6f44cae278c1423ef577e355dc29180a18622b6 Mon Sep 17 00:00:00 2001 From: Gaston Ponti Date: Mon, 21 Aug 2023 17:16:52 -0300 Subject: [PATCH 6/7] Update monorepo commit --- monorepo_commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monorepo_commit b/monorepo_commit index 7ed28e2ce3..723308dbb5 100644 --- a/monorepo_commit +++ b/monorepo_commit @@ -1 +1 @@ -e08fa22897113e0ae133cece929a74243d0414e3 +43094aea6865d3b78361cff974585130b44b7939 From 4b8818fea2d9b9fc94912e653b9373830b9edf9e Mon Sep 17 00:00:00 2001 From: Gaston Ponti Date: Mon, 21 Aug 2023 18:30:25 -0300 Subject: [PATCH 7/7] Update monorepo commit 3 --- monorepo_commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monorepo_commit b/monorepo_commit index 723308dbb5..093c0e94ba 100644 --- a/monorepo_commit +++ b/monorepo_commit @@ -1 +1 @@ -43094aea6865d3b78361cff974585130b44b7939 +f08e269d88c6680641427952ce4743a7d26336a6