Grease and line three 8-inch (20 cm) cake tins with parchment paper.
In a large bowl, sift together the flour, cocoa powder, salt, baking soda, and baking powder. Set aside.
In a large glass measuring cup, combine the stout, vanilla, and espresso powder. Set aside.
In a large mixing bowl, cream together the butter and sugar until it is light and fluffy, about 5 minutes, scraping down the sides occasionally to ensure all the ingredients are being evenly creamed together.
Beat in the eggs, one at a time, ensuring each egg is fully incorporated before adding the next.
Add the mayonnaise and beat until the mixture is smooth and creamy.
Preheat oven to 325˚F (160˚C).
Alternate adding the prepared dry and wet ingredients to the batter. Starting with about ⅓ of the dry ingredients, beat until incorporated. Then add ⅓ of the liquid ingredients, mixing until the batter comes together. Continue until all the wet and dry ingredients have been incorporated.
Using a rubber scraper, fold the dark chocolate chunks into the batter.
Distribute the batter evenly between the 3 prepared cake tins.
Bake for about 35 minutes, or until a toothpick inserted into the center of the cake comes out clean.
Place the cakes on a cooling rack and leave to cool for about 10-15 minutes, until the outside of the pan is cool enough to touch.
Once the cakes have cooled, loosen the edges using a butter knife. Then place a large plate over the tin and invert to release the cake from the pan. Remove the parchment paper from the bottom of the cake and slide the cake back onto the cooling rack to cool completely. Repeat for the remaining two layers.
While your cakes are cooling, prepare the buttercream.
In a large bowl, beat together the butter and vanilla.
Gradually add in the cocoa powder, powdered sugar, and milk, continuously beating until all the ingredients have been incorporated and the frosting is light and fluffy.