-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat: set signer extraction adapter #25008
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
This comment has been minimized.
This comment has been minimized.
📝 WalkthroughWalkthroughA setter method named Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
baseapp/abci_utils.go (1)
233-236: Docstring clarity & nil-adapter safeguardThe comment currently says: “sets the SetSignerExtractionAdapter”, which is redundant and unclear.
More importantly, callers can pass
nil.PrepareProposalHandlerlater dereferencesh.signerExtAdapter(line 301) without a nil check, so anilassignment here will trigger a runtime panic under load.-// SetSignerExtractionAdapter sets the SetSignerExtractionAdapter on the DefaultProposalHandler. +// SetSignerExtractionAdapter replaces the signer extraction adapter used by +// DefaultProposalHandler. The adapter must be non-nil. func (h *DefaultProposalHandler) SetSignerExtractionAdapter(signerExtAdapter mempool.SignerExtractionAdapter) { - h.signerExtAdapter = signerExtAdapter + if signerExtAdapter == nil { + panic("SetSignerExtractionAdapter: adapter must not be nil") + } + h.signerExtAdapter = signerExtAdapter }This keeps behaviour consistent with
PrepareProposalHandlerwhile preventing hard-to-trace panics.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting
📒 Files selected for processing (1)
baseapp/abci_utils.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: test-system
- GitHub Check: test-system-legacy
- GitHub Check: tests (02)
- GitHub Check: tests (01)
- GitHub Check: tests (00)
- GitHub Check: tests (03)
- GitHub Check: test-cosmovisor
- GitHub Check: test-integration
- GitHub Check: test-sim-nondeterminism
- GitHub Check: test-e2e
- GitHub Check: test-math
- GitHub Check: test-store
- GitHub Check: Analyze
- GitHub Check: Check up to date mocks
- GitHub Check: build (arm64)
- GitHub Check: build (amd64)
- GitHub Check: dependency-review
- GitHub Check: Gosec
- GitHub Check: golangci-lint
- GitHub Check: Summary
|
|
||
| // SetSignerExtractionAdapter sets the SetSignerExtractionAdapter on the DefaultProposalHandler. | ||
| func (h *DefaultProposalHandler) SetSignerExtractionAdapter(signerExtAdapter mempool.SignerExtractionAdapter) { | ||
| h.signerExtAdapter = signerExtAdapter |
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 use like this actually
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.
How are you getting transactions to pass through here?
cosmos-sdk/baseapp/abci_utils.go
Lines 301 to 306 in 3f8ef36
| signerData, err := h.signerExtAdapter.GetSigners(memTx) | |
| if err != nil { | |
| // propagate the error to the caller | |
| resError = err | |
| return false | |
| } |
aljo242
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.
lgtm with changelog - added backport flag
Co-authored-by: Alex | Interchain Labs <[email protected]> (cherry picked from commit da4517a) # Conflicts: # CHANGELOG.md
Co-authored-by: Vlad J <[email protected]> Co-authored-by: aljo242 <[email protected]>
Co-authored-by: Alex | Interchain Labs <[email protected]>
Co-authored-by: Alex | Interchain Labs <[email protected]>
Co-authored-by: Alex | Interchain Labs <[email protected]>
Adds a setter for signer extraction adapter.
Closes: #25007
Summary by CodeRabbit