I had read yesterday morning, before this deal was announced, that the Sox and Porcello had agreed to hold off on extension talks until the end of the season. I am guessing that the rush was that Porcello stated that he would not discuss contracts during the season. So, if the deal was not done now, it would not be discussed again until the end of the season.
At that time, Porcello's stock might be a lot higher than it is now. If Porcello pitches well, you can almost bet he would be getting more than 4 years. This is something that the FO wants to avoid, if possible.
Yes, it's a risk, but IMO, a good risk to take. I'm guessing that Porcello will pitch well enough to be worth the contract. This is also one less thing Ben has to worry about next offseason.