since my company does take on federal contracts
Until marijuana is rescheduled / decriminalized / in some other way legalized by the federal government, you are risking your job. End of story.
Is this a bad idea?
Yes, because the company accepts federal contracts. Do not discuss it with your boss. The fact that you have a good relationship with your boss makes discussing it an even worse idea. Don't put them in a position where you know they can't accommodate your request, especially when backing you or staying silent can backfire on them this hard.
EDIT: I'd like to take the opportunity here to emphasize that what I said above applies regardless of your state or local laws regarding marijuana.
Edit: The Drug Free Workplace Act of 1998 requires many/most Federal Contractors to maintain a "drug-free" workplace. Failure to do so can result in penalties including: suspended/stopped payments, revocation of the existing contract and/or ineligibility for future contracts.