From f7079322cf5b3daa61d6e897832fcf3991cf5c99 Mon Sep 17 00:00:00 2001 From: Yordan Atanasov Date: Wed, 15 Jan 2025 17:58:30 +0200 Subject: [PATCH 1/2] fix: Remove post construct annotation which breaks node startup. --- src/main/java/com/limechain/grandpa/state/RoundState.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/com/limechain/grandpa/state/RoundState.java b/src/main/java/com/limechain/grandpa/state/RoundState.java index d185204b..e34f0b16 100644 --- a/src/main/java/com/limechain/grandpa/state/RoundState.java +++ b/src/main/java/com/limechain/grandpa/state/RoundState.java @@ -8,7 +8,6 @@ import com.limechain.storage.KVRepository; import com.limechain.storage.StateUtil; import io.libp2p.core.crypto.PubKey; -import jakarta.annotation.PostConstruct; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; @@ -43,8 +42,6 @@ public class RoundState { private Map pvEquivocations = new ConcurrentHashMap<>(); private Map pcEquivocations = new ConcurrentHashMap<>(); - - @PostConstruct public void initialize() { loadPersistedState(); } From 72cb3f632f407d0f9450bafcccce241bfd2ac362 Mon Sep 17 00:00:00 2001 From: Yordan Atanasov Date: Wed, 15 Jan 2025 18:02:57 +0200 Subject: [PATCH 2/2] fix: Reorder grandpa state db field load. --- src/main/java/com/limechain/grandpa/state/RoundState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/limechain/grandpa/state/RoundState.java b/src/main/java/com/limechain/grandpa/state/RoundState.java index e34f0b16..64497a19 100644 --- a/src/main/java/com/limechain/grandpa/state/RoundState.java +++ b/src/main/java/com/limechain/grandpa/state/RoundState.java @@ -112,9 +112,9 @@ public Map fetchPrecommits() { } private void loadPersistedState() { - this.authorities = Arrays.asList(fetchGrandpaAuthorities()); this.setId = fetchAuthoritiesSetId(); this.roundNumber = fetchLatestRound(); + this.authorities = Arrays.asList(fetchGrandpaAuthorities()); this.precommits = fetchPrecommits(); this.prevotes = fetchPrevotes(); }