How to view complete non-named neuron voting history

Right, so I could extended the period which rewards were distributed, and it would save the votes.

Use the VotingRewardsParameters and in that is round_duration_seconds. You can set this to as high as one year minus one second. Thus, you can save the votes for up to a year.

This also begs the question:

Why ARENT votes saved or cached. It seems logical to at least have an opt in sns parameter where history of neuron voting is saved.

For some reason I don’t think we are saying the same thing. Extending the voting period does not save the votes.

If you change this parameter, then the voting rewards will not be distributed for that period. I don’t think that is what you want. I also don’t think this is what triggers the ballots to be deleted. I believe that is triggered off of the voting period itself.

This is a great questions. I really wish all ballots were saved indefinitely. It would help in so many ways.

1 Like

Ok so it will save the votes tho even if rewards aren’t distributed for a year

On the SNS the votes have to be saved until rewards are distributed because they are the system of record. This code only runs, as far as I can tell, when the round time configured the SNS passes.

/// Returns `true` if enough time has passed since the end of the last reward round.
    ///
    /// The end of the last reward round is recorded in self.latest_reward_event.
    ///
    /// The (current) length of a reward round is specified in
    /// self.nervous_system_parameters.voting_reward_parameters
    fn should_distribute_rewards(&self) -> bool {
        let now = self.env.now();

        let voting_rewards_parameters = match &self
            .nervous_system_parameters_or_panic()
            .voting_rewards_parameters
        {
            None => return false,
            Some(ok) => ok,
        };
        let seconds_since_last_reward_event = now.saturating_sub(
            self.latest_reward_event()
                .end_timestamp_seconds
                .unwrap_or_default(),
        );

        let round_duration_seconds = match voting_rewards_parameters.round_duration_seconds {
            Some(s) => s,
            None => {
                log!(
                    ERROR,
                    "round_duration_seconds unset:\n{:#?}",
                    voting_rewards_parameters,
                );
                return false;
            }
        };

        seconds_since_last_reward_event > round_duration_seconds
    }

The ballots are only cleared…as far as I can tell in the distribut_rewards function:

2 Likes

This is phenomenal tbh that you found this failing the ability to restore voting history

You want to clear this with the sns team as processing too many votes at one time(once a year) may stall the canister due to cycle usage.

2 Likes

This is interesting. Thanks for sharing.

1 Like