Skip to content

feat: remove developer token vs swap_distribution.total_e8s validation check#9425

Draft
bjoernek wants to merge 6 commits intomasterfrom
bjoern/remove-developer-token-swap-check
Draft

feat: remove developer token vs swap_distribution.total_e8s validation check#9425
bjoernek wants to merge 6 commits intomasterfrom
bjoern/remove-developer-token-swap-check

Conversation

@bjoernek
Copy link
Contributor

@bjoernek bjoernek commented Mar 17, 2026

Summary

  • Remove the validation check that enforced developer-allocated tokens <= swap_distribution.total_e8s in FractionalDeveloperVotingPower::validate()
  • The Neurons' Fund has been discontinued so direct participants can assess for themselves whether the proposed token distributions are acceptable

…n check

The Neurons' Fund has been discontinued so direct participants can
assess for themselves whether the proposed token distributions are
acceptable. The overflow sanity check is kept.

This comment was marked as outdated.

This comment was marked as outdated.


if total_developer_e8s > swap_distribution.total_e8s {
return Err("Error: The sum of all developer allocated tokens must be less than or equal to swap_distribution.total_e8s".to_string());
if Self::get_total_distributions(&developer_distribution.developer_neurons).is_err() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place where get_total_distributions is called. The existing usage pattern is already a bit weird - the error message from this function is never used, and after the changes here, it's weirder as neither the u64 or the String in the return type Result<u64, String> is ever used. Consider simplifying by changing the function to something like fn check_total_developer_neurons_e8s_not_overflowing(&Vec<NeuronDistribution>) -> Result<(), String> and simply call Self::check_total_developer_neurons_e8s_not_overflowing()?

Actually, I wonder if this check can be removed entirely - it seems to me that the original "overflow" check was a byproduct of having to compute total_developer_e8s. It's not like we check every total is not overflow. I don't have a strong opinion about this though.

initial_token_distribution
.validate(&nervous_system_parameters)
.is_err()
.is_ok()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: in newer code we usually do assert_eq!(some_result, Ok()), so that when it fails we actually see the error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants