Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Foundation subsidy to be waived #237

Merged
merged 4 commits into from
Dec 2, 2024
Merged

Allow Foundation subsidy to be waived #237

merged 4 commits into from
Dec 2, 2024

Conversation

lukechampine
Copy link
Member

v2 transactions have a NewFoundationAddress field, which, if present, updates both the primary and failsafe addresses. This PR tweaks the update logic slightly: if the new address is types.VoidAddress, only the primary address is updated. (State).FoundationSubsidy also now returns false if the primary address is types.VoidAddress. Together, these changes allow the Foundation to effectively waive the subsidy until a new, non-void primary address is set. This is preferable to receiving and then later burning the subsidy; instead, the subsidy is simply not created in the first place.

I also renamed "primary" and "failsafe" to "subsidy" and "management" to reflect the function of these addresses in v2. The "subsidy" address receives the subsidies, while the "management" address is used to update addresses. (Note that, thanks to spend policies, the old "primary" and "failsafe" can be combined into one address using a threshold policy.)

Checking for types.VoidAddress might seem like a bit of a hack. Alternatively, we could expand the definition of NewFoundationAddress. Technically, this would change the encoding of V2Transaction; however, AFAICT, it would not actually cause any breakage, as the field is a pointer and has never been used in the v2 testnet (hence always encoded as false).

@n8maninger n8maninger changed the title All Foundation subsidy to be waived Allow Foundation subsidy to be waived Nov 27, 2024
@n8maninger
Copy link
Member

🧪

@lukechampine
Copy link
Member Author

Would be cool if there was a GitHub action that enforced that a test failed prior to the PR 🤔

@n8maninger n8maninger merged commit b5ca54b into master Dec 2, 2024
9 checks passed
@n8maninger n8maninger deleted the waive-subsidy branch December 2, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants