mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 08:37:37 +00:00
Use head state only for bls messages broadcast (#11949)
* Use head state only for bls messages broadcast * Fix build --------- Co-authored-by: Nishant Das <nishdas93@gmail.com>
This commit is contained in:
parent
b10e59a144
commit
59cb9f0dd7
@ -201,7 +201,7 @@ func BLSChangesSignatureBatch(
|
|||||||
// It validates the signature with the Capella fork version if the passed state
|
// It validates the signature with the Capella fork version if the passed state
|
||||||
// is from a previous fork.
|
// is from a previous fork.
|
||||||
func VerifyBLSChangeSignature(
|
func VerifyBLSChangeSignature(
|
||||||
st state.BeaconState,
|
st state.ReadOnlyBeaconState,
|
||||||
change *ethpbv2.SignedBLSToExecutionChange,
|
change *ethpbv2.SignedBLSToExecutionChange,
|
||||||
) error {
|
) error {
|
||||||
c := params.BeaconConfig()
|
c := params.BeaconConfig()
|
||||||
|
@ -315,7 +315,7 @@ func (bs *Server) SubmitVoluntaryExit(ctx context.Context, req *ethpbv1.SignedVo
|
|||||||
func (bs *Server) SubmitSignedBLSToExecutionChanges(ctx context.Context, req *ethpbv2.SubmitBLSToExecutionChangesRequest) (*emptypb.Empty, error) {
|
func (bs *Server) SubmitSignedBLSToExecutionChanges(ctx context.Context, req *ethpbv2.SubmitBLSToExecutionChangesRequest) (*emptypb.Empty, error) {
|
||||||
ctx, span := trace.StartSpan(ctx, "beacon.SubmitSignedBLSToExecutionChanges")
|
ctx, span := trace.StartSpan(ctx, "beacon.SubmitSignedBLSToExecutionChanges")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
st, err := bs.ChainInfoFetcher.HeadState(ctx)
|
st, err := bs.ChainInfoFetcher.HeadStateReadOnly(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Errorf(codes.Internal, "Could not get head state: %v", err)
|
return nil, status.Errorf(codes.Internal, "Could not get head state: %v", err)
|
||||||
}
|
}
|
||||||
@ -372,7 +372,7 @@ func (bs *Server) broadcastBLSBatch(ctx context.Context, ptr *[]*ethpbalpha.Sign
|
|||||||
if len(changes) < broadcastBLSChangesRateLimit {
|
if len(changes) < broadcastBLSChangesRateLimit {
|
||||||
limit = len(changes)
|
limit = len(changes)
|
||||||
}
|
}
|
||||||
st, err := bs.ChainInfoFetcher.HeadState(ctx)
|
st, err := bs.ChainInfoFetcher.HeadStateReadOnly(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Error("could not get head state")
|
log.WithError(err).Error("could not get head state")
|
||||||
return
|
return
|
||||||
|
@ -49,7 +49,7 @@ func (s *Service) broadcastBLSBatch(ctx context.Context, ptr *[]*ethpb.SignedBLS
|
|||||||
if len(changes) < broadcastBLSChangesRateLimit {
|
if len(changes) < broadcastBLSChangesRateLimit {
|
||||||
limit = len(changes)
|
limit = len(changes)
|
||||||
}
|
}
|
||||||
st, err := s.cfg.chain.HeadState(ctx)
|
st, err := s.cfg.chain.HeadStateReadOnly(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Error("could not get head state")
|
log.WithError(err).Error("could not get head state")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user