beacon-APIs icon indicating copy to clipboard operation
beacon-APIs copied to clipboard

Consuming `/eth/v1/config/spec` as VC

Open tbenr opened this issue 2 years ago • 2 comments

We recently had some interoperability issues when new parameters has been introduced in the configuration.

As an example, when networking parameters has been promoted to configuration parameters caused VCs failing to start if upgraded before their BNs.

In Teku we recently merged a PR making the VC less choosy by following the new sequence when consuming /eth/v1/config/spec:

  1. load local known preset (as per PRESET_BASE)
  2. load local known config (as per CONFIG_NAME) [new]
  3. load remaining params from remote

By applying known config by looking up CONFIG_NAME, the final configuration is guaranteed to have all expected params.

Wrt additional unexpected param (ie. upgrade BN exposing new configs, restart previous VC version) we just print a warning ignoring unknown params.

How are other clients do? If we all agree on a common strategy we could avoid interoperability issues.

tbenr avatar Sep 25 '23 16:09 tbenr

We (teku) load config_name first, then preset, that's the order it was previously loaded... just in case anyone is following that ordering...

https://github.com/Consensys/teku/pull/7510

rolfyone avatar Oct 01 '23 22:10 rolfyone

After discussion, I've ended up changing teku to no longer load the local config_name, and we're defaulting the constants that got moved https://github.com/Consensys/teku/pull/7566 It could potentially hide some 'bad config', but the constants that were missing also stopped old config from loading, which is undesirable.

So basically teku when loading:

  • defaults networking 'constants' that got moved to config
  • will load preset
  • then will overlay the remote config onto that
  • ignores unknown values

in the/eth/v1/config/spec endpoint, we'll be pushing values like GOSSIP_MAX_SIZE (good example of a moved constant) and would hope they're read by the consumer, but at least I'd hope that consumers aren't failing if it's unexpected.

rolfyone avatar Oct 02 '23 22:10 rolfyone