Upgrading the Prysm Eth2 client from binaries

11 Nov '21 • Filed under technical • Tagged: Ethereum, Prysm, Technical, Crypto

The tl;dr for this is: yes, you can just upgrade Prysm by stopping your services, copying the new binaries and then restarting your services.

I had to do this recently as the Altair fork required all clients to be running V2.

Unfortunately, the official docs on upgrading only provide instructions based on three different ways of installing: Prysm.sh, Docker and Bazel. I did not set up Prysm via any of these routes. As I mentioned in my original article, I followed Somer Esat’s instructions, which involved simply downloading binaries and copying them to /usr/local/bin.

Which brought me to my question: can I just stop the services and replace the binaries?

The answer was yes, but there were two things that caught me out.

First download the binaries to a different directory. You can just use curl like so:

curl -LO https://github.com/prysmaticlabs/prysm/releases/download/v2.0.2/beacon-chain-v2.0.2-linux-amd64

Someone recommended I overwite the old binary and then just restart the systemd service, but that’s not possible:

sudo cp ~/v2_upgrade/beacon-chain-v2.0.2-linux-amd64 beacon-chain
cp: cannot create regular file 'beacon-chain': Text file busy

So I knew I’d have to stop the service fully and risk penalties. As per the V2 upgrade notes I tried stopping beacon first with:

sudo systemctl stop prysmbeacon

The command just… hung. I began to perpsire as the error messages rolled in via the Prsym dashboard. The command had worked behind the scenes but something was taking a while to finish. I Ctrl-C-ed instead of being patient.

At this point I gave up all protocol, stopped both services, copied across new binaries and started them both up again. It’s a good idea to keep an old version of the binaries around in case something goes wrong.

[email protected]:/usr/local/bin$ l
beacon-chain*  beacon-chain_v1_backup*  validator*  validator_v1_backup*

In the end, I got two penalties for missing two attestations. These appear on the blocks after you miss attestations, which meant a slightly nervous wait to see if things went green again afterwards.

It looked scary but fortunately my escapade had only cost me 12p:

Everything has been running smoothly since!

Want to know when new posts go live?
Emails are short, infrequent and packed with goodness.