Skip to content

Refactor beacon client#816

Merged
yrong merged 12 commits intomainfrom
refactor-beacon-client
May 1, 2023
Merged

Refactor beacon client#816
yrong merged 12 commits intomainfrom
refactor-beacon-client

Conversation

@vgeddes
Copy link
Collaborator

@vgeddes vgeddes commented Apr 27, 2023

Lots of cleanups & improvements, mainly around data structures.

For example, its not really necessary to for data structures to use generic types such as MaxFeeRecipientSize, MaxPubKeySize MaxSignatureSize, since those will always be 20, 48, and 96 respectively. These constants are very unlikely to change.

  • BoundedVec is only needed for collections that are being written to storage. Otherwise, Vec is fine.
  • Data structures only need have generic parameters for SyncCommitteeSize and SyncCommitteeBitsSize where needed.
  • SyncCommittee.pubkeys is now a fixed array instead a vector, since the size of the sync committee is known statically.
  • SyncAggregate.sync_committee_bits is now a fixed array instead a vector, since the size of the sync committee is known statically.
  • Converting data types to the SSZ form can be done without raising errors. So I replaced TryFrom with From in many cases.

@yrong
Copy link
Contributor

yrong commented Apr 28, 2023

@vgeddes Nice refactoring! Just a minor fix and some polish in #817

* Fix for benchmark & More refactoring

* More refactoring

* Add const_assert back
Copy link
Contributor

@yrong yrong left a comment

Choose a reason for hiding this comment

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

LGTM!

@yrong yrong merged commit cabadce into main May 1, 2023
@yrong yrong deleted the refactor-beacon-client branch May 1, 2023 12: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.

2 participants