Skip to content

throw 503 error when submit attestation and sync committee are called on syncing node + align changes to gRPC - #16152

Merged
james-prysm merged 9 commits into
developfrom
align-atter-pool-apis
Dec 18, 2025
Merged

throw 503 error when submit attestation and sync committee are called on syncing node + align changes to gRPC#16152
james-prysm merged 9 commits into
developfrom
align-atter-pool-apis

Conversation

@james-prysm

@james-prysm james-prysm commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

Prysm starting throwing this error Could not write response message" error="write tcp 10.104.92.212:5052->10.104.92.196:41876: write: broken pipe because a validator got attestation data from a synced node and submitted attestation to a syncing node, when the node couldn't replay the state the validator context deadlined and disconnected but the writer when it finally responded tries to write it gets this broken pipe error.

applies to /eth/v2/beacon/pool/attestations and /eth/v1/beacon/pool/sync_committees

the solution is 2 part.

  1. we shouldn't allow submission of an attestation if the node is syncing because we can't save the attestation without the state information.
  2. we were doing the expensive state call before broadcast before in rest and now it should match gRPC where it happens afterward in its own go routine.

Tested manually running kurtosis with rest validators

participants:
 # Super-nodes
 - el_type: nethermind
   cl_type: prysm
   cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
   count: 2
   supernode: true
   cl_extra_params:
     - --subscribe-all-subnets
     - --verbosity=debug
   vc_extra_params:
     - --enable-beacon-rest-api
     - --verbosity=debug

 # Full-nodes
 - el_type: nethermind
   cl_type: prysm
   cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
   validator_count: 63
   cl_extra_params:
     - --verbosity=debug
   vc_extra_params:
     - --enable-beacon-rest-api
     - --verbosity=debug

 - el_type: nethermind
   cl_type: prysm
   cl_image: gcr.io/offchainlabs/prysm/beacon-chain:latest
   cl_extra_params:
     - --verbosity=debug
   vc_extra_params:
     - --enable-beacon-rest-api
     - --verbosity=debug
   validator_count: 13

additional_services:
 - dora
 - spamoor

spamoor_params:
 image: ethpandaops/spamoor:master
 max_mem: 4000
 spammers:
   - scenario: eoatx
     config:
       throughput: 200
   - scenario: blobs
     config:
       throughput: 20

network_params:
  fulu_fork_epoch: 2
  bpo_1_epoch: 8
  bpo_1_max_blobs: 21
  withdrawal_type: "0x02"
  preset: mainnet
  seconds_per_slot: 6

global_log_level: debug

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have included a uniquely named changelog fragment file.
  • I have added a description with sufficient context for reviewers to understand this PR.
  • I have tested that my changes work as expected and I added a testing plan to the PR description (if applicable).

@james-prysm james-prysm changed the title Align atter pool apis throw 503 error submit attestation gets called on syncing node + align changes to gRPC Dec 17, 2025
@james-prysm
james-prysm marked this pull request as ready for review December 17, 2025 21:53
ctx, span := trace.StartSpan(r.Context(), "beacon.SubmitPoolSyncCommitteeSignatures")
defer span.End()

if shared.IsSyncing(ctx, w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should i break this out? this is for /eth/v1/beacon/pool/sync_committees

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the sync commitee cache should also be checked here

@james-prysm james-prysm changed the title throw 503 error submit attestation gets called on syncing node + align changes to gRPC throw 503 error submit attestation and sync committee gets called on syncing node + align changes to gRPC Dec 17, 2025
@james-prysm james-prysm changed the title throw 503 error submit attestation and sync committee gets called on syncing node + align changes to gRPC throw 503 error when submit attestation and sync committee are called on syncing node + align changes to gRPC Dec 17, 2025
} else {
if err = s.AttestationsPool.SaveUnaggregatedAttestation(att); err != nil {
log.WithError(err).Error("Could not save attestation")
committee, err := corehelpers.BeaconCommitteeFromState(context.Background(), targetState, singleAtt.Data.Slot, singleAtt.CommitteeId)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed context to background so that it doesn't get context deadlined

}
}
}
}(broadcastedAttestations)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try saving all validAttestations, not just broadcasted ones. Also there is no need for the goroutine to have a parameter, you can loop over validAttestations inside the goroutine

go func() {
attCopy := att.Copy()
go func() {
attCopy := att.Copy()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the copy to the else branch, just as it was originally? The experimental pool doesn't need it

@james-prysm
james-prysm added this pull request to the merge queue Dec 18, 2025
Merged via the queue into develop with commit 6634265 Dec 18, 2025
18 checks passed
@james-prysm
james-prysm deleted the align-atter-pool-apis branch December 18, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants