This is a PoC implementation for Superlight Client for Ethereum. The light client specified by the Ethereum PoS Consesnsus takes linear storage/time complexity w.r.t to the chain size to sync. The superlight client proposed in this repo can sync to the latest header in poly log complexity which is exponentially better that the state of art. This is acheived based on interactive bisections games.
This repo serves as an implementation for the Bachelors Thesis by Shresth Agrawal. The protocol implemented in this repo is an extention to an unpublished work by Dionysis Zindros called "Proofs of Proof of Stake in Sublinear Complexity".
The benchmark tries to compare light client implementation with the super light client implementation in terms of time to sync, data downloaded and interactions.
Following were the benchmark setup:
Benchmarks on BeaconChain data with 155 sync committee periods, 8 provers
Implementation | Time To Sync | Data Downloaded | Interactions |
---|---|---|---|
Light Client | 110.72 ± 7.00s | 16.83 ± 0.21MB | 159.60 ± 1.96 |
Superlight Client | 62.63 ± 0.85s | 2.29 ± 0.00MB | 163.00 ± 0.00 |
Benchmarks on dummy data with 1024 sync committee periods, 512 sync committee size, 8 provers
Implementation | Time To Sync | Data Downloaded | Interactions |
---|---|---|---|
Light Client | 803.42 ± 3.69s | 106.58 ± 0.22MB | 1027.60 ± 2.11 |
Superlight Client | 92.95 ± 1.97s | 2.27 ± 0.00MB | 205.00 ± 0.00 |
Notice that the data downloaded by Superlight Client for dummy chain is smaller than that of Beacon chain even though the dummy chain has a higher size. This is because the Beacon implementation uses the Beacon chain update data type proposed in the Sync Committee specs. This data structure consists of params which are not there in the dummy chain.
data/
: consists of python scripts to fetch beacon chain sync committee data, plot participation of sync committee, and plot results from benchmarks implementation/
: implementation for superlight client written in TS nodejs
src/client
: consists of implementation for superlight client and light client src/prover
: consists of implemenetation for proversbenchmark/
: consists of multiple scripts to compare light client vs super light clients. The final benchmarking only uses multiple-server.ts
deployment/
: consists of bash scripts that were used to deploy and configure multiple provers in herokunotes/
: rough pseudo code and notes paper/
: latex source for thesis paperbash deployemnt/create-app.sh
to create 14 heroku serversbash deployment/deploy-app.sh
to deploy the code to each heroku serversbash deployment/set-config-{your-config}.sh
to set the config for all the heroku serversbash deployment/ping-app.sh
yarn install
to install the dependencies yarn build
to build the project locallyproverCount, isDummy, size, committeeSize, trials
in the benchmark/multiple-server.ts
yarn build
yarn benchmark
to run the benchmark scriptresults
folder. The file name is based on the config you choose.