Skip to content

refactor(eth2api): making only 1 DataVersion and BuilderVersion#288

Merged
iamquang95 merged 2 commits intomainfrom
iamquang95/refactor/version
Mar 20, 2026
Merged

refactor(eth2api): making only 1 DataVersion and BuilderVersion#288
iamquang95 merged 2 commits intomainfrom
iamquang95/refactor/version

Conversation

@iamquang95
Copy link
Collaborator

Remove the DataVersion and BuilderVersion in eth2util.

@iamquang95 iamquang95 marked this pull request as ready for review March 18, 2026 08:39
@emlautarom1
Copy link
Collaborator

Could you elaborate on what has changed? How is it that we can merge these two types?

@iamquang95
Copy link
Collaborator Author

@emlautarom1, previously in the signeddata PR, I ported both DataVersion / BuilderVersion definitions from Charon: one from go-eth2-api and one from eth2util. The eth2util copy existed because signeddata still uses the legacy numeric serialization format for these fields.

This PR removes that duplication. We now keep a single canonical version type in eth2api, and preserve the legacy signeddata encoding through serde helpers rather than through a separate enum type.

The main benefit is that it reduces the amount of version/conversion logic we need to maintain. We no longer need to keep two nearly identical types in sync, and any new serialization behavior can now be introduced in one place.

Copy link
Collaborator

@emlautarom1 emlautarom1 left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation. LGTM.

@iamquang95 iamquang95 merged commit ed71780 into main Mar 20, 2026
14 checks passed
@iamquang95 iamquang95 deleted the iamquang95/refactor/version branch March 20, 2026 06:12
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