Ethereum client geth v1.9.0 released ! What’s new ?

Tangui Clairet
Rockside
Published in
6 min readJul 24, 2019

After 6 months without any big release, geth comes back with a new version containing lots of improvement and cool stuff.

This post is my summary about this new release, you can find the whole changelog here.

Performance, faster and lighter sync

At the beginning of Ethereum client, sync performance was not a main concern. There were few data to sync. But now syncing is becoming a pain. The good news is that this last release contains some performances improvement.

Concretely, a sync operation takes less time (especially on fast sync and archive) and less disk usage.

For fast sync on i3.2xlarge AWS EC2 instances (8 core, 61 GiB RAM, 1.9 TiB NVMe SSD) from official change log

Freezer, manage your storage intelligently

About disk storage, to be able to sync a node you need to use SSD.

What’s the advantage of an SSD over HDD ? They are way faster and handle better multiple write operations than a good old HDD.

What’s the link with Ethereum ? While syncing a node you will receive a lot of little packages that you will have to store and use to recalculate the state. Those operations take time. With HDD you can’t do it quickly enough and you will never reach the blockchain head. But SSDs are not cheap and the size / price ratio is not in our favor.

So what’s the solution ? Get a big SSD and store everything on it ? Previously yes. Now meet Freezer.

Before detailing what Freezer do, let’s see what the whole storage is made of. Basically, blocks. The question now is does my node need all the blocks ? Yes, but no. It needs them but with different usage over time. The last blocks are important and will be accessed way more often than last month blocks. And that’s where Freezer comes in place. Now geth will separate those two types of blocks and moves those old ones into another folder. You can configure the path of this folder, and for example let’s say put it on a HDD.

That way you can use a cheap and small SSD to sync and use a big and cheap HDD to store the data.

A fresh fast sync at block 7.77M placed 79GB of data into the freezer and 60GB of data into LevelDB.

So yeah that’s pretty good for our wallet.

GraphQL, an alternative to JSON-RPC

If you happened to have played with a node you must know the JSON-RPC interface. To put it simply, it’s the API to access the blockchain. Like all APIs, there is a set of defined functions which gives you predefined outputs.

GraphQL is different. Instead of making a request to a specific route you define the format of the response you want (and just that) and you will get it directly.

Let’s take an example

I want to get the last 10 blocks miner and their balance.

Using JSON-RPC

So we have 10 loops, for each we get a whole block even if we are just interested in one value (miner) and after that we make one last call for its balance. In conclusion, we have 20 calls and more data than needed.

Using GraphQL

You get the same result with only one query. Moreover you don’t have unnecessary data, which means a bit less work for the node !

You can easily start playing with geth GraphQL by just adding one parameter at launch.

Block account unlocking with open API, avoid misuse

Before explaining this change, I would like to talk a bit about a philosophical aspect of Ethereum. In a perfect dream world, every user possesses its own node (even light). You don’t use someone else’s node to access Ethereum, not even Infura. I think it’s possible for developers like us, but it’s not reasonable today for normal users and companies.

For me this is the reason RPC method eth_sendTransaction exists. This method will sign the incoming transaction with the first account present (and unlocked) on the node. If you are the only one to have access to the RPC endpoint that fine. But if you expose your RPC endpoint on the internet without any protection that’s a big security risk for your funds.

If you want to know more, here is article detailing the misuse.

But sometimes you need to expose those APIs and also unlock your node (e.g. sealing node on a Proof of Authority network). But that’s bad, really bad. Now it’s not possible anymore. Actually to be honest it’s still is but you have to explicitly add the option --allow-insecure-unlock to geth, which means you know what you’re doing (at least more than before).

A solution among others is to have two nodes. One will do the sealer and will not expose any RPC endpoint. The other will expose RPC over http / websockets / GraphQL without participating to the consensus.

Clef, a new horizon for key management

As seen before, account management on a node can be tricky (e.g. Pantheon, an another client, doesn’t allow it at all). And that the main aim of Clef: move this feature into an independent program. Clef is not a new feature of geth, it’s a completely stand alone binary written in go.

What’s the point ?

For example, to expose your node to the world without extreme protection and connect it to a Clef running on a more secure environment.

Not enough for you ?

Ok, I did test clef back in march for a sealing node. The node sent all the blocks waiting for validation to Clef and Clef prompted me if I wanted to sign the block. Ok that doesn’t seem much said like that but it’s a really cool first step. Many of our clients ask for security for their sealer private key yet it is needed on the node at start for sealing. That’s bad for two reasons : the node is exposed (at least a little) to the outside world and what will happen to your key when the server is destroyed ?

The architectural made on geth to make Clef open new doors for key protection (seal blocks inside a vault ?). This tool looks so cool and I can’t wait to play with it.

So yeah pretty major minor release from the geth team. I only talked about the things that seems useful for non techy people from my point of view. I may have missed some other upgrades or features. If you want to learn more details go check the changelog.

i’m not the only to say it’s cool ;)

I did this research during my work for the development of our product Rockside. We build an enterprise-grade platform that removes Blockchain complexity. We love design systems that are elegant abstractions over complex Blockchain technologies with a modular architecture, designed with security, performance, and scalability. Do not hesitate to take a look at our site.

All Rockside updates

Subscribe to our newsletter.

To try Rockside, visit our website

Follow us on Twitter.

Join our Slack.

--

--