State Sen. Joan Lovely set the proper tone at the Legislature’s yearly revenue hearing earlier this week. Whether her counterparts on Beacon Hill were paying attention remains an open question.

Yes, the state’s economy is doing well and has been for a while, Lovely, the vice chair of the Senate Ways and Means Committee, told the crowd gathered for the hearing. But all good things come to an end, and the state needs to prepare for the possibility of slowed economic growth, or even a downturn.

“It is crucial that we keep an eye toward the years ahead to ensure that when times are tough we are adequately prepared,” the Salem Democrat said.

The yearly gathering of legislators, budget and treasury officials and think tanks is aimed at coming to a general agreement on how much tax revenue the state will bring in during the next fiscal year.

The consensus at Wednesday’s hearing was that state revenue collections will grow somewhere between 2 percent and 3.4 percent. But forecasters say there’s no guarantee that growth will continue.

We agree. That means being cautions about new spending. It means putting more money into the state’s so-called rainy day fund. And it means not staking too much of the state’s financial future on newly legal marijuana.

State Revenue Commissioner Christopher Harding estimates the state will collect between $44 million and $82 million in marijuana-related sales taxes this year, and $93 million to $172 million next year.

But even those numbers will be difficult to rely on, as marijuana is still a developing industry.

“It remains unclear when Massachusetts will reach a fully developed market,” Harding said. “Therefore, these figures should be used with caution for budgetary purposes.”

Eileen McAnneny, president of the Massachusetts Taxpayers Foundation, said there are already “pre-recession warning signs” everywhere from labor markets to the oil industry. 

“By historic markers, we are on borrowed time,” she said.

That’s why budget writers need to prioritize adding to the state’s rainy day fund, even when they are pressed to add new spending to a plan that is likely to top $43 billion.

To her credit, state Treasurer Deborah Goldberg recognized the need to add to the fund, which now sits at around $2 billion and should be somewhere around $4 billion.

“I would just recommend that we keep putting money into the rainy day fund and not veer from that,” she said.

That’s sound advice.