From d09600fdf9638cf9a3dc35aec9697b7d97cff200 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Wed, 18 Sep 2024 10:53:50 +0200 Subject: [PATCH] Revert "core/rawdb: remove unused transition status state accessors" (#30449) Reverts ethereum/go-ethereum#30433 --- core/rawdb/accessors_metadata.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/rawdb/accessors_metadata.go b/core/rawdb/accessors_metadata.go index 6996031be2..859566f722 100644 --- a/core/rawdb/accessors_metadata.go +++ b/core/rawdb/accessors_metadata.go @@ -174,3 +174,16 @@ func UpdateUncleanShutdownMarker(db ethdb.KeyValueStore) { log.Warn("Failed to write unclean-shutdown marker", "err", err) } } + +// ReadTransitionStatus retrieves the eth2 transition status from the database +func ReadTransitionStatus(db ethdb.KeyValueReader) []byte { + data, _ := db.Get(transitionStatusKey) + return data +} + +// WriteTransitionStatus stores the eth2 transition status to the database +func WriteTransitionStatus(db ethdb.KeyValueWriter, data []byte) { + if err := db.Put(transitionStatusKey, data); err != nil { + log.Crit("Failed to store the eth2 transition status", "err", err) + } +}