This is the final dev update for robzajac in EPF cohort three.
The light client protocol is a way for nodes in low-computation environments to sync to the latest block header without needing to trust a third party. It is built on the introduction of the sync committee in Altair, a randomly selected set of 512 validators (rotating every 256 epochs) which signs the headers of newly attested blocks.
The goal of this project was to implement support for the light client APIs in the consensus client teku. These APIs are the method by which light clients poll the data required to participate in their sync protocol. A secondary goal was to make progress in the research area of node RPC incentivization or otherwise design a way to incentivize the serving of light client data.
More information on light clients can be found in the original project proposal.
In the project proposal, I specified the following goals:
Below is the progress made towards those goals. Please also refer to the tracking issue in teku.
GetLightClientBootstrap
GetLightClientBootstrap
GetLightClientUpdatesByRange
GetLightClientFinalityUpdate
GetLightClientOptimisticUpdate
Given the complexity of this research area, I did not make headway into designing a new incentivization mechanism. However, the data served for light clients is cheap, and nodes may choose to serve it altruistically for the timebeing. There a few other takeaways:
Based on the current status of the project, I have a few suggestions for how to go forward.
While implementing light client updates, we realized that querying for historic states to construct light client data would have several disadvantages:
is_better_update
Therefore, the best way forward is to refactor to read from a light client table. We would introduce new columns to store LightClientBootstrap
and LightClientUpdate
, and populate the data as we sync the chain. This has the advantages of:
Based on these changes, an updated roadmap would look like:
GetLightClientBootstrap
and GetLightClientUpdatesByRange
to read from tableGetLightClientFinalityUpdate
and GetLightClientOptimisticUpdate
In this EPF cohort, I learned a great deal about programming for the Ethereum blockchain, working in a core dev environment, and my own skills as a software engineer.
In the beginning, I wrote an ambitious plan for implementing the light client API endpoints in teku. Down the road, it turned out there was a lot to learn about the details of the Ethereum consensus layer, the internals of the teku implementation, the details of the light client sync protocol, and many other pieces.
Ultimately, we wrote an implementation of the API that relies on retrieving historic beacon states and computing light client data from them. We learned that this wouldn't be the best implementation going forward, and that teku is best served moving towards a light client table. For this updated roadmap we wrote a design doc and a plan for how to proceed.
I learned a lot about what it takes to plan and execute a large project independently, as well as how unexpected complexity can creep up and how to deal with it. I feel more confident going forward with my ability to tackle large software projects and bring them through to fruition.
I benefitted greatly from the structure of the cohort and the EPF program. I appreciated sharing the experience with other EPF fellows from whom I could draw inspiration, and from collaborating with my teku mentor Paul Harris. I felt that the program was incredibly well-organized and that it was an awesome way to learn the details of core dev.
I learned a lot about what kind of environments I function in best as a software engineer. While I appreciated having the freedom and flexibility of working independently and scoping my own project in core dev, I learned that ultimately I would benefit from having a team around me with whom I could share ideas and drive a project forward. I learned that I benefit from the structure of a more traditional software company, and that with freedom and flexiblity there also come the tradeoffs of greater responsibility and self-direction. I feel more informed and more confident going forward with seeking environments that best support my creativity and productivity in writing software.
I would like to thank the cohort organizers Mario Havel and Josh Davis for an incredibly well-run program that gave great insight into working on Ethereum core dev. I'd also like to thank my mentor Paul Harris for his excellent technical support and brainstorming around teku. Finally, I'd like to thank the EPF fellows for creating a supportive and inspiring environment. I'm endlessly grateful for the opportunity to participate in this cohort, and I'm looking forward to seeing what comes next for the program fellows and for the Ethereum blockchain.