Skip to content

fix: preserve initial validator count on Bradbury - #234

Open
amukkane wants to merge 1 commit into
genlayerlabs:v1from
amukkane:codex/fix-initial-validator-count
Open

amukkane wants to merge 1 commit into
genlayerlabs:v1from
amukkane:codex/fix-initial-validator-count

Conversation

@amukkane

Copy link
Copy Markdown

Fixes #231

What

  • populate numOfInitialValidators from the authoritative transaction returned by the existing getTransactionAllData call
  • stop treating initialRotations as an alias for the validator count
  • correct the raw transaction field documentation
  • add regression cases with five validators and both zero and three initial rotations

Why

Bradbury's projected getTransactionData response does not include numOfInitialValidators. The SDK currently substitutes initialRotations, but these are independent protocol values. As a result, a transaction created with five validators and zero rotations is reported as having zero validators, which makes committee diagnostics and monitoring inaccurate.

The full transaction is already fetched in parallel, so this fix uses its stored validator count without adding an RPC request.

Testing done

Decisions made

  • The stored getTransactionAllData().numOfInitialValidators value is preferred because it is the actual validator count; the projected value remains a compatibility fallback.
  • initialRotations remains represented in the raw type, but is no longer used as a validator-count alias.

Checks

  • I have tested this code
  • I have reviewed my own PR
  • I have created an issue for this PR
  • I have set a descriptive PR title compliant with conventional commits

Reviewing tips

The functional change is the single merge field in getTransaction; the decoder change removes the incorrect semantic alias. The parameterized test demonstrates that changing rotations does not change the reported validator count.

User facing release notes

getTransaction() now reports the correct initial validator count on Bradbury instead of substituting the leader-rotation setting.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1d2cc7bd-4c09-4316-9d56-f49995c67e29

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

2 participants