Skip to content

Commit

Permalink
Added EnqueueDeposits
Browse files Browse the repository at this point in the history
  • Loading branch information
rezbera committed Feb 9, 2025
1 parent 6f79037 commit 07334a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion state-transition/core/state_processor_staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func (sp *StateProcessor) processOperations(
); err != nil {
return err
}
} else {
// If we're not validating the deposits, we want to add the deposits to our Deposit Store to keep it up to date.
err := sp.ds.EnqueueDeposits(ctx.ConsensusCtx(), deposits)
if err != nil {
return err
}
}

for _, dep := range deposits {
Expand All @@ -80,7 +86,6 @@ func (sp *StateProcessor) processDeposit(st *state.StateDB, dep *ctypes.Deposit)
if err != nil {
return err
}

if err = st.SetEth1DepositIndex(eth1DepositIndex + 1); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion storage/deposit/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (kv *KVStore) GetDepositsByIndex(
return deposits, nil
}

// EnqueueDeposits pushes multiple deposits to the queue.
// EnqueueDeposits pushes multiple deposits to the queue. EnqueueDeposits is idempotent.
func (kv *KVStore) EnqueueDeposits(ctx context.Context, deposits []*ctypes.Deposit) error {
kv.mu.Lock()
defer kv.mu.Unlock()
Expand Down

0 comments on commit 07334a4

Please sign in to comment.