Skip to content

feat(pbs): add retry limit for validator registration (#316) #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bhakiyakalimuthu
Copy link
Contributor

@bhakiyakalimuthu bhakiyakalimuthu commented Jun 4, 2025

📝 Description

This PR resolves #316 by introducing a configurable retry limit for validator registration requests. The goal is to prevent unnecessary network traffic, reduce load on relays, and avoid log clutter caused by excessive retries on client-side errors (e.g., 400, 429).

💡 Motivation and Context

if a relay responded with errors like 400 (unknown validator) or 429 (too many requests), client would keep retrying continously. This PR adds a limit to those retries to avoid putting unnecessary load on relays and to keep the logs clean.

What is Included

  • Introduced register_validator_retry_limit to PbsConfig (default = 3)
  • Used this field in send_register_validator_with_timeout to cap total attempts
  • Updated retry logic to perform: max retry < retry_limit
  • Ensured retry count is passed and logged in each attempt
  • Maintained existing structure and logging patterns
  • Added test to verify both 429 and 500 error cases

Behavior

  • With register_validator_retry_limit = 3:
  • Total of 3 request attempts allowed: retry = 0, 1, 2
  • On retry = 3, aborts with logged error

Issue
Closes #316

Copy link
Collaborator

@ltitanb ltitanb left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for the PR! Left a small suggestion + lint check failed

@bhakiyakalimuthu bhakiyakalimuthu force-pushed the feat/register-validator-retry-limit branch from abb4fd0 to 029b664 Compare June 9, 2025 18:53
@bhakiyakalimuthu bhakiyakalimuthu changed the title Add retry limit for validator registration (#316) feat(pbs): add retry limit for validator registration (#316) Jun 9, 2025
@bhakiyakalimuthu bhakiyakalimuthu requested a review from ltitanb June 9, 2025 20:29
Copy link
Collaborator

@ltitanb ltitanb left a comment

Choose a reason for hiding this comment

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

looks great, thanks for the PR!

@ltitanb ltitanb merged commit 31dfa81 into Commit-Boost:main Jun 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Add new config parameter to set retry count for registration validators on relays
2 participants