From f37e71bef8263c58bfbea774ba6c3950487eebb2 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Thu, 19 Dec 2024 16:09:36 -0500 Subject: [PATCH 1/3] Store genesis deposits in store --- beacon/blockchain/init_chain.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/beacon/blockchain/init_chain.go b/beacon/blockchain/init_chain.go index e3835cd2c7..37d5d32111 100644 --- a/beacon/blockchain/init_chain.go +++ b/beacon/blockchain/init_chain.go @@ -40,10 +40,23 @@ func (s *Service[ s.logger.Error("Failed to unmarshal genesis data", "error", err) return nil, err } - return s.stateProcessor.InitializePreminedBeaconStateFromEth1( + + validatorUpdates, err := s.stateProcessor.InitializePreminedBeaconStateFromEth1( s.storageBackend.StateFromContext(ctx), genesisData.GetDeposits(), genesisData.GetExecutionPayloadHeader(), genesisData.GetForkVersion(), - ) + ); err != nil { + return nil, err + } + + // After deposits are validated, store the genesis deposits in the deposit store. + if err := s.storageBackend.DepositStore().EnqueueDeposits( + genesisData.GetDeposits(), + ); err != nil { + return nil, err + } + + return validatorUpdates, nil } + From 2a70e1b359416a422405d588a8f13fbdc61eb89b Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Thu, 19 Dec 2024 16:11:37 -0500 Subject: [PATCH 2/3] build --- beacon/blockchain/init_chain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beacon/blockchain/init_chain.go b/beacon/blockchain/init_chain.go index 37d5d32111..fad70a3c5f 100644 --- a/beacon/blockchain/init_chain.go +++ b/beacon/blockchain/init_chain.go @@ -46,7 +46,8 @@ func (s *Service[ genesisData.GetDeposits(), genesisData.GetExecutionPayloadHeader(), genesisData.GetForkVersion(), - ); err != nil { + ) + if err != nil { return nil, err } @@ -59,4 +60,3 @@ func (s *Service[ return validatorUpdates, nil } - From 9b7bb68049f9a1645670e62a7f228eb835833411 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Thu, 19 Dec 2024 16:12:19 -0500 Subject: [PATCH 3/3] lint --- beacon/blockchain/init_chain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon/blockchain/init_chain.go b/beacon/blockchain/init_chain.go index fad70a3c5f..15c68a9bb7 100644 --- a/beacon/blockchain/init_chain.go +++ b/beacon/blockchain/init_chain.go @@ -52,7 +52,7 @@ func (s *Service[ } // After deposits are validated, store the genesis deposits in the deposit store. - if err := s.storageBackend.DepositStore().EnqueueDeposits( + if err = s.storageBackend.DepositStore().EnqueueDeposits( genesisData.GetDeposits(), ); err != nil { return nil, err