[RFC] Increasing recommended minimum core count for reference hardware

The polkadot binary is a multithreaded program that will benefit from having more hardware cores available, and all configurations are tuned to take into consideration the worst case scenario on the worse recommended hardware configuration. Currently, the minimum hardware requirements recommends at least 4 hardware cores with SMT disabled.

This thread is started in order to gather feedback on the opportunity of raising the minimum requirements for a polkadot validator to at least 8 hardware cpu cores, so if you got any concerns of any kind about this please let us know.

Why would the network benefit from raising the minimum hardware requirements ?

With async backing support enabled, parachains can now produce bigger blocks which take a lot more time to execute, collator authoring time can be increased from 500ms up to 2000ms, that means the execution of PVF for backing and approving processes might need 4 times more CPU resources to execute those blocks and confirm they are valid.

Currently, PVF execution pool is capped at maximum 50% of the 4 hardware cores, that means for each relay chain block we have a maximum of 12s(relay_chain_frequency * 2 cores) of cpu time for the parachain block execution. In average a validator needs to execute around 7(1 backing + 6 tranche0 approvals) parachains blocks, so if we divide the maximum cpu time by the number of parablocks, it results the fact that the average parachain blocks execution times will not be bigger than 1.7s (12s / 7).

By increasing, the minimum required core count we can then safely increase the hard capacity of the PVF execution pool. For example if we raised the capacity to 50% of 8 hardware cores, then the theoreticall average for parachain block execution times would increase from 1.7s to 3.4s (24s / 7 ), significantly above the 2s backing time recommended by async backing.

Why don’t we raise the PVF execution hard capacity ?

Currently, the PVF execution hard capacity is 50% of 4 hardware cores, increasing it would give us more execution time for the parachain blocks, however this analysis concurred that it would not be safe on validators running with the minimum requirements of 4 cores, because it would steal valuable cpu time from other subsystems doing critical work as well.

Other optimisations avenues

In parallel with this, other optimisations are also being progressed on that would reduce the amount of work a validator needs to do.

However, since the optimizations being worked on stacks up with raising the minimum required hardware if we want to be able to support 10x more usage on the network we would actually want to do both.

Current state of afairs

Looking at Polkadot telemetry it seems that the majority of validators already use more than 4 cores.
Note! This data it is not reliable because it includes collators nodes and because on some orchestration systems the binary would see a certain number of cores, but you get rate-limited via other mechanisms
Kusama

Polkadot

This raises the question, that if the majority of validators are already running on more powerful hardware than the minimum required then there is already spare/wasted capacity that we can use to execute more parachain blocks, which would actually lead to better utilization of the provisioned hardware and will result in the network being able to support a significantly number of Polkadot cores(not to be confused with hardware cores).

Alternatively, if validators are runing at the bare minimum requirements then increasing the core count from 4 to 8, might increase non negligiably the costs of runing the validators for some people. I avoided doing some cost estimations here, because it will vary significantly from setup to setup, but we are looking forward to hear from the validators in the community if they think there will be impacted and how.

Preparing for the future

With all that in mind, we think that raising the minimum core count for validators from 4 to 8 is a change that greatly helps the Polkadot network overall to prepare for a future where usage increases 10x or more and it is a change that we should start proactively rather than wait until the maximum theoretical throughput is met.

Final note

While we think this is the path we should head into future, we are also aware that this might have an impact on the validators cost, so looking forward to hear from the validators community and what we can do to mitigate the impact as much as possible.

6 Likes

I’d heard elsewhere that not all validators run even 4 cores, although maybe their original source was this data, and maybe the collators etc confuse the results. Anyways…

I think the rewards design in Validator rewards in Polkadot/Kusama - HackMD would safely penalize validators who run under spec hardware. We should discuss it sometime.

I’d heard elsewhere that not all validators run even 4 cores, although maybe their original source was this data, and maybe the collators etc confuse the results. Anyways…

Hard to tell we don’t have any good data besides: https://telemetry.polkadot.io/ and that’s unreliable as well.

I think the rewards design in Validator rewards in Polkadot/Kusama - HackMD would safely penalize validators who run under spec hardware. We should discuss it sometime.

Yes, I agree mid to long-term this is how this differences should auto-regulate, but I don’t think this would land on a short timeframe, without that the best we can do now is raising the minimum recommended spec and give time to people to try to follow it.

Could you speak to dedicated physical hardware cores vs shared configurations like virtualization (vCPU’s) and also container situations where multiple containers may be sharing X physical hardware cores.

Think about this: a validator running on a Digital Ocean droplet with “8 CPU’s”, but in reality, other customers are running on the same physical hardware.

Or the opposite extreme: a validator running on bare-metal that really has eight physical cores not shared with anything else.

Or this: a Kusama validator and a Polkadot validator running in containers on the same physical hardware bare metal sharing eight cores?

