code: func (b *BloomTrieIndexerBackend) Commit() error {
  	var compSize, decompSize uint64
  
  	for i := uint(0); i < types.BloomBitLength; i++ {
  		var encKey [10]byte
  		binary.BigEndian.PutUint16(encKey[0:2], uint16(i))
  		binary.BigEndian.PutUint64(encKey[2:10], b.section)
  		var decomp []byte
  		for j := uint64(0); j < b.bloomTrieRatio; j++ {
  			data, err := rawdb.ReadBloomBits(b.diskdb, i, b.section*b.bloomTrieRatio+j, b.sectionHeads[j])
  			if err != nil {
  				return err
  			}
  			decompData, err2 := bitutil.DecompressBytes(data, int(b.parentSize/8))
  			if err2 != nil {
  				return err2
  			}
  			decomp = append(decomp, decompData...)
  		}
  		comp := bitutil.CompressBytes(decomp)
  
  		decompSize += uint64(len(decomp))
  		compSize += uint64(len(comp))
  		if len(comp) > 0 {
  			b.trie.Update(encKey[:], comp)
  		} else {
  			b.trie.Delete(encKey[:])
  		}
  	}
  	root, err := b.trie.Commit(nil)
  	if err != nil {
  		return err
  	}
  	b.triedb.Commit(root, false)
  
  	sectionHead := b.sectionHeads[b.bloomTrieRatio-1]
  	log.Info("Storing bloom trie", "section", b.section, "head", fmt.Sprintf("%064x", sectionHead), "root", fmt.Sprintf("%064x", root), "compression", float64(compSize)/float64(decompSize))
  	StoreBloomTrieRoot(b.diskdb, b.section, sectionHead, root)
  	return nil
  }
docs: // Commit implements core.ChainIndexerBackend