Nitrocelluose "smokeless" gunpowder can keep almost indefinitely provided:
1. It is not a wartime "rushed" production lot. Acids are used in powder manufacture, and hurried production leaves acid residues that eventually decompose nitrocelluose.
2. Storage temperatures are kept cool, and direct sunlight is not allowed on the storage containers. Storage heat is murder on gunpowder, new or old surplus. Ditto for sunlight/uv exposure.
3. Dry storage mandatory. Moisture promotes corrosion of case, bullet, and primer components, hastening powder decomposition.
Even though powder itself is almost insoluble in water. There have been documented cases of naval cannon propellants undersea for DECADES, and yet when salvaged and tested, showed almost no change in ballistics.
The US military considers small arms ammo is good 3 years active duty use, 10 years for reserve/militia training use, and more than 20 years total shelf life. Most of us have fired reliable surplus ammunition much older than this.
How long do YOU think gunpowder is good for?