I find ‘core’ is almost meaningless now, given virtualization and various sharing situations.

Trying to understand if it’s about simultaneous thread taking capacity or actual performance.

1 Like

We’re primarily discussing recommendations here, aka capacity, but…

At present polkadot & kusama are badly underutilized. It’s possible this changes once ETH bridges work, but if not we’ll hopefully run some glutton parachains soon-ish.

At some point someone should finally launch some applicaitons that really demand the throughout too.

We need validators to spend enough CPU time by that point, which we’ll necessarily enfroce though validators’ rewards too.

It’ll become about actual performance eventually.

As Jeff said, both in the Run a Validator (Polkadot) ¡ Polkadot Wiki and in this post when you talk about a core, the assumption is that you use the full(almost) capacity of that core for a single polkadot validator.

Could you speak to dedicated physical hardware cores vs shared configurations like virtualization (vCPU’s) and also container situations where multiple containers may be sharing X physical hardware cores.

The type of instances you purchase from your cloud provider should tell you if you get those cores completely for yourself or if the CPU time it is burst-able with the assumption you are sharing the physical cores with other virtual tenants. Polkadot protocol has a lot of places where the assumption that operations are happening in a certain amount of time, so for running your validator you should always favor predictable CPU allocation for your containers polkadot program.

I am most favourably disposed towards this proposal.

1 Like

Referenda to get formal approval from the network for increasing core count on the reference hardware has been posted here: Increase recommended core count for validators reference hardware from 4 to 8

1 Like

Can we maybe agree on what we expect from 1 core? what’s the baseline?
a core from 5 years ago and a core in 2024 are very different, you can also have a e-core or a p-core (optimise for power or optimise for performance).

What does matter? single core performance? is a e-core enough? A way to do it would be to tell:

an intel core (from this generation, at this frequency, etc) is 1.

Another would be to have a benchmark that people can run on their validator and it would tell large enough or not?

Can we maybe agree on what we expect from 1 core? what’s the baseline?
a core from 5 years ago and a core in 2024 are very different, you can also have a e-core or a p-core (optimise for power or optimise for performance).

There is already consensus on that here Run a Validator (Polkadot) ¡ Polkadot Wiki, all the weights for the runtimes are generated using that.

Another would be to have a benchmark that people can run on their validator and it would tell large enough or not?

Yes, we do have that already, benchmarks are run at polkadot startup and tell all the validators how their single core performance compares with the reference numbers from here: polkadot-sdk/substrate/utils/frame/benchmarking-cli/src/machine/reference_hardware.json at a3eda0a1bdc67fc14efbf64c1f0046d452f55e31 ¡ paritytech/polkadot-sdk ¡ GitHub.

Additionally, part of this I also added a benchmark that would tell validators if their parallel performance does not met the new requirements of 8 cores.

2 Likes

If our concern were just other subsystems, then we’d presumably want a fixed size, like two extra CPU cores, not a proportion like 50%.

We’ve maybe need proportional for load spikes, but we’ll explore this by having back presure on backing work well, and running loits of gluttons.

1 Like

I think 8 cores makes sense for kusama, and we can change the recomendations for polkadot too, but…

We should discuss 16 or 32 core machines for polkadot validators, but not for kusama ones, and/or some slave machine model which out sources some of the download and PVF executions onto other machine.

I’m aware cloud providers often lack 16 or 32 core machines, but the slave machine options addresses this, and specifically not supporting cloud providers would be benefitial, except it’d push people ont othe few cloud providers who offered these, and that’s worse than diverse cloud providers.

1 Like

We should discuss 16 or 32 core machines for polkadot validators, but not for kusama ones, and/or some slave machine model which out sources some of the download and PVF executions onto other machine.

Yeah, I definitely agree that our protocols and network scales really well with the hardware, beefier specs would definitely help.

As of now Increase recommended core count for validators reference hardware from 4 to 8 has passed and everything is in place to constantly inform validators at startup that they would need to satisfy this new requirements of 8 cores from January 2025.

Let’s see how that goes and we can probably repeat the process to raise it to even more cores if usage requires it.

2 Likes

Certainly we could easily beef up the validators and give them more work to do in order to add more cores, but at the same time we should aim for incremental optimizations to our stack so we can keep these specs as low as possible. Actually it would be better to add more cheap hw validators to support more cores compared to having a smaller set of beefy ones.

2 Likes

Yes of course. It’s maybe easier for us to optimize software performance while validators remain cheap too.

We do pay O(n^2) or maybe O(n^3) for our gossip, so adding validators gets expensive eventually.

We can have multiple relay chains too of course, but this requires many different advancements:

  • Threshold DKG + VRF
  • off-chain messageing ala XCMP
  • adoption of off-chain messaging
  • off-chain messaging linked to finality
1 Like