-
Notifications
You must be signed in to change notification settings - Fork 235
release: prepare v1.0.0-beta.0 #362
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
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the 📝 WalkthroughWalkthroughThis update adjusts several constants and keyring configurations within the application. The coin type constant in the core configuration has been modified, and the upgrade version identifier has been updated to reflect a beta release. Additionally, the keyring options for CLI commands have been refined by replacing a generic option with one specific to Ethereum Secp256k1, alongside a new function to override the default key type. Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as "CLI"
participant Root as "root.go"
participant KR as "keyring/options.go"
CLI->>Root: Initialize command
Root->>KR: Apply EthSecp256k1 keyring option
Root->>KR: Invoke OverrideDefaultKeyType on key commands
KR-->>Root: Return command with updated default key type
Root-->>CLI: CLI ready with new key configuration
Possibly related PRs
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
Dependency ReviewThe following issues were found:
License Issuesgo.mod
Denied Licenses: GPL-1.0-or-later, LGPL-2.0-or-later OpenSSF Scorecard
Scanned Files
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.mod
is excluded by!**/*.mod
go.sum
is excluded by!**/*.sum
,!**/*.sum
📒 Files selected for processing (4)
app/const.go
(1 hunks)app/upgrade.go
(1 hunks)cmd/initiad/root.go
(2 hunks)crypto/keyring/options.go
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Run test and upload codecov
- GitHub Check: golangci-lint
- GitHub Check: Run test and upload codecov
- GitHub Check: golangci-lint
- GitHub Check: Analyze (go)
🔇 Additional comments (5)
app/upgrade.go (1)
10-10
: Version bump to v1.0.0-beta.0This upgrade name change from the previous version to v1.0.0-beta.0 aligns with the PR's purpose of preparing for this release. Ensure that all necessary migrations and changes are included in this upgrade handler.
crypto/keyring/options.go (2)
3-8
: Added cobra import for command overridesThe import of the cobra package is required for the new OverrideDefaultKeyType function.
37-54
:✅ Verification successful
New function to set eth_secp256k1 as default key type
This new function overrides the default key type for commands to use Ethereum Secp256k1. This is a user-facing change that affects how keys are generated by default.
Key observations:
- The function iterates through all subcommands to find the key type flag
- It sets the default value to eth_secp256k1
- It panics if the flag value cannot be set, which is appropriate for initialization
🏁 Script executed:
#!/bin/bash # Check for any usages of key types in the codebase that might be affected echo "Checking existing key type references..." rg "KeyType|key-type" --type goLength of output: 4314
Override Default Key Type for Commands Confirmed
The implementation of
OverrideDefaultKeyType
incrypto/keyring/options.go
properly iterates over the subcommands, identifies the key type flag, and updates its default value toeth_secp256k1
usinghd.EthSecp256k1Type
. Our repository scan confirms that this approach is consistent with other references (e.g., incrypto/ethsecp256k1/ethsecp256k1.go
andcrypto/hd/algorithm.go
). Additionally, panicking on error during initialization is acceptable here to prevent misconfiguration.
- File:
crypto/keyring/options.go
(Lines: 37-54)- Key update: Default key type is correctly updated for all subcommands.
- Consistency: Confirmed by scanning for key type references across the codebase.
Approved as-is.
cmd/initiad/root.go (2)
92-92
: Changed to use EthSecp256k1Option for keyringSwitched from a generic Option() to the specific EthSecp256k1Option(), which configures the keyring to prefer Ethereum-compatible keys. This aligns with the coin type change to 60.
196-196
:✅ Verification successful
Applied default key type override to key commands
Now wrapping the keys.Commands() with OverrideDefaultKeyType to ensure all key-related commands default to eth_secp256k1 key type, consistent with the other changes in this PR.
🏁 Script executed:
#!/bin/bash # Let's check how this might affect existing keys commands echo "Checking key commands that might be affected by the default key type change..." ./initiad keys --help 2>/dev/null || echo "Command not available in sandbox" # Check if there are any references to the old key type that might need updating echo "Checking for any hardcoded references to secp256k1 that might need updating..." rg "secp256k1" --type goLength of output: 22551
Default key type override correctly applied to key commands
The update atcmd/initiad/root.go:196
now wrapskeys.Commands()
withcryptokeyring.OverrideDefaultKeyType
, ensuring that key-related commands use theeth_secp256k1
type by default. Our search for hardcoded references tosecp256k1
indicates that remaining references—in particular within test files—are consistent with this change and do not require further updates.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #362 +/- ##
==========================================
- Coverage 41.15% 41.14% -0.01%
==========================================
Files 269 269
Lines 25800 25805 +5
==========================================
Hits 10618 10618
- Misses 13527 13532 +5
Partials 1655 1655
🚀 New features to boost your workflow:
|
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...