Skip to content
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

Migrate all schemas in AbstractSchemaDefinitions #8726

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

tbenr
Copy link
Contributor

@tbenr tbenr commented Oct 14, 2024

To make provider type more more explicit, I added specific constantProviderBuilder and variableProviderBuilder

related to #8588

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

@@ -33,6 +35,13 @@ public class SchemaTypes {
// PHASE0
public static final SchemaId<SszBitvectorSchema<SszBitvector>> ATTNETS_ENR_FIELD_SCHEMA =
create("ATTNETS_ENR_FIELD_SCHEMA");
public static final SchemaId<SszBitvectorSchema<SszBitvector>> SYNCNETS_ENR_FIELD_SCHEMA =
create("SYNCNETS_ENR_FIELD_SCHEMA");
Copy link
Contributor

Choose a reason for hiding this comment

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

are we going to reference by strings elsewhere? Wonder if we should use const's or an enum or something so that we're not typing the string a bunch if we are

Copy link
Contributor Author

@tbenr tbenr Oct 15, 2024

Choose a reason for hiding this comment

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

Ths string are not referenced elsewhere, they are just used internally (they are exposed in error logs to be able to identify where the error is in the schema definitions)
It is not possible to move to an enum (at least i haven't found any good alternative) since we need to capture the type here.

I attempted this trick to move the string as an enum but it doesn't not worth it IMO.
image

Btw strings are enforced to be equal to the const via unit test.

Copy link
Contributor

@zilm13 zilm13 left a comment

Choose a reason for hiding this comment

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

LGTM

@tbenr tbenr enabled auto-merge (squash) October 15, 2024 15:36
@tbenr tbenr merged commit b50adc4 into Consensys:master Oct 15, 2024
16 of 17 checks passed
@tbenr tbenr deleted the additional-schemas-in-registry branch October 16, 2024 07:50
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.

3 participants