code: func dbPutBestState(dbTx database.Tx, snapshot *BestState, workSum *big.Int) error {
  	// Serialize the current best chain state.
  	serializedData := serializeBestChainState(bestChainState{
  		hash:      snapshot.Hash,
  		height:    uint32(snapshot.Height),
  		totalTxns: snapshot.TotalTxns,
  		workSum:   workSum,
  	})
  
  	// Store the current best chain state into the database.
  	return dbTx.Metadata().Put(chainStateKeyName, serializedData)
  }
docs: // dbPutBestState uses an existing database transaction to update the best chain
  // state with the given parameters.