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: index.rb
    path of file: ./repos/ruby-ethereum/lib/ethereum
    
    the code of the file until where you have to start completion: # -*- encoding : ascii-8bit -*-

module Ethereum

  ##
  # Collection of indexes.
  #
  # * children - needed to get the uncles of a block
  # * blocknumbers - needed to mark the longest chain (path to top)
  # * transactions - 
    
    def update_blocknumbers(blk)
      loop do
        if blk.number > 0
          @db.put_temporarily block_by_number_key(blk.number), blk.full_hash
        else
          @db.put block_by_number_key(blk.number), blk.full_hash
        end
        @db.commit_refcount_changes blk.number

        break if blk.number == 0

        blk = blk.get_parent()
        break if has_block_by_number(blk.number) && get_block_by_number(blk.number) == blk.full_hash
      end