diff --git a/beacon-chain/db/iface/interface.go b/beacon-chain/db/iface/interface.go index 908f41f25..a2bb8709b 100644 --- a/beacon-chain/db/iface/interface.go +++ b/beacon-chain/db/iface/interface.go @@ -94,6 +94,8 @@ type HeadAccessDatabase interface { HeadBlock(ctx context.Context) (*eth.SignedBeaconBlock, error) SaveHeadBlockRoot(ctx context.Context, blockRoot [32]byte) error // State related methods. + // Deprecated: This method may return nil. Prefer to use HighestSlotStatesBelow or + // blockchain.HeadFetcher.HeadState(). HeadState(ctx context.Context) (*state.BeaconState, error) } diff --git a/beacon-chain/db/kv/state.go b/beacon-chain/db/kv/state.go index 2692962db..23c99f773 100644 --- a/beacon-chain/db/kv/state.go +++ b/beacon-chain/db/kv/state.go @@ -36,6 +36,8 @@ func (s *Store) State(ctx context.Context, blockRoot [32]byte) (*state.BeaconSta } // HeadState returns the latest canonical state in beacon chain. +// Deprecated: This method may return nil. Prefer to use HighestSlotStatesBelow +// or blockchain.HeadFetcher.HeadState(). func (s *Store) HeadState(ctx context.Context) (*state.BeaconState, error) { ctx, span := trace.StartSpan(ctx, "BeaconDB.HeadState") defer span.End()