From eda6bc43ecbaa26fbfe0b080ccb474fdf356236d Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Mon, 2 Feb 2026 13:09:12 +0100 Subject: [PATCH] touch-ups --- internal/era/era.go | 4 ++-- internal/era/execdb/reader.go | 3 ++- internal/era/proof.go | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/era/era.go b/internal/era/era.go index b32e6094a5..ed481c810e 100644 --- a/internal/era/era.go +++ b/internal/era/era.go @@ -114,7 +114,7 @@ type Era interface { Accumulator() (common.Hash, error) } -// ReadDir reads all the era1 files in a directory for a given network. +// ReadDir reads all the era files in a directory for a given network. // Format: --.erae or --.era1 func ReadDir(dir, network string) ([]string, error) { entries, err := os.ReadDir(dir) @@ -137,7 +137,7 @@ func ReadDir(dir, network string) ([]string, error) { } parts := strings.Split(entry.Name(), "-") if len(parts) != 3 || parts[0] != network { - // Invalid era1 filename, skip. + // Invalid era filename, skip. continue } if epoch, err := strconv.ParseUint(parts[1], 10, 64); err != nil { diff --git a/internal/era/execdb/reader.go b/internal/era/execdb/reader.go index 76c510521d..cbc276f847 100644 --- a/internal/era/execdb/reader.go +++ b/internal/era/execdb/reader.go @@ -251,6 +251,7 @@ func (e *Era) headerOff(num uint64) (int64, error) { return e.indexOffset(num, func (e *Era) bodyOff(num uint64) (int64, error) { return e.indexOffset(num, body) } func (e *Era) receiptOff(num uint64) (int64, error) { return e.indexOffset(num, receipts) } func (e *Era) tdOff(num uint64) (int64, error) { return e.indexOffset(num, td) } +func (e *Era) proofOff(num uint64) (int64, error) { return e.indexOffset(num, proof) } // indexOffset calculates offset to a certain component for a block number within a file. func (e *Era) indexOffset(n uint64, component componentType) (int64, error) { @@ -286,7 +287,7 @@ type metadata struct { // componentType represents the integer form of a specific type that can be present in the era file. type componentType int -// TypeCompressedHeader, TypeCompressedBody, TypeCompressedReceipts, TypeTotalDifficulty, and TypeProof are the different types of components that can be present in the era file. +// header, body, receipts, td, and proof are the different types of components that can be present in the era file. const ( header componentType = iota body diff --git a/internal/era/proof.go b/internal/era/proof.go index 873dfef40a..464d9e6fe5 100644 --- a/internal/era/proof.go +++ b/internal/era/proof.go @@ -27,10 +27,10 @@ const ( ProofNone ProofVariant = iota ) -// Proof is the interface for all block proof types in the package. +// Proof is the interface for all block proof types in the package. // It's a stub for later integration into Era. type Proof interface { EncodeRLP(w io.Writer) error - DecodeRlP(s *rlp.Stream) error + DecodeRLP(s *rlp.Stream) error Variant() ProofVariant }