Workers install solar panels on a residential home in Santa Monica, Calif.

Solar power's rise has felt unstoppable. Clean energy development has shattered records for years. And new figures show the U.S. solar power market experienced more record growth in the second quarter of 2017. Solar made up 22 percent of new electric capacity this year.

But the game's far from over. There are signs that rooftop solar may be feeling the effects of political attacks. Those attacks could hinder efforts to fight climate change and reduce the resiliency of America's power grid.

As we witness the violent effects of climate change across the country – from rampant, destructive wildfires to back-to-back, devastating hurricanes – our elected leaders should be doing all they can to rapidly transition away from dirty fuel sources.

In 2015, Nevada lawmakers passed a bill that allowed utilities to charge rooftop solar customers extra. The state's solar industry was effectively frozen as a result. Within a month three major solar companies, SolarCity, Sunrun and Vivint, announced they were forced to leave the state and terminate hundreds of jobs.

"Politicians influenced by fossil fuel and utility companies are working feverishly to stifle renewable energy growth. This slowdown of rooftop solar growth is problematic, and not just for solar customers and renewable energy companies."

These policy changes seek to drive up the costs of residential solar and make it unaffordable for many Americans.

And it's becoming clear that these tactics are working. Much of the impressive solar power growth in 2017 was led by large-scale and utility installations. Distributed solar – those smaller systems often put on rooftops and parking lots – only grew one percent in the second quarter.

This slowdown of rooftop solar growth is problematic, and not just for solar customers and renewable energy companies.

Distributed solar has the potential to supply electricity during grid outages resulting from extreme weather or other emergency situations. That means that, on top of reducing our fossil fuel dependence, rooftop solar helps to make our cities more resilient in the face of climate change.

It's also good for the environment – solar energy on existing structures doesn't create pollution during generation, it requires negligible water use and it doesn't take up additional land. That makes it better for our planet and the most wildlife-friendly form of energy.

And although utility-scale solar growth continues to break records, we can't take it for granted either. There is pressure building that could stifle these projects as well as smaller distributed ones.

The federal government is considering a trade petition that could, if successful, gut the solar industry. And the petition is moving forward under the guise of protecting U.S.-based solar panel manufacturers from international competition. If approved, it could double the price of solar panels in the United States. This price hike would decrease demand, potentially forcing the loss of one-third of domestic solar jobs and dropping installations by two-thirds.

Rather than letting polluters drag their feet, we need to make it easier for rooftop solar to flourish. We need politicians to enact solar-friendly policies rather than work to eliminate them.

States can enact policies that allow for third-party ownership, which allows companies other than utilities to sell solar panels. States also need to establish strong programs that ensure homeowners and businesses with solar panels get reimbursed for the extra energy they produce. In addition, federal renewable energy tax credits, along with programs to support renewable research and development, can help spur rooftop growth.

But most importantly, policymakers need to take into account the true value of solar – including its benefits to people, climate and wildlife – especially as utilities continue their attacks on distributed renewable energy. It's time to put a price on the social and environmental costs of the outdated monopoly model, which solely considers utility profits. Some states are beginning to do so by requiring utilities to consider the social cost of carbon in their rate-making decisions.

Yes, solar growth continues to impress, but it's not time to rest on our laurels. As polluters continue their anti-renewable energy campaigns, we must keep a watchful eye on rooftop solar markets to ensure that more people are able to gain access to clean, wildlife-friendly energy sources. We need to work hard to build on the incredible success of solar to build a more resilient grid, help prevent the destructive effects of climate change, and create a healthier, more equitable future for humans and wildlife alike.

Commentary by Greer Ryan, the sustainability research associate for the Center for Biological Diversity in Portland, Oregon. Follow her on Twitter @GreerRyan_.

For more insight from CNBC contributors, follow @CNBCopinion on Twitter.