code: func (r *ChtRequest) Validate(db ethdb.Database, msg *Msg) error {
  	log.Debug("Validating CHT", "cht", r.ChtNum, "block", r.BlockNum)
  
  	if msg.MsgType != MsgHelperTrieProofs {
  		return errInvalidMessageType
  	}
  	resp := msg.Obj.(HelperTrieResps)
  	if len(resp.AuxData) != 1 {
  		return errInvalidEntryCount
  	}
  	nodeSet := resp.Proofs.NodeSet()
  	headerEnc := resp.AuxData[0]
  	if len(headerEnc) == 0 {
  		return errHeaderUnavailable
  	}
  	header := new(types.Header)
  	if err := rlp.DecodeBytes(headerEnc, header); err != nil {
  		return errHeaderUnavailable
  	}
  
  	// Verify the CHT
  	var encNumber [8]byte
  	binary.BigEndian.PutUint64(encNumber[:], r.BlockNum)
  
  	reads := &readTraceDB{db: nodeSet}
  	value, _, err := trie.VerifyProof(r.ChtRoot, encNumber[:], reads)
  	if err != nil {
  		return fmt.Errorf("merkle proof verification failed: %v", err)
  	}
  	if len(reads.reads) != nodeSet.KeyCount() {
  		return errUselessNodes
  	}
  
  	var node light.ChtNode
  	if err := rlp.DecodeBytes(value, &node); err != nil {
  		return err
  	}
  	if node.Hash != header.Hash() {
  		return errCHTHashMismatch
  	}
  	if r.BlockNum != header.Number.Uint64() {
  		return errCHTNumberMismatch
  	}
  	// Verifications passed, store and return
  	r.Header = header
  	r.Proof = nodeSet
  	r.Td = node.Td
  	return nil
  }
docs: // Valid processes an ODR request reply message from the LES network
  // returns true and stores results in memory if the message was a valid reply
  // to the request (implementation of LesOdrRequest)