Skip to content

Staking Async Feedback #11681

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Staking Async Feedback #11681

wants to merge 11 commits into from

Conversation

ap211unitech
Copy link
Member

@ap211unitech ap211unitech commented Jul 8, 2025

📝 Description

This PR addresses the feedback outlined in this issue. Below is an overview of the updated changes.

image image

@kianenigma
Copy link

I think you are still parsing the snapshot range wrong. It should have a value like:

  • None if Phase::None
  • 31 -> 15 (when we are for example in Phase::Snapshot(14)),
  • and 31 -> 0 in all other phases

This should always be the first and last item in this list: https://github.com/paritytech/polkadot-scripts/blob/51a99829460322be11379ea642f0642940604b1a/src/handlers.ts#L253C25-L254C15

@ap211unitech
Copy link
Member Author

Hi @kianenigma , I'm fetching it like this:

const snapshotRange = (
      await ahApi.query.multiBlockElection.pagedVoterSnapshotHash.entries()
    )
      .map(([k]) => k.args[0])
      .sort();

console.log(snapshotRange.map((a) => a.toHuman()));

and I am already rendering first and last item in list:

const uniquePages = Array.from(new Set(snapshotRange.map((p) => Number(p.toString())))).sort((a, b) => a - b);
const [minPage, maxPage] = [uniquePages[0], uniquePages[uniquePages.length - 1]];

The script you provided seems to fetch it the same way. Could you please clarify what I might be doing wrong?

@kianenigma
Copy link

I think it is likely because pagedVoterSnapshotHash is now a double map of (u32, u32) ((round, page_index)), and we are interested in page_index, so you should use k.args[1].

@ap211unitech
Copy link
Member Author

I think it is likely because pagedVoterSnapshotHash is now a double map of (u32, u32) ((round, page_index)), and we are interested in page_index, so you should use k.args[1].

Updated it now (and attached image as well)

@ap211unitech
Copy link
Member Author

Hi @kianenigma, When you have a moment, could you please provide your go-ahead so we can proceed with the review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants