Playing a super-important role at the very end of Rogue One, the Hammerhead Corvette starship actually appeared in the second season of Star Wars Rebels back in January of 2016. And at that point, Princess Leia Organa herself helped the Rebels obtain the special spaceship. Three of them, in fact!
Spoilers for Rogue One follow.
As the Rebel Alliance fights the Empire above the planet Scarif in the finale of Rogue One, Admiral Raddus eventually orders that a “Hammerhead Corvette” be used to ram one of the Star Destroyers. This ramming turns out to be essential because in disabling the Star Destroyers, the Shield Gate protecting the Imperial Base on Scarif is lifted. But, the Rebel Alliance wouldn’t even have had the Hammerhead Corvettes at all if it weren’t for the actions of Princess Leia in the Star Wars Rebels episode “A Princess of Lothal.”
Set about four years before the events of Rogue One, the Rebels episode dealt with Leia helping Phoenix Squadron steal the cool-looking ships, basically from her.
Still acting as a legitimate member of the Imperial government, Leia Organa helps the Rebels steal the Hammerheads which actually belong to her family on the planet Alderaan. The idea here is that Leia isn’t yet openly operating as a member of the Rebellion, but instead using her inside connections to help the Alliance. This idea is echoed in Rogue One, when her adoptive father — Bail Organa — tells Mon Mothma that his people can’t avoid war any longer.
The bottom line: When Raddus orders that ship to ram the Star Destroyer, the whole thing wouldn’t have been possible without the cunning plans of the heroic Princess Leia.