From f37e71bef8263c58bfbea774ba6c3950487eebb2 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Thu, 19 Dec 2024 16:09:36 -0500 Subject: [PATCH] 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 } +