Deprecate db.HeadState (#7653)

* Deprecate db.HeadState

* Deprecate db.HeadState
This commit is contained in:
Preston Van Loon 2020-10-27 11:25:52 -05:00 committed by GitHub
parent 21c5ba8ed8
commit 424488bf8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -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)
}

View File

@ -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()