diff --git a/changelog/potuz_domain_data_context.md b/changelog/potuz_domain_data_context.md new file mode 100644 index 0000000000..0db41da68c --- /dev/null +++ b/changelog/potuz_domain_data_context.md @@ -0,0 +1,3 @@ +### Ignored + +- Use independent context for domain data calculation. diff --git a/testing/endtoend/evaluators/fee_recipient.go b/testing/endtoend/evaluators/fee_recipient.go index c2f43c5642..0fc07a220a 100644 --- a/testing/endtoend/evaluators/fee_recipient.go +++ b/testing/endtoend/evaluators/fee_recipient.go @@ -72,7 +72,11 @@ func feeRecipientIsPresent(_ *types.EvaluationContext, conns ...*grpc.ClientConn if err != nil { return errors.Wrap(err, "failed to get chain head") } - req := ðpb.ListBlocksRequest{QueryFilter: ðpb.ListBlocksRequest_Epoch{Epoch: chainHead.HeadEpoch.Sub(1)}} + epoch := chainHead.HeadEpoch + if epoch > 0 { + epoch-- + } + req := ðpb.ListBlocksRequest{QueryFilter: ðpb.ListBlocksRequest_Epoch{Epoch: epoch}} blks, err := client.ListBeaconBlocks(context.Background(), req) if err != nil { return errors.Wrap(err, "failed to list blocks") diff --git a/validator/client/runner.go b/validator/client/runner.go index 4121fd36e5..f526775a30 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -119,7 +119,8 @@ func run(ctx context.Context, v iface.Validator) { // Start fetching domain data for the next epoch. if slots.IsEpochEnd(slot) { - go v.UpdateDomainDataCaches(slotCtx, slot+1) + domainCtx, _ := context.WithDeadline(ctx, deadline) + go v.UpdateDomainDataCaches(domainCtx, slot+1) } var wg sync.WaitGroup @@ -131,7 +132,10 @@ func run(ctx context.Context, v iface.Validator) { cancel() continue } - performRoles(slotCtx, allRoles, v, slot, &wg, span) + cancel() + // performRoles calls span.End() + rolesCtx, _ := context.WithDeadline(ctx, deadline) + performRoles(rolesCtx, allRoles, v, slot, &wg, span) case isHealthyAgain := <-healthTracker.HealthUpdates(): if isHealthyAgain { headSlot, err = initializeValidatorAndGetHeadSlot(ctx, v)