You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: routing.rb
    path of file: ./repos/karafka/lib/karafka/pro/routing/features/swarm/contracts
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# This Karafka component is a Pro component under a commercia
    
              def validate!(builder)
                nodes_setup = Hash.new do |h, node_id|
                  h[node_id] = { active: false, node_id: node_id }
                end

                # Initialize nodes in the hash so we can iterate over them
                App.config.swarm.nodes.times { |node_id| nodes_setup[node_id] }
                nodes_setup.freeze

                builder.each do |consumer_group|
                  consumer_group.topics.each do |topic|
                    nodes_setup.each do |node_id, details|
                      next unless topic.active?
                      next unless topic.swarm.nodes.include?(node_id)

                      details[:active] = true
                    end
                  end
                end

                nodes_setup.each_value do |details|
                  super(details)
                end
              end