Skip to content

Conversation

@0xmrree
Copy link
Contributor

@0xmrree 0xmrree commented Jan 7, 2026

Description

In the spec there are several config values that are simple calculations of other config values. An example is ATTESTATION_SUBNET_PREFIX_BITS which is equal to ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS. Having ATTESTATION_SUBNET_PREFIX_BITS be its own config causes ambiguity in the behavior of clients if the prefix bits does not equal the formula.

For more details: #4799

As a result this PR converts ATTESTATION_SUBNET_PREFIX_BITS, MAX_REQUEST_BLOB_SIDECARS_ELECTRA, MAX_REQUEST_DATA_COLUMN_SIDECARS, and MAX_REQUEST_BLOB_SIDECARS to helper methods like compute_max_request_blob_sidecars etc.

Testing

ran make test fork=fulu make test fork=electra, make test fork=deneb, and make test fork=phase0

ssz_objects = spec_object.ssz_objects
for name, value in spec_object.custom_types.items():
if any(k in name for k in all_config_dependencies):
if any(name in k for k in all_config_dependencies):
Copy link
Member

Choose a reason for hiding this comment

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

Note, this was a bug in the spec generator & this change fixes it.

See: #4799 (comment)

@0xmrree 0xmrree requested a review from jtraglia January 12, 2026 04:46
Copy link
Member

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

LGTM, I think this would be a nice simplification.

I'll need to see support from others before merging though.

@jtraglia jtraglia requested a review from jihoonsong January 21, 2026 18:15
@jihoonsong
Copy link
Member

jihoonsong commented Jan 22, 2026

IIUC, this PR aims to replace composite configs with helpers. Do we also want to replace all such configs? For instance, this one remains.

Other than that, the change itself looks good to me, but as a minor request, I would like to learn what client devs think about this refactor.

@jtraglia
Copy link
Member

Do we also want to replace all such configs? For instance, this one remains.

Ah good catch, I missed this. Yes, we should replace this one too.

I would like to learn what client devs think about this refactor.

Yes, me too. We shouldn't merge this without their approvals.

Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

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

seems like a good change, in general it doesn't make much sense to have values in config that are supposed to be derived from other values in config

@leolara leolara added testing CI, actions, tests, testing infra specs and removed specs labels Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing CI, actions, tests, testing infra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants