From 0efe5b0cd6cd93f2373b48b496616c6dcc82f917 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 3 Oct 2023 14:49:09 +1000 Subject: [PATCH 1/3] fix of testnet genesis header --- cmd/opera/launcher/params.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/opera/launcher/params.go b/cmd/opera/launcher/params.go index 196cbe447..9d52d26e2 100644 --- a/cmd/opera/launcher/params.go +++ b/cmd/opera/launcher/params.go @@ -182,7 +182,7 @@ var ( { Name: "Testnet-16200 without history", - Header: mainnetHeader, + Header: testnetHeader, Hashes: genesis.Hashes{ genesisstore.EpochsSection(0): hash.HexToHash("0xd72e9bf39c645df8d978955fab8997a7e9cd7cb5812c007e2bb4b51a8c570a90"), genesisstore.BlocksSection(0): hash.HexToHash("0x7d651ed0e0f3e92ffd89cb52112598db54afd8bf3050bc083ff0bfe1b98948fd"), @@ -190,7 +190,7 @@ var ( }, { Name: "Testnet-16200 without MPT", - Header: mainnetHeader, + Header: testnetHeader, Hashes: genesis.Hashes{ genesisstore.EpochsSection(0): hash.HexToHash("0x61040a80f16755b86d67f13880f55c1238d307e2e1c6fc87951eb3bdee0bdff2"), genesisstore.BlocksSection(0): hash.HexToHash("0x12010621d8cf4dcd4ea357e98eac61edf9517a6df752cb2d929fca69e56bd8d1"), @@ -200,7 +200,7 @@ var ( }, { Name: "Testnet-16200 with pruned MPT", - Header: mainnetHeader, + Header: testnetHeader, Hashes: genesis.Hashes{ genesisstore.EpochsSection(0): hash.HexToHash("0x61040a80f16755b86d67f13880f55c1238d307e2e1c6fc87951eb3bdee0bdff2"), genesisstore.BlocksSection(0): hash.HexToHash("0x12010621d8cf4dcd4ea357e98eac61edf9517a6df752cb2d929fca69e56bd8d1"), From e157c8f218d299436fc48d21a395e1d88d3faa91 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 3 Oct 2023 15:17:32 +1000 Subject: [PATCH 2/3] genesis/Hashes.String() for debug purpose --- opera/genesis/types.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/opera/genesis/types.go b/opera/genesis/types.go index 1550f2ae5..c3637d967 100644 --- a/opera/genesis/types.go +++ b/opera/genesis/types.go @@ -1,6 +1,10 @@ package genesis import ( + "fmt" + "sort" + "strings" + "github.com/Fantom-foundation/lachesis-base/hash" "github.com/Fantom-foundation/go-opera/inter/ibr" @@ -45,6 +49,19 @@ func (hh Hashes) Equal(hh2 Hashes) bool { return hh.Includes(hh2) && hh2.Includes(hh) } +func (hh Hashes) String() string { + bb := make([]string, 0, len(hh)) + for n, h := range hh { + bb = append(bb, fmt.Sprintf("%s: %s", n, h.String())) + } + sort.Strings(bb) + return "{" + strings.Join(bb, ", ") + "}" +} + func (h Header) Equal(h2 Header) bool { return h == h2 } + +func (h Header) String() string { + return fmt.Sprintf("{%d, net:%s, id:%s}", h.NetworkID, h.NetworkName, h.GenesisID.String()) +} From c2e4ce4e80a91c5421081e01c442c08a202d19fe Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 3 Oct 2023 15:46:10 +1000 Subject: [PATCH 3/3] Testnet-16200 fix: swap brs-1 and ers-1 hashes --- cmd/opera/launcher/params.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/opera/launcher/params.go b/cmd/opera/launcher/params.go index 9d52d26e2..2aeab2798 100644 --- a/cmd/opera/launcher/params.go +++ b/cmd/opera/launcher/params.go @@ -184,8 +184,8 @@ var ( Name: "Testnet-16200 without history", Header: testnetHeader, Hashes: genesis.Hashes{ - genesisstore.EpochsSection(0): hash.HexToHash("0xd72e9bf39c645df8d978955fab8997a7e9cd7cb5812c007e2bb4b51a8c570a90"), - genesisstore.BlocksSection(0): hash.HexToHash("0x7d651ed0e0f3e92ffd89cb52112598db54afd8bf3050bc083ff0bfe1b98948fd"), + genesisstore.EpochsSection(1): hash.HexToHash("0x7d651ed0e0f3e92ffd89cb52112598db54afd8bf3050bc083ff0bfe1b98948fd"), + genesisstore.BlocksSection(1): hash.HexToHash("0xd72e9bf39c645df8d978955fab8997a7e9cd7cb5812c007e2bb4b51a8c570a90"), }, }, { @@ -194,8 +194,8 @@ var ( Hashes: genesis.Hashes{ genesisstore.EpochsSection(0): hash.HexToHash("0x61040a80f16755b86d67f13880f55c1238d307e2e1c6fc87951eb3bdee0bdff2"), genesisstore.BlocksSection(0): hash.HexToHash("0x12010621d8cf4dcd4ea357e98eac61edf9517a6df752cb2d929fca69e56bd8d1"), - genesisstore.EpochsSection(1): hash.HexToHash("0xd72e9bf39c645df8d978955fab8997a7e9cd7cb5812c007e2bb4b51a8c570a90"), - genesisstore.BlocksSection(1): hash.HexToHash("0x7d651ed0e0f3e92ffd89cb52112598db54afd8bf3050bc083ff0bfe1b98948fd"), + genesisstore.EpochsSection(1): hash.HexToHash("0x7d651ed0e0f3e92ffd89cb52112598db54afd8bf3050bc083ff0bfe1b98948fd"), + genesisstore.BlocksSection(1): hash.HexToHash("0xd72e9bf39c645df8d978955fab8997a7e9cd7cb5812c007e2bb4b51a8c570a90"), }, }, { @@ -204,8 +204,8 @@ var ( Hashes: genesis.Hashes{ genesisstore.EpochsSection(0): hash.HexToHash("0x61040a80f16755b86d67f13880f55c1238d307e2e1c6fc87951eb3bdee0bdff2"), genesisstore.BlocksSection(0): hash.HexToHash("0x12010621d8cf4dcd4ea357e98eac61edf9517a6df752cb2d929fca69e56bd8d1"), - genesisstore.EpochsSection(1): hash.HexToHash("0xd72e9bf39c645df8d978955fab8997a7e9cd7cb5812c007e2bb4b51a8c570a90"), - genesisstore.BlocksSection(1): hash.HexToHash("0x7d651ed0e0f3e92ffd89cb52112598db54afd8bf3050bc083ff0bfe1b98948fd"), + genesisstore.EpochsSection(1): hash.HexToHash("0x7d651ed0e0f3e92ffd89cb52112598db54afd8bf3050bc083ff0bfe1b98948fd"), + genesisstore.BlocksSection(1): hash.HexToHash("0xd72e9bf39c645df8d978955fab8997a7e9cd7cb5812c007e2bb4b51a8c570a90"), genesisstore.EvmSection(0): hash.HexToHash("0xbd66dcbbe77881d5aae5091ee9c455d213cebef2cc53c0d4bb356840c7020f7b"), }, }, @@ -215,8 +215,8 @@ var ( Hashes: genesis.Hashes{ genesisstore.EpochsSection(0): hash.HexToHash("0x61040a80f16755b86d67f13880f55c1238d307e2e1c6fc87951eb3bdee0bdff2"), genesisstore.BlocksSection(0): hash.HexToHash("0x12010621d8cf4dcd4ea357e98eac61edf9517a6df752cb2d929fca69e56bd8d1"), - genesisstore.EpochsSection(1): hash.HexToHash("0xd72e9bf39c645df8d978955fab8997a7e9cd7cb5812c007e2bb4b51a8c570a90"), - genesisstore.BlocksSection(1): hash.HexToHash("0x7d651ed0e0f3e92ffd89cb52112598db54afd8bf3050bc083ff0bfe1b98948fd"), + genesisstore.EpochsSection(1): hash.HexToHash("0x7d651ed0e0f3e92ffd89cb52112598db54afd8bf3050bc083ff0bfe1b98948fd"), + genesisstore.BlocksSection(1): hash.HexToHash("0xd72e9bf39c645df8d978955fab8997a7e9cd7cb5812c007e2bb4b51a8c570a90"), genesisstore.EvmSection(0): hash.HexToHash("0x9227c80bf56e4af08dc32cb6043cc43672f2be8177d550ab34a7a9f57f4f104b"), genesisstore.EvmSection(1): hash.HexToHash("0x2376016f7ba13123244c6b56088a76e2e8bd5d5795fa92bad65f61488d12c236"), },