-
Notifications
You must be signed in to change notification settings - Fork 249
feat: fill in validator hasher + fix signature verifier #2475
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
Conversation
|
The latest Buf updates on your PR. Results from workflow CI and Release / buf-check (pull_request).
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @julienrbrt, 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 introduces a new mechanism for handling validator hashes within block headers and significantly refactors how configuration options are passed to the block manager and the overall node. By consolidating related options into dedicated structs, I've improved the extensibility and maintainability of the codebase, allowing for more flexible customization of block creation and node behavior.
Highlights
- New Validator Hasher Provider: I've introduced a new
ValidatorHasherProviderfunction type and aDefaultValidatorHasherProviderintypes/hasher.go. This allows for configurable hashing of validator public keys and addresses, which is now used when creating new block headers inblock/manager.go. - Consolidated Manager Options: I've refactored the
block.Managerto accept a newManagerOptionsstruct. This struct now encapsulates both theSignaturePayloadProviderand the newly addedValidatorHasherProvider, making the block manager's configuration more organized and extensible. ThegetInitialStateandNewManagerfunctions inblock/manager.gohave been updated to use this new options struct. - Node Options Struct: To streamline node initialization, I've introduced a
NodeOptionsstruct innode/node.go. This struct now holds theblock.ManagerOptionsand is passed to thenewFullNodefunction. This change propagates through thepkg/cmd/run_node.goand variousapps(evm/based, evm/single, testapp) whereStartNodeis called, replacing directnilarguments withnode.NodeOptions{}. - Default Provider Functions: I've added explicit
DefaultSignaturePayloadProviderintypes/signer.goandDefaultManagerOptionsinblock/manager.go. These provide sensible defaults for the respective providers and options, improving clarity and reducing boilerplate.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 is currently in preview and 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 to provide feedback.
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
-
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. ↩
There was a problem hiding this 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 a ValidatorHasherProvider to allow for customizable validator hash generation in block headers. This enhances the flexibility of the system. The implementation refactors the codebase to pass ManagerOptions and NodeOptions through the call stack. I've identified areas for improvement related to error handling and code clarity.
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasherI've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
549c442 to
adcc1cb
Compare
|
Claude finished @julienrbrt's task —— View job Code Review Complete
|
|
Claude finished @julienrbrt's task —— View job Code Review Complete ✅I've thoroughly reviewed this PR and found it to be a well-structured enhancement with clean architecture patterns. Here's my comprehensive analysis: Review Todo List:
🟢 StrengthsArchitecture & Design
Code Quality
🟡 Issues to Address1. Critical: Silent Error Handling (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2475 +/- ##
==========================================
+ Coverage 73.05% 73.13% +0.08%
==========================================
Files 68 69 +1
Lines 6542 6558 +16
==========================================
+ Hits 4779 4796 +17
- Misses 1364 1365 +1
+ Partials 399 397 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Claude finished @julienrbrt's task —— View job Code Review Complete ✅I've thoroughly reviewed this PR and found it to be a well-structured enhancement with clean architecture patterns. Here's my comprehensive analysis: Review Todo List:
🟢 StrengthsArchitecture & Design
Code Quality
🟡 Issues to Address1. Critical: Silent Error Handling (
|
|
Claude finished @julienrbrt's task —— View job Code Review Complete ✅I've thoroughly reviewed this PR and found it to be a well-structured enhancement with clean architecture patterns. Here's my comprehensive analysis: Review Todo List:
🟢 StrengthsArchitecture & Design
Code Quality
🟡 Issues to Address1. Critical: Silent Error Handling (
|
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
93b0525 to
bd1b3a4
Compare
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
| return fmt.Errorf("failed to set custom verifier: %w", err) | ||
| } | ||
|
|
||
| if err := header.ValidateBasic(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were validating after applying the block just below, we do not need to do it twice.
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasherI've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
tac0turtle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR focusing on code quality, potential bugs, performance, security, and test coverage. Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|
|
Claude finished @julienrbrt's task —— View job Code Review: feat: fill in validator hasher ✅I've completed a comprehensive review of this PR that introduces ValidatorHasherProvider functionality and refactors configuration options. Here are my findings: Review Todo List:
SummaryThis PR successfully introduces a clean, extensible mechanism for validator hashing while refactoring configuration options. The implementation is well-structured, but there are a few areas that need attention. 🚨 Critical Issues1. Silent Error Handling (
|

Allow to provide validator hasher to avoid rollkit abci to resign.
Updates the manager api to take node options / manager options to make it future proof.
Additionally, fix a bug where you couldn't resync a abci exec chain because of header payload verification