From c4d6a7a3d53e1b7fbe077968dc669de6857399e7 Mon Sep 17 00:00:00 2001 From: JkLondon Date: Tue, 7 Oct 2025 11:47:13 +0200 Subject: [PATCH] commit --- db/snaptype/type.go | 5 ++++ db/state/statecfg/version_schema_gen.go | 8 +++--- db/state/statecfg/versions.yaml | 38 ++++++++++++------------- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/db/snaptype/type.go b/db/snaptype/type.go index 4af65513df5..fff6e5fa1ce 100644 --- a/db/snaptype/type.go +++ b/db/snaptype/type.go @@ -498,6 +498,11 @@ func BuildIndex(ctx context.Context, info FileInfo, indexVersion version.Version cfg.KeyCount = d.Count() idxVer := indexVersion.Current cfg.IndexFile = filepath.Join(info.Dir(), info.Type.IdxFileName(idxVer, info.From, info.To)) + versionOfRs := uint8(0) + if !idxVer.Eq(version.V1_0) { // inner version=1 incompatible with .efi v1.0 + versionOfRs = 1 + } + cfg.Version = versionOfRs rs, err := recsplit.NewRecSplit(cfg, logger) if err != nil { return err diff --git a/db/state/statecfg/version_schema_gen.go b/db/state/statecfg/version_schema_gen.go index 7af7d71ef06..0df3259c137 100644 --- a/db/state/statecfg/version_schema_gen.go +++ b/db/state/statecfg/version_schema_gen.go @@ -12,7 +12,7 @@ func InitSchemasGen() { Schema.AccountsDomain.Hist.Version.AccessorVI = version.Versions{version.Version{1, 1}, version.Version{1, 0}} Schema.AccountsDomain.Hist.IiCfg.Version.DataEF = version.Versions{version.Version{2, 0}, version.Version{1, 0}} Schema.AccountsDomain.Hist.IiCfg.Version.AccessorEFI = version.Versions{version.Version{2, 0}, version.Version{1, 0}} - Schema.BodiesBlock.Version.AccessorIdx = version.Versions{version.Version{1, 1}, version.Version{1, 0}} + Schema.BodiesBlock.Version.AccessorIdx = version.Versions{version.Version{2, 0}, version.Version{1, 0}} Schema.BodiesBlock.Version.DataSeg = version.Versions{version.Version{1, 1}, version.Version{1, 1}} Schema.CodeDomain.Version.AccessorBT = version.Versions{version.Version{1, 1}, version.Version{1, 0}} Schema.CodeDomain.Version.DataKV = version.Versions{version.Version{1, 1}, version.Version{1, 0}} @@ -27,7 +27,7 @@ func InitSchemasGen() { Schema.CommitmentDomain.Hist.Version.AccessorVI = version.Versions{version.Version{1, 1}, version.Version{1, 0}} Schema.CommitmentDomain.Hist.IiCfg.Version.DataEF = version.Versions{version.Version{2, 0}, version.Version{1, 0}} Schema.CommitmentDomain.Hist.IiCfg.Version.AccessorEFI = version.Versions{version.Version{2, 0}, version.Version{1, 0}} - Schema.HeadersBlock.Version.AccessorIdx = version.Versions{version.Version{1, 1}, version.Version{1, 0}} + Schema.HeadersBlock.Version.AccessorIdx = version.Versions{version.Version{2, 0}, version.Version{1, 0}} Schema.HeadersBlock.Version.DataSeg = version.Versions{version.Version{1, 1}, version.Version{1, 0}} Schema.LogAddrIdx.Version.DataEF = version.Versions{version.Version{2, 1}, version.Version{1, 0}} Schema.LogAddrIdx.Version.AccessorEFI = version.Versions{version.Version{2, 1}, version.Version{1, 0}} @@ -57,7 +57,7 @@ func InitSchemasGen() { Schema.TracesFromIdx.Version.AccessorEFI = version.Versions{version.Version{2, 1}, version.Version{1, 0}} Schema.TracesToIdx.Version.DataEF = version.Versions{version.Version{2, 1}, version.Version{1, 0}} Schema.TracesToIdx.Version.AccessorEFI = version.Versions{version.Version{2, 1}, version.Version{1, 0}} - Schema.TransactionsBlock.Version.AccessorIdx = version.Versions{version.Version{1, 1}, version.Version{1, 0}} + Schema.TransactionsBlock.Version.AccessorIdx = version.Versions{version.Version{2, 0}, version.Version{1, 0}} Schema.TransactionsBlock.Version.DataSeg = version.Versions{version.Version{1, 1}, version.Version{1, 0}} - Schema.TxnHash2BlockNumBlock.Version.AccessorIdx = version.Versions{version.Version{1, 1}, version.Version{1, 0}} + Schema.TxnHash2BlockNumBlock.Version.AccessorIdx = version.Versions{version.Version{2, 0}, version.Version{1, 0}} } diff --git a/db/state/statecfg/versions.yaml b/db/state/statecfg/versions.yaml index 32b29c9152a..5c95d285c02 100644 --- a/db/state/statecfg/versions.yaml +++ b/db/state/statecfg/versions.yaml @@ -23,6 +23,14 @@ accounts: efi: current: v2.0 min: v1.0 +bodies: + block: + idx: + current: v2.0 + min: v1.0 + seg: + current: v1.1 + min: v1.1 code: domain: bt: @@ -70,6 +78,14 @@ commitment: efi: current: v2.0 min: v1.0 +headers: + block: + idx: + current: v2.0 + min: v1.0 + seg: + current: v1.1 + min: v1.0 logaddrs: ii: ef: @@ -176,30 +192,14 @@ tracesto: min: v1.0 transactions: block: - seg: - current: v1.1 - min: v1.0 idx: - current: v1.1 - min: v1.0 -bodies: - block: - seg: - current: v1.1 - min: v1.1 - idx: - current: v1.1 + current: v2.0 min: v1.0 -headers: - block: seg: current: v1.1 min: v1.0 - idx: - current: v1.1 - min: v1.0 transactiontoblock: block: idx: - current: v1.1 - min: v1.0 \ No newline at end of file + current: v2.0 + min: v1.0