Skip to content

Conversation

@ukint-vs
Copy link
Member

@ukint-vs ukint-vs commented Dec 4, 2025

  • fix storing requests in storage
  • Fix inadequate weight scaling

@reviewer-or-team

@ukint-vs ukint-vs requested review from ark0f and breathx December 4, 2025 10:20
@ukint-vs ukint-vs self-assigned this Dec 4, 2025
@ukint-vs ukint-vs added the A0-pleasereview PR is ready to be reviewed by the team label Dec 4, 2025
@semanticdiff-com
Copy link

semanticdiff-com bot commented Dec 4, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  pallets/grandpa-signer/src/lib.rs  35% smaller
  pallets/grandpa-signer/src/tests.rs  0% smaller

@gemini-code-assist
Copy link

Summary of Changes

Hello @ukint-vs, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements crucial fixes within the grandpa-signer pallet. It primarily addresses the storage behavior of signing requests, ensuring that completed requests and their signatures are persistently stored for future retrieval rather than being ephemeral. Concurrently, the PR refines the transaction weight calculations for key operations like scheduling and submitting signatures, optimizing resource allocation and resolving previous inaccuracies in weight scaling.

Highlights

  • Request Storage Retention: Completed signing requests and their associated signatures are now retained in storage instead of being automatically cleaned up. This changes the previous behavior where requests were dropped once fully signed or reached a signature cap.
  • Weight Calculation Refinement: The transaction weights for schedule_request and submit_signature have been adjusted and reduced. The previous calculations were deemed inadequate, and the update removes the dependency on MaxSignaturesPerRequest for weight scaling, leading to more efficient and accurate weight estimations.
  • SubmissionContext Simplification: The authorities field has been removed from the SubmissionContext struct, streamlining the data structure used for signing requests.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces two main changes: it modifies storage retention for signing requests to keep them after completion, and it adjusts the extrinsic weights. The change to retain completed requests is a significant behavioral shift, and the new test case helps verify this. However, I've identified a potential issue with the updated weight calculation for schedule_request, which appears to underestimate the number of writes, and I've also suggested an improvement to the new test to make it more robust.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

A0-pleasereview PR is ready to be reviewed by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants