Skip to content

Commit 118e511

Browse files
authored
Merge pull request #134 from Fantom-foundation/jk/export-genesis-no-history
Export genesis for validators with no historical blocks
2 parents d202165 + f26f4d4 commit 118e511

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cmd/sonictool/chain/export_genesis.go

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func ExportGenesis(gdb *gossip.Store, includeArchive bool, out *os.File, tmpPath
4343
}
4444

4545
// blocks
46+
if !includeArchive && to > 1 {
47+
from = to - 1 // only blocks of the last epoch for non-archive genesis
48+
}
4649
writer = newUnitWriter(out)
4750
if err := writer.Start(header, "brs", tmpPath); err != nil {
4851
return err

cmd/sonictool/genesis/allowed.go

+9
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,15 @@ var (
147147
genesisstore.FwsArchiveSection(0): hash.HexToHash("0x7d8c63e5a080fd53daa991aa30d5b990d421c199d7c3c398982a73ddc59b1541"),
148148
},
149149
},
150+
{
151+
Name: "Mainnet-283890 with Carmen live state only and the last epoch blocks only",
152+
Header: mainnetHeader,
153+
Hashes: genesis.Hashes{
154+
genesisstore.EpochsSection(0): hash.HexToHash("0x776ce5900d2e8e2f088ff4eb2cfb9ee4632a0d9f0378bc8fd21da0d9d49b9272"),
155+
genesisstore.BlocksSection(0): hash.HexToHash("0x3f6c530995c5e7c506d9106d20d69f94fa79aa68a24b426e3f0653c64d1100b7"),
156+
genesisstore.FwsLiveSection(0): hash.HexToHash("0xf8b42be75150cd76b5f86c8c4d67a9aaae90332d0be648df4f93e0bc4830d35e"),
157+
},
158+
},
150159

151160
{
152161
Name: "Testnet-2458 with pruned MPT",

0 commit comments

Comments
 (0)