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

feat(sns): Extend cast_vote_and_cascade_follow to take topic-based following into account #4583

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aterga
Copy link
Member

@aterga aterga commented Mar 28, 2025

This PR implements topic-based following, which legacy (function-based) following is kept as a fallback.

< Previous PR |

@github-actions github-actions bot added the feat label Mar 28, 2025
@aterga aterga force-pushed the arshavir/NNS1-3711-2 branch from be9a1b5 to 31e7d12 Compare March 31, 2025 15:21
@@ -318,6 +325,90 @@ impl Neuron {
Vote::Unspecified
}

/// Analogous to `would_follow_ballots`, but for topic-based following.
pub(crate) fn would_topic_follow_ballots(
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
pub(crate) fn would_topic_follow_ballots(
pub(crate) fn would_follow_ballots_based_on_topic(

Copy link
Member Author

Choose a reason for hiding this comment

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

Make this top-level, handle the fallback inside

continue;
};

// Supporting topic-based following with legacy (function-based) as fallback.
Copy link
Member Author

Choose a reason for hiding this comment

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

From here ...

ballots,
proposal_criticality,
);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

... till here, can all go into a dedicated method on Neuron

@@ -3635,9 +3794,16 @@ impl Governance {
// not (directly or indirectly) voted yet). That is, once a neuron is swayed,
// its vote is "locked in". IOW, swaying is "monotonic".
while !induction_votes.is_empty() {
#[derive(Eq, Ord, PartialEq, PartialOrd)]
enum FollowingType {
Copy link
Member Author

Choose a reason for hiding this comment

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

This info is most likely not necessary

Try to rewrite without keeping track of the edge type

Base automatically changed from arshavir/NNS1-3711-2 to master March 31, 2025 21:51
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.

1 participant