That's not an accurate explanation of the situation in the US.
Cannabis is illegal at the federal level. Separately, it is illegal in some states too (although fewer and fewer as the years go by). States do not have the power to prosecute people under federal law, so in states where the state has legalized marijuana, prosecutors (DA, AG, etc.) have no basis to file criminal charges.
The federal prohibition means that people can be prosecuted for possession on federal land, or if a federal agency (such as the FBI) takes enough interest to enforce the federal law, but they rarely bother at this point.
> I wish there was a legal standard whereby if the state stops prosecuting a law, the law automatically can be invalidated by a court.
What you are describing is actually closer to the Dutch system. Marijuana is illegal there, but because it's been "tolerated" (best translation of the Dutch word) for long enough, it's not actually legal for them to enforce the law anymore. (Well, sort of).
There are three parts to the law:
1. The legislature must draft the law
2. The executives must enforce the law.
3. The judicial must punish for breaking the law.
If (2) never happens, then it never gets to (3). And courts can "invalidate" a law: jury nullification.
If you want to get kicked right off a jury start talking about nullification. Waiting in my jury pool to be called/dismissed one of the prospective jurors started handing out FIJA (Fully Informed Jury Amendment) flyers to anyone who was interested before we went into the courtroom.
http://www.ibiblio.org/fija/fijaintr.htm
The bailiff called him forcibly into the judges quarters and everyone he had spoken to was sent home.
(This is also why federal drug legalization could, in theory, be achieved through executive order, if Dems had the spine for that.)
https://en.wikipedia.org/wiki/Wickard_v._Filburn
Basically, if they can somehow connect it to interstate commerce - even if it very indirect, like in this case where growing something for personal consumption affected demand - it's "constitutional", supposedly.
This is the case that explicitly extended this reasoning to drugs:
https://news.gallup.com/poll/356939/support-legal-marijuana-...
This doesn’t invalidate the law. It decides one case in a particular way. An invalidated law is unenforceable for everyone.
Technically, there’s nothing illegal about a judge telling the jury about nullification either.
I wish there was a legal standard whereby if the state stops prosecuting a law, the law automatically can be invalidated by a court. We have lots of things that are illegal that are only used by prosecutors when they want to throw the book at someone.