Ah I missed the ambiguity of the OP. When does the attack come? If in 1939 or 1940 they really cannot due to other conflicts (in 1939 the conflict with Japan, the invasion of Poland, and the war with Finland, in 1940 the invasion of the Baltics, the recovery from the Winter War, and the occupation of Bessarabia and parts of Bukowina). The logistics of East Poland were a mess and Russia had IOTL made no effort to upgrade them, AFAIK as a defensive measure in case of a German invasion. So a Soviet offensive in 1939 is not possible. In 1940 it is more doable, but only after the occupation of the Baltics, which is after the German defeat of France. The USSR then cannot spend time dismantling the Stalin Line, nor can it change its doctrine/organization of units, it must forego modernization to get existing equipment up to snuff (so no KVs or T-34s or modern aircraft), and cannot expand; Stalin must spend all his resources getting the army recovered from the Winter War, annex his promised territories (Baltics, Bessarabia), integrate newly seized lands and pacify them, and upgrade infrastructure at the border to allow for an invasion.
At the earliest we are looking at very late Summer/Autumn 1940. At that point the only thing that makes sense to do is invade Romania hard to capture the major foreign source of German oil and then to clear the East Bank of the Vistula and threaten East Prussia to tie down the Germans. If the Soviets do that then the Germans are in real trouble. There is a famine in Europe, the blockade prevents importing in significant quantities, and the Soviets now have shut off a major source of Axis oil, while also denying them Soviet resources that were historically traded. The Soviet military is a joke but they have the advantage of Germany being low on resources and now cannot really materially prepare for Barbarossa thanks to no Romanian oil or Soviet trade resources. They've used up a bunch of resources in the Battle of France and Britain and Europe is in famine. The German military is tough as nails and the best military on the planet at the time, but they need resources and supplies to be able to fight. The Soviets in this scenario have cut them off of what they need to be able to fight, so their military weakness relative to the Germans is dramatically aided by the German lack of supplies. The Germans will hit back very hard with their allies, but will be hobbled by their lack fo supplies from achieving nearly anything substantial beyond perhaps grabbing back Romania...but likely only with wrecked oil fields.
The problem with that scenario is that it requires the Soviets having perfect knowledge of the German material shortages, perfect forethought in terms of what would make them most effective, and knowing that the Germans are going to attack next year. They'd need to start preparing in 1939 to make this happen, which is just not really possible given Stalin's strategic thoughts and the neutering of any opinions outside of what Stalin would tolerate. So while it is all possible in terms of hindsight, at the time it was just not a viable plan due to imperfect understanding of what was going on and what would happen. Stalin thought he could watch the Germans and Brits wear each other down and take time to build up a world beating military and conquer Europe on the cheap, which made total sense without hindsight in 1939 and even in 1940. Doing the above attack plan really is a bad idea relative to Stalin's OTL plan...assuming the Germans don't defeat France or don't invade the USSR in 1941.