No funded issue found.
Check out the Issue Explorer
Be the OSS Funding you wish to see in the world.
Looking to fund some work? You can submit a new Funded Issue here .
Time left
Opened
Issue Type
Workers Auto Approve
Project Type
Time Commitment
Experience Level
Permissions
Accepted
Reserved For
Implement Custom SSZ Marshal/Unmarshal for Prysm Eth2 Data Structures
prysmaticlabs
Go, eth2
Hi all,
As we reach production-readiness and now handle mainnet-sized amounts of validators in our testnet, it is critical for the foundations of our codebase to become more efficient and more secure. One of the key pillars of the eth2 protocol is having a standardized serialization specification for key data structures that are communicated as raw bytes over the wire when nodes communicate via p2p. This allows all nodes implemented in different languages, such as Prysm in Go, Lighthouse in Rust, and Teku in Java to broadcast blocks between each other, attestations, and all sorts of other important data structures for consensus and ensure data integrity.
Eth2 officially uses the Simple Serialize specification as the canonical way of serializing/deserializing data to bytes in the protocol. There are, at the time of writing, approximately 23 key data structures we care about serializing/deserializing in eth2 for consensus purposes outlined in the Ethereum 2.0 phase 0 beacon chain spec [here](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#containers).
Go as a language unfortunately does not support generic types, making it really nearly impossible to implement a generic data serialization library without the use of the `reflect` [package](https://godoc.org/reflect). Additionally, using `reflect` is error prone, painful, hard to debug, and **extremely inefficient**. Currently, the Prysm project uses our own [go-ssz](https://github.com/prysmaticlabs/go-ssz) generic serialization library which is untenable for mainnet. It fails to pass fuzz tests, fails to handle proper edge cases, and is **unrealistic in terms of speed and memory usage for production**.
However, given we only care about serializing / deserializing a fixed set of data structures for consensus, we can actually create custom Serialize/Deserialize functions for the data structures used in eth2 according to the Simple Serialize (SSZ) rules found [here](https://github.com/ethereum/eth2.0-specs/blob/dev/ssz/simple-serialize.md).
As such, we're opening a bounty for a brave developer to create custom Serialize/Deserialize functions for the following 23 data structures in eth2. The goal of this issue entails successfully creating `Marshal` and `Unmarshal` functions for data structures in the list below, with the suffix being the type. For example, for `BeaconBlockBody`, the functions would have the signatures: `func MarshalBeaconBlockBody() ([]byte, error)`, and `func UnmarshalBeaconBlockBody([]byte, *ethpb.BeaconBlockBody) error`. The full list of data structures we need are defined as protobuf objects in https://github.com/prysmaticlabs/ethereumapis:
- Fork
- Checkpoint
- Validator
- AttestationData
- IndexedAttestation
- PendingAttestation
- Eth1Data
- HistoricalBatch
- DepositMessage
- DepositData
- BeaconBlockHeader
- SigningRoot
- ProposerSlashing
- AttesterSlashing
- Attestation
- Deposit
- VoluntaryExit
- BeaconBlockBody
- BeaconBlock
- BeaconState
- SignedVoluntaryExit
- SignedBeaconBlock
- SignedBeaconBlockHeader
The PR that resolves this bounty **should not use reflect** and should be as fast as possible while optimizing for memory allocations.
We are offering an extra $500 bounty to a great implementation.
Setup your profile
Tell us a little about you:
Skills
No results found for [[search]] .
Type to search skills..
Bio Required
[[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Next
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Back
Next
Save
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email:
Email
Back
Save