class BlockchainConfig {

    public void updateChain(Chain chain, int minPrunableLifetime, int maxPrunableLifetime) {

        Objects.requireNonNull(chain, "Chain cannot be null");
        setFields(chain, minPrunableLifetime, maxPrunableLifetime);
        Map<Integer, BlockchainProperties> blockchainProperties = chain.getBlockchainProperties();
        if (blockchainProperties.isEmpty() || blockchainProperties.get(0) == null) {
            throw new IllegalArgumentException("Chain has no initial blockchain properties at height 0! ChainId = " + chain.getChainId());
        }
        heightConfigMap = blockchainProperties.values()
            .stream()
            .map(HeightConfig::new)
            .sorted(Comparator.comparing(HeightConfig::getHeight))
            .collect(Collectors.toMap(HeightConfig::getHeight, Function.identity(), (old, newv)-> newv, LinkedHashMap::new));
        currentConfig = heightConfigMap.get(0);
        LOG.debug("Switch to chain {} - {}. ChainId - {}", chain.getName(), chain.getDescription(), chain.getChainId());
    }

    public  BlockchainConfig();
    public  BlockchainConfig(Chain chain, PropertiesHolder holder);

}