Lodestar v0.37.0: Bopsten-ready Release
Authored by Phil Ngo
We've released Lodestar v0.37.0, a Bopsten-ready version, in anticipation of the Ropsten public testnet merge.
This version of our TypeScript implementation of Ethereum Consensus will give users the opportunity to contribute to client diversity as we start transitioning public testnets to Proof-of-Stake (PoS).
Context
The Bopsten beacon chain genesis is set for Monday, May 30, 2022, at 3 pm UTC. The merge of the current Ropsten Proof-of-Work (PoW) testnet with the Bopsten PoS beacon chain will be set for a total terminal difficulty (TTD) to be determined during the next consensus developers call on June 2, 2022.
The TTD is the trigger that determines when the beacon chain overtakes consensus duties required to complete the merge. Due to the unpredictability of a PoW blockchain, it's difficult to guarantee a specific merge time as it depends on the hashrate of the network.
On Thursday, May 26, there was an exponential increase in Ropsten's hashrate which led to the old TTD 43531756765713534
being scheduled for execution before the launch of the Bopsten beacon chain.
This would reorganize the linear events required for the merge to execute properly. Therefore, this release is ready for launching the Bopsten beacon chain and will fork into Bellatrix outside of the proper TTD configurations.
This blog will go over some details of this release, alongside setup & how to modify the Merge TTD using our override to temporarily set a very high TTD and then modify it to the proper TTD after the official Ropsten merge TTD is announced. See the #TestingTheMerge with Lodestar
section!
Stakers or node operators will have the opportunity to utilize Lodestar with Geth, Nethermind, or Besu in one simple startup command.
Full details are below, plus additional updates for v0.37.0!
Ropsten Merge Support
Version v0.37.0 supports using the --network ropsten
flag for pulling the default configurations to jumpstart Lodestar on the proper testnet.
This release also includes the necessary features, such as defining a defaultFeeRecipient
for collecting the EL block fees and rewards and issuing advanced fcUs for building the execution payload. This release does NOT include an artificially high TTD set by default until the actual TTD is announced. Please follow the instructions under #TestingTheMerge with Lodestar section.
Most importantly, we now have a merge transition banner when the terminal Proof-of-Work block is found. And we're still looking for anyone who would like to refine or submit their own artwork for consideration!
Additional Optimizations and Improvements
Lodestar has completed its migration from commonJS to ES Modules only. This large refactor required us to upgrade dependencies like libp2p and BLS. The performance implications of the upgrade did not significantly regress, and the team is happy with its performance for release.
This release also addresses the reversion of aggregate deduplication condition in ethereum/consensus-specs #2838. We were able to see improvements in memory, CPU usage, signature verifications, AggregateAndProof gossip validation, gossip block processing, and network message forwarding on gossipsub-js.
Invalid keystore JSON files now provide a more informative error rather than a default error with no context. This will help users better identify what may be wrong with the keystore.json files imported into Lodestar's validator client and which keystore is the issue.
We merged in support to get block proposers one epoch in the future. You can now request to get proposer duties for epoch N+1 by using the command:
curl -X GET "http://{beacon-node}/eth/v1/validator/duties/proposer/N+1" -H "accept: application/json"
We also fixed a bug relating to our light client updates as reported by our users. We've ensured that the signature period, attested header period, and finalized header period are within a single period.
#TestingTheMerge with Lodestar
We want this to be an opportunity for new users, node operators, and even existing users of other clients to consider running Lodestar and contribute to network health.
The best way to do this is by using our simple setup script so you can test and feel comfortable with using Lodestar. The following instructions will guide you through setting up Lodestar with Docker for the Ropsten public testnet alongside a selection of execution clients:
-
Install Docker Engine. For Linux users, the command is:
sudo apt install -y docker-compose
-
Copy the Lodestar repository into your machine:
git clone -depth 1 https://github.com/ChainSafe/lodestar.git
-
Navigate to the /lodestar/kiln/devnets directory
cd /lodestar/kiln/devnets
-
Open the
ropsten.vars
file with a text editor. For Linux, you can use nano.
nano ropsten.vars
-
(IMPORTANT!) Set the MERGE_TTD on Line 5 temporarily to
100000000000000000000000
. Line 5 inropsten.vars
should look like: _MERGE_TTD=_100000000000000000000000
-
(Optional) Configure the
ropsten.vars
file. Add any additional Lodestar CLI flags toLODESTAR_EXTRA_ARGS=
. See our CLI documentation here. -
(Optional) If you have validators, within
LODESTAR_VALIDATOR_ARGS=
you can edit--fromMnemonic
to include your validator mnemonic and state which validator indexes you would like to run with the validator client under--mnemonicIndexes
. If you're using the Staking Deposit CLI or Stakehouse Wagyu to generate your mnemonic keys, your initial validator key is generated at index 0. Example of a mnemonic generated with six keys to be run with Lodestar:
--fromMnemonic \"lens risk clerk foot verb planet drill roof boost aim salt omit celery tube list permit motor obvious flash demise churn hold wave hollow\" --mnemonicIndexes 0..5
-
(Optional) Add any additional CLI flags to the execution client you intend to use under
NETHERMIND_EXTRA_ARGS=
orGETH_EXTRA_ARGS=
orBESU_EXTRA_ARGS=
-
When Ropsten Merge TTD is announced, follow the
Override the Total Terminal Difficulty (TTD) When Announced
section. -
Save the
ropsten.vars
file by pressingCTRL
+x
theny
thenEnter
to save and exit. -
Use the startup script command to initialize your docker containers. Example of running Nethermind + Lodestar with validators within Terminal instances:
./setup.sh --dataDir ropsten-data --elClient nethermind --devnetVars ./ropsten.vars --dockerWithSudo --withTerminal "gnome-terminal --disable-factory --" --withValidator
Manual TTD Override with Lodestar CLI
For those starting Lodestar manually with the Lodestar CLI, ensure you add the artificially high TTD of 100000000000000000000000
with our --terminal-total-difficulty-override
flag upon startup with your beacon-node AND your validator client (if you are running one). Otherwise, your validator will throw a configuration mismatch error.
Here is an example of a Lodestar beacon node CLI command with the artificially high TTD override of 100000000000000000000000
:
lodestar beacon --network ropsten --terminal-total-difficulty-override 100000000000000000000000 --jwt-secret /path/to/jwtsecret --execution.urls http://127.0.0.1:8551
And a Lodestar validator client CLI command with the artifically high TTD override of 100000000000000000000000
:
lodestar validator --network ropsten --terminal-total-difficulty-override 100000000000000000000000
Override the Total Terminal Difficulty (TTD) When Announced
If we don't release an update pre-merge with the updated TTD by default, or you do not want to upgrade to the newer released version shortly after the Ropsten Merge TTD announcement, you can utilize this section to update v0.37.0
with the proper Ropsten Merge TTD using the setup script.
❗_If you do not update Lodestar (if >v0.37.0 is released) or complete this section, your node will NOT merge with Ropsten_❗ After opening the ropsten.vars
file (Step 4 above), you will need to modify Line 5 with the announced TTD.
Here is an example of the ropsten.vars configuration file Line 5 with a TTD override of 1337420690000000000
:
MERGE_TTD=1337420690000000000
Then continue with Step 10 above. Now you're fully set up to merge Ropsten!
If you're manually using the Lodestar CLI, restart your Lodestar beacon-node and validator client with the actual Ropsten Merge TTD by using the same --terminal-total-difficulty-override
flag and inputting the announced Ropsten Merge TTD. Here is an example of a Lodestar beacon node CLI command with an announced Ropsten Merge TTD override of 1337420690000000000
:
lodestar beacon --network ropsten --terminal-total-difficulty-override 1337420690000000000 --jwt-secret /path/to/jwtsecret --execution.urls http://127.0.0.1:8551
And a Lodestar validator client CLI command with an announced Ropsten Merge TTD override of 1337420690000000000
:
lodestar validator --network ropsten --terminal-total-difficulty-override 1337420690000000000
Startup Script Help
If you're interested in getting involved with Lodestar, check out our Github. If you'd like to contact the team, please drop by Chainsafe's Discord ➡️ #lodestar-general or email info@chainsafe.io.
For more details on Lodestar, head to our documentation site. You can also check out our open positions and get in touch at ➡️ careers@chainsafe.io
About ChainSafe
ChainSafe is a leading blockchain research and development firm specializing in infrastructure solutions for the decentralized web. Alongside client implementations for Ethereum, Polkadot, Filecoin, and Mina, we're building a portfolio of web3 products - Files, Storage, the Gaming SDK, and ChainBridge. As part of our mission to build innovative products for users and better tooling for developers, ChainSafe embodies an open source and community-oriented ethos. To learn more, click here.