This dev update notes down preliminary work and study done to kickstart my journey into protocol development. It involves contributions to Prysm and a writeup on rollups/rollup-centric initiatives. It ends off with my plan ahead for the future.
When Prysm first started, the team adopted gPRC as the API layer for inter-process communication, represented by the communication between gRPC Client
and gRPC server (v1alpha1)
.
The official beacon API specification was later formalized and Prysm exposed a set of HTTP endpoints by using grpc-gateway
to allow other implementations of validator clients to query Prysm's beacon chain server.
There were two main issues with this architecture:
gRPC gateway
.The team plans to gradually deprecate the gRPC implementation and use HTTP implementation going forward for client interoperability.
The work contributed by cohort three resulted in Prysm's validator client to have HTTP client support. This means that anyone using Prysm's validator client can now use the HTTP protocol to query any beacon chain servers, including those implemented by other client teams.
There is still work left to be done to complete the entire migration to HTTP implementation, for example:
grpc-gateway
To familiarize myself with Prysm, I contributed a PR to implement the expected withdrawals API and was glad that team gave positive feedback for it!
Knowing that the team intends to introduce new beacon API endpoints using the HTTP implementation, I made sure to do that instead of implementing it the usual way via gRPC.
My main takeaways from working on this PR are:
process_slots
function that is used to advance the current state to a future state. In the process_slots
function, an epoch transition triggered by the process_epoch
function will change the result of the expected withdrawals, providing an estimate of what the expected withdrawals are if the proposed slot crosses the epoch boundary.Prysm's implementation currently only supports up to SLOTS_PER_HISTORICAL_ROOT
(8192) states for APIs that take in an arbitary state root.
My next PR involves storing a state root to block root mapping in Prysm's database to support arbitrary state root to beacon state object resolution.
My main takeaways from working on this PR are:
state.latest_block_header.state_root
is set to Bytes32()
during process_block
and updated with the actual state_root
value later in the next process_slot
call. This logic was introduced to avoid circular dependency when verifying the state transition of the block applied to the current state.process_slot
function and process_block
function in the BC-STF. This means that the client can run process_slot
and process_block
separately, independent of the block arrival time. This is useful as late block arrivals would delay the BC-STF process, especially on the beginning of the epoch where epoch processing time is non-negligible.Most client teams are preparing for the Cancun-Deneb upgrade now with Proto-Danksharding (EIP-4844) being the key factor to scale Ethereum. To understand the status quo and put myself in the shoes of core developers, I took a stab at writing an article about rollups and rollup-centric initiatives. To satisfy my curiosity, I dug into the code for the various client implementations and attached code snippets to complement what I read.
Writing this article solidified my understanding on the scalability of Ethereum in the past, present and future when Danksharding is completed.
I am particular interested in PBS and am excited to work on the ePBS Design and Prototyping project proposed by the Prysm team. I am currently doing literature review on ePBS material and connected with mentors to discuss on this project. Stay tuned for the next update!