Skip to content
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

Problem: no exposed db keyring used in the keystore #1419

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented May 2, 2024

simpily new keyring

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • Refactor

    • Simplified keyring logic for the e2ee module, enhancing maintainability and flexibility.
  • Chores

    • Updated version numbers and hashes for various modules in dependency configuration.
  • Tests

    • Adjusted package declaration and import statements for keyring tests.

Copy link
Contributor

coderabbitai bot commented May 2, 2024

Walkthrough

The recent changes in the cronos project simplify the keyring for the e2ee module, enhance maintainability, and update dependencies. The keyring refactoring consolidates backend handling, improves readability, and dynamically sets directories using reflection. Dependency versions and hashes are updated in gomod2nix.toml to ensure compatibility and stability.

Changes

Files/Paths Change Summary
CHANGELOG.md Added a summary of changes related to keyring simplification and dependency updates.
gomod2nix.toml Updated version numbers and hashes for various modules like cosmossdk.io/client/v2 and cosmossdk.io/store.
x/e2ee/keyring/keyring.go Refactored New function, removed constants, added keyringDirPrefix, and simplified backend handling.
x/e2ee/keyring/keyring_test.go Changed package declaration, modified import statements, and updated keyring.New to sdkkeyring.New.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant Keyring
    participant Backend

    User->>Keyring: Call New with backend type
    Keyring->>Backend: Initialize backend
    Backend->>Keyring: Return initialized backend
    Keyring->>User: Return keyring instance
Loading

Poem

In code's vast land, a keyring's light,
Simplified paths, now shining bright.
Backend checks, reflections clear,
Dependencies aligned, no fear.
With every change, our project grows,
In harmony, the code now flows.
🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 47.36842% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 36.08%. Comparing base (d41d670) to head (3cf11a2).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1419       +/-   ##
===========================================
+ Coverage   17.54%   36.08%   +18.54%     
===========================================
  Files          87      136       +49     
  Lines        5273     9732     +4459     
===========================================
+ Hits          925     3512     +2587     
- Misses       4238     5822     +1584     
- Partials      110      398      +288     
Files Coverage Δ
x/e2ee/keyring/keyring.go 67.56% <47.36%> (+41.44%) ⬆️

... and 72 files with indirect coverage changes

@mmsqe mmsqe marked this pull request as ready for review June 3, 2024 04:08
@mmsqe mmsqe requested a review from a team as a code owner June 3, 2024 04:08
@mmsqe mmsqe requested review from JayT106 and leejw51crypto and removed request for a team June 3, 2024 04:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Outside diff range and nitpick comments (1)
x/e2ee/keyring/keyring.go (1)

15-15: Consider adding a comment explaining the usage and purpose of keyringDirPrefix to improve code clarity.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d41d670 and 3cf11a2.

Files ignored due to path filters (2)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum
Files selected for processing (4)
  • CHANGELOG.md (1 hunks)
  • gomod2nix.toml (5 hunks)
  • x/e2ee/keyring/keyring.go (3 hunks)
  • x/e2ee/keyring/keyring_test.go (1 hunks)
Additional context used
LanguageTool
CHANGELOG.md

[grammar] ~21-~21: The conjunction “when” requires the past participle “registered”. Or did you mean “you register”?
Context: ...ronos/pull/1421) Validate e2ee key when register. * (store) [#1448](https://github.com/c...


[uncategorized] ~24-~24: You might be missing the article “the” here.
Context: ...n/cronos/pull/) Simpily new keyring for e2ee module. ### Bug Fixes * (rpc) [#1397]...


[misspelling] ~125-~125: Did you mean “or”? ‘Of’ refers to parts of a whole, while ‘or’ refers to alternatives.
Context: ...onos/pull/1216) Update ethermint to fix of avoid redundant parse chainID from gens...


[uncategorized] ~125-~125: This verb may not be in the correct form. Consider using a different form for this context.
Context: ...edundant parse chainID from gensis when start server. - [#1230](https://github.com/cr...


[uncategorized] ~137-~137: You might be missing the article “the” here.
Context: ...52) Add plan v1.1.0-testnet to update default max_callback_gas param. ### Improvemen...


[style] ~166-~166: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...n processing and double spend check. - [cronos#742](https://github.com/crypto-org-chai...


[style] ~167-~167: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...e handler for v0.8.0-gravity-alpha2. - [cronos#750](https://github.com/crypto-org-chai...


[style] ~168-~168: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...e handler for v0.8.0-gravity-alpha3. - [cronos#769](https://github.com/crypto-org-chai...


[uncategorized] ~168-~168: This verb may not be in the correct form. Consider using a different form for this context.
Context: ...l/769) Prevent cancellation function to be called outside the scope of the contrac...


[uncategorized] ~168-~168: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... outside the scope of the contract that manage it. - [cronos#775](https://github.com/c...


[style] ~169-~169: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...cope of the contract that manage it. - [cronos#775](https://github.com/crypto-org-chai...


[style] ~170-~170: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...775) Support turnbridge transaction. - [cronos#781](https://github.com/crypto-org-chai...


[uncategorized] ~170-~170: You might be missing the article “the” here.
Context: ...m//pull/781) Add prune command. - [cronos#830](https://github....


[style] ~171-~171: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: .../cronos/pull/781) Add prune command. - [cronos#830](https://github.com/crypto-org-chai...


[style] ~174-~174: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...upgrade handler for v2.0.0-testnet3. - [cronos#795](https://github.com/crypto-org-chai...


[style] ~175-~175: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: .../795) Support permissions in cronos. - [cronos#997](https://github.com/crypto-org-chai...


[style] ~176-~176: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ontract for cronos originated crc20. - [cronos#1005](https://github.com/crypto-org-cha...


[style] ~177-~177: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...o-ibc event in case of source token. - [cronos#1069](https://github.com/crypto-org-cha...


[style] ~178-~178: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...o v1.10.26 and ibc-go to v6.2.0. - [cronos#1147](https://github.com/crypto-org-cha...


[style] ~182-~182: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...adjusted correctly in ibc-go v7.2.0. - [cronos#1163](https://github.com/crypto-org-cha...


[style] ~183-~183: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ateful precompiled contract for ica. - [cronos#837](https://github.com/crypto-org-chai...


[style] ~184-~184: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...teful precompiled contract for bank. - [cronos#1184](https://github.com/crypto-org-cha...


[style] ~185-~185: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ull/1184) Update ibc-go to v7.3.1. - [cronos#1186](https://github.com/crypto-org-cha...


[uncategorized] ~185-~185: You might be missing the article “the” here.
Context: ...186) Enlarge the max block gas limit in new version. - [cronos#1187](https://github...


[style] ~186-~186: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... max block gas limit in new version. - [cronos#1187](https://github.com/crypto-org-cha...


[style] ~187-~187: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...1187) Disable gravity module in app. - [cronos#1185](https://github.com/crypto-org-cha...


[style] ~188-~188: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...nos/pull/1185) Support ibc callback. - [cronos#1196](https://github.com/crypto-org-cha...


[grammar] ~207-~207: It seems that “to” is missing before the verb.
Context: .../cronos/pull/1150) Fix memiavl's unsafe retain of the root hashes. ### Features - [#...


[misspelling] ~211-~211: Did you mean the phrasal verb “clean up” instead of the noun ‘cleanup’?
Context: .../pull/1042) call Close method on app to cleanup resource on graceful shutdown ([ethermi...


[uncategorized] ~212-~212: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...pto-org-chain/cronos/pull/1083) memiavl support both sdk 46 and 47 root hash rules. - [...


[uncategorized] ~214-~214: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...pto-org-chain/cronos/pull/1100) memiavl support read-only mode, and grab exclusive lock...


[uncategorized] ~224-~224: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...ypto-org-chain/cronos/pull/924) memiavl support Export API. - [#950](https://github.c...


[uncategorized] ~255-~255: You might be missing the article “the” here.
Context: ...949) Release static-linked binaries for linux platform. - [#934](https://github.com/c...


[uncategorized] ~326-~326: You might be missing the article “the” here.
Context: ...m//pull/781) Add prune command. - [#790](https://github.com/cr...


[grammar] ~327-~327: After ‘it’, use the third-person verb form “fixes”.
Context: ...790) Update cosmos-sdk to v0.46.7, it fix a migration issue which affects pending...


[style] ~394-~394: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...file state streamer (backport #702). - [cronos#730](https://github.com/crypto-org-chai...


[uncategorized] ~414-~414: You might be missing the article “the” here.
Context: ...0, cosmos sdk to v0.45.4 and gravity to latest, remove v0.7.0 related upgradeHandler. ...


[style] ~416-~416: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...elSendToChain support from evm call. - [cronos#600](https://github.com/crypto-org-chai...


[style] ~417-~417: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...plement bidirectional token mapping. - [cronos#611](https://github.com/crypto-org-chai...


[style] ~418-~418: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...owledgement error in ibc middleware. - [cronos#627](https://github.com/crypto-org-chai...


[style] ~433-~433: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...leware, use ibc-go upstream version. - [cronos#550](https://github.com/crypto-org-chai...


[style] ~434-~434: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...basic json-rpc apis on pruned nodes. - [cronos#549](https://github.com/crypto-org-chai...


[style] ~435-~435: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tom tx indexer feature of ethermint. - [cronos#673](https://github.com/crypto-org-chai...


[style] ~453-~453: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ed in json-rpc apis (backport #502). - [cronos#526](https://github.com/crypto-org-chai...


[style] ~454-~454: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... Fix tendermint duplicated tx issue. - [cronos#584](https://github.com/crypto-org-chai...


[style] ~455-~455: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...shes returned in some JSON-RPC apis. - [cronos#587](https://github.com/crypto-org-chai...


[style] ~456-~456: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... tx patch cmd recompute eth tx hash. - [cronos#595](https://github.com/crypto-org-chai...


[style] ~462-~462: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...nd to patch txs post v0.7.0 upgrade. - [cronos#522](https://github.com/crypto-org-chai...


[style] ~463-~463: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... the tendermint tx duplicated issue. - [cronos#585](https://github.com/crypto-org-chai...


[style] ~477-~477: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ase fee related logic in the code. - [ethermint#817](https://github.com/tharsis/ethermi...


[style] ~478-~478: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ogic related to effectiveGasPrice. - [ethermint#822](https://github.com/tharsis/ethermi...


[style] ~481-~481: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... tx when block gas limit exceeded. - [cosmos-sdk#10725](https://github.com/cosmos/cosmos...


[style] ~489-~489: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...e url query parameter in swagger-ui. - [cronos#328](https://github.com/crypto-org-chai...


[uncategorized] ~489-~489: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...b.com//pull/328) display detail panic information in query resul...


[style] ~490-~490: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...query result when --trace enabled. - [cronos#441](https://github.com/crypto-org-chai...


[uncategorized] ~495-~495: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... Upgrade gravity bridge to v0.3.9 which contain a bugfix on batchTxExecuted. - [crono...


[style] ~497-~497: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ll/329) Fix panic of eth_call on blocks prior to upgrade. - [cronos#340](https://github....


[style] ~498-~498: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...eth_call on blocks prior to upgrade. - [cronos#340](https://github.com/crypto-org-chai...


[style] ~499-~499: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...t, b) fix data races traceContext. - [cronos#370](https://github.com/crypto-org-chai...


[style] ~500-~500: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...g, add websockets integration tests. - [cronos#378](https://github.com/crypto-org-chai...


[uncategorized] ~500-~500: This verb may not be in the correct form. Consider using a different form for this context.
Context: ...bug fixes: a) fix tx inclusion issue by report correct gasWanted of eth tx, b) Add buf...


[style] ~501-~501: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... add returnValue message on tracing. - [cronos#446](https://github.com/crypto-org-chai...


[uncategorized] ~509-~509: You might be missing the article “a” here.
Context: ...in/cronos/pull/255) fix empty topics in non-breaking way - [cronos#270](https://git...


[uncategorized] ~557-~557: You might be missing the article “the” here.
Context: ...l/187) multiple denoms can be mapped to same contract - [cronos#157](https://github....


[uncategorized] ~566-~566: You might be missing the article “the” here.
Context: ... 2021* ## v0.6.0 This version removes gravity-bridge from cronos, also includes multi...


[uncategorized] ~609-~609: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...th a patched version of ethermint which include a bug fix on the transaction receipts e...


[uncategorized] ~621-~621: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...org Chain. In addition to that, it also upgrade ethermint to its latest version (v0.5.0...


[uncategorized] ~621-~621: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... to its latest version (v0.5.0.x) which bring several breaking changes (see [changelo...


[uncategorized] ~665-~665: You might be missing the article “the” here.
Context: ...arsis/ethermint/issues/342) Don't clear balance when resetting the account. - (ethermin...

Markdownlint
CHANGELOG.md

49-49: Expected: asterisk; Actual: dash
Unordered list style


61-61: Expected: asterisk; Actual: dash
Unordered list style


69-69: Expected: asterisk; Actual: dash
Unordered list style


77-77: Expected: asterisk; Actual: dash
Unordered list style


85-85: Expected: asterisk; Actual: dash
Unordered list style


86-86: Expected: asterisk; Actual: dash
Unordered list style


87-87: Expected: asterisk; Actual: dash
Unordered list style


91-91: Expected: asterisk; Actual: dash
Unordered list style


99-99: Expected: asterisk; Actual: dash
Unordered list style


100-100: Expected: asterisk; Actual: dash
Unordered list style


101-101: Expected: asterisk; Actual: dash
Unordered list style


102-102: Expected: asterisk; Actual: dash
Unordered list style


103-103: Expected: asterisk; Actual: dash
Unordered list style


104-104: Expected: asterisk; Actual: dash
Unordered list style


108-108: Expected: asterisk; Actual: dash
Unordered list style


109-109: Expected: asterisk; Actual: dash
Unordered list style


115-115: Expected: asterisk; Actual: dash
Unordered list style


116-116: Expected: asterisk; Actual: dash
Unordered list style


117-117: Expected: asterisk; Actual: dash
Unordered list style


118-118: Expected: asterisk; Actual: dash
Unordered list style


119-119: Expected: asterisk; Actual: dash
Unordered list style


123-123: Expected: asterisk; Actual: dash
Unordered list style


124-124: Expected: asterisk; Actual: dash
Unordered list style


125-125: Expected: asterisk; Actual: dash
Unordered list style


126-126: Expected: asterisk; Actual: dash
Unordered list style


127-127: Expected: asterisk; Actual: dash
Unordered list style


128-128: Expected: asterisk; Actual: dash
Unordered list style


132-132: Expected: asterisk; Actual: dash
Unordered list style


133-133: Expected: asterisk; Actual: dash
Unordered list style


134-134: Expected: asterisk; Actual: dash
Unordered list style


135-135: Expected: asterisk; Actual: dash
Unordered list style


136-136: Expected: asterisk; Actual: dash
Unordered list style


137-137: Expected: asterisk; Actual: dash
Unordered list style


141-141: Expected: asterisk; Actual: dash
Unordered list style


142-142: Expected: asterisk; Actual: dash
Unordered list style


143-143: Expected: asterisk; Actual: dash
Unordered list style


151-151: Expected: asterisk; Actual: dash
Unordered list style


152-152: Expected: asterisk; Actual: dash
Unordered list style


156-156: Expected: asterisk; Actual: dash
Unordered list style


164-164: Expected: asterisk; Actual: dash
Unordered list style


165-165: Expected: asterisk; Actual: dash
Unordered list style


166-166: Expected: asterisk; Actual: dash
Unordered list style


167-167: Expected: asterisk; Actual: dash
Unordered list style


168-168: Expected: asterisk; Actual: dash
Unordered list style


169-169: Expected: asterisk; Actual: dash
Unordered list style


170-170: Expected: asterisk; Actual: dash
Unordered list style


171-171: Expected: asterisk; Actual: dash
Unordered list style


172-172: Expected: asterisk; Actual: dash
Unordered list style


173-173: Expected: asterisk; Actual: dash
Unordered list style


174-174: Expected: asterisk; Actual: dash
Unordered list style


175-175: Expected: asterisk; Actual: dash
Unordered list style


176-176: Expected: asterisk; Actual: dash
Unordered list style


177-177: Expected: asterisk; Actual: dash
Unordered list style


178-178: Expected: asterisk; Actual: dash
Unordered list style


179-179: Expected: asterisk; Actual: dash
Unordered list style


180-180: Expected: asterisk; Actual: dash
Unordered list style


181-181: Expected: asterisk; Actual: dash
Unordered list style


182-182: Expected: asterisk; Actual: dash
Unordered list style


183-183: Expected: asterisk; Actual: dash
Unordered list style


184-184: Expected: asterisk; Actual: dash
Unordered list style


185-185: Expected: asterisk; Actual: dash
Unordered list style


186-186: Expected: asterisk; Actual: dash
Unordered list style


187-187: Expected: asterisk; Actual: dash
Unordered list style


188-188: Expected: asterisk; Actual: dash
Unordered list style


192-192: Expected: asterisk; Actual: dash
Unordered list style


193-193: Expected: asterisk; Actual: dash
Unordered list style


194-194: Expected: asterisk; Actual: dash
Unordered list style


195-195: Expected: asterisk; Actual: dash
Unordered list style


196-196: Expected: asterisk; Actual: dash
Unordered list style


197-197: Expected: asterisk; Actual: dash
Unordered list style


198-198: Expected: asterisk; Actual: dash
Unordered list style


199-199: Expected: asterisk; Actual: dash
Unordered list style


200-200: Expected: asterisk; Actual: dash
Unordered list style


201-201: Expected: asterisk; Actual: dash
Unordered list style


202-202: Expected: asterisk; Actual: dash
Unordered list style


203-203: Expected: asterisk; Actual: dash
Unordered list style


204-204: Expected: asterisk; Actual: dash
Unordered list style


205-205: Expected: asterisk; Actual: dash
Unordered list style


206-206: Expected: asterisk; Actual: dash
Unordered list style


207-207: Expected: asterisk; Actual: dash
Unordered list style


211-211: Expected: asterisk; Actual: dash
Unordered list style


212-212: Expected: asterisk; Actual: dash
Unordered list style


213-213: Expected: asterisk; Actual: dash
Unordered list style


214-214: Expected: asterisk; Actual: dash
Unordered list style


215-215: Expected: asterisk; Actual: dash
Unordered list style


216-216: Expected: asterisk; Actual: dash
Unordered list style


217-217: Expected: asterisk; Actual: dash
Unordered list style


218-218: Expected: asterisk; Actual: dash
Unordered list style


222-222: Expected: asterisk; Actual: dash
Unordered list style


223-223: Expected: asterisk; Actual: dash
Unordered list style


224-224: Expected: asterisk; Actual: dash
Unordered list style


225-225: Expected: asterisk; Actual: dash
Unordered list style


226-226: Expected: asterisk; Actual: dash
Unordered list style


227-227: Expected: asterisk; Actual: dash
Unordered list style


228-228: Expected: asterisk; Actual: dash
Unordered list style


229-229: Expected: asterisk; Actual: dash
Unordered list style


230-230: Expected: asterisk; Actual: dash
Unordered list style


231-231: Expected: asterisk; Actual: dash
Unordered list style


232-232: Expected: asterisk; Actual: dash
Unordered list style


233-233: Expected: asterisk; Actual: dash
Unordered list style


234-234: Expected: asterisk; Actual: dash
Unordered list style


235-235: Expected: asterisk; Actual: dash
Unordered list style


236-236: Expected: asterisk; Actual: dash
Unordered list style


237-237: Expected: asterisk; Actual: dash
Unordered list style


238-238: Expected: asterisk; Actual: dash
Unordered list style


239-239: Expected: asterisk; Actual: dash
Unordered list style


240-240: Expected: asterisk; Actual: dash
Unordered list style


241-241: Expected: asterisk; Actual: dash
Unordered list style


242-242: Expected: asterisk; Actual: dash
Unordered list style


243-243: Expected: asterisk; Actual: dash
Unordered list style


244-244: Expected: asterisk; Actual: dash
Unordered list style


245-245: Expected: asterisk; Actual: dash
Unordered list style


246-246: Expected: asterisk; Actual: dash
Unordered list style


254-254: Expected: asterisk; Actual: dash
Unordered list style


255-255: Expected: asterisk; Actual: dash
Unordered list style


256-256: Expected: asterisk; Actual: dash
Unordered list style


260-260: Expected: asterisk; Actual: dash
Unordered list style


261-261: Expected: asterisk; Actual: dash
Unordered list style


262-262: Expected: asterisk; Actual: dash
Unordered list style


263-263: Expected: asterisk; Actual: dash
Unordered list style


264-264: Expected: asterisk; Actual: dash
Unordered list style


265-265: Expected: asterisk; Actual: dash
Unordered list style


266-266: Expected: asterisk; Actual: dash
Unordered list style


274-274: Expected: asterisk; Actual: dash
Unordered list style


282-282: Expected: asterisk; Actual: dash
Unordered list style


286-286: Expected: asterisk; Actual: dash
Unordered list style


287-287: Expected: asterisk; Actual: dash
Unordered list style


288-288: Expected: asterisk; Actual: dash
Unordered list style


296-296: Expected: asterisk; Actual: dash
Unordered list style


300-300: Expected: asterisk; Actual: dash
Unordered list style


301-301: Expected: asterisk; Actual: dash
Unordered list style


302-302: Expected: asterisk; Actual: dash
Unordered list style


310-310: Expected: asterisk; Actual: dash
Unordered list style


318-318: Expected: asterisk; Actual: dash
Unordered list style


326-326: Expected: asterisk; Actual: dash
Unordered list style


327-327: Expected: asterisk; Actual: dash
Unordered list style


336-336: Expected: asterisk; Actual: dash
Unordered list style


344-344: Expected: asterisk; Actual: dash
Unordered list style


352-352: Expected: asterisk; Actual: dash
Unordered list style


360-360: Expected: asterisk; Actual: dash
Unordered list style


361-361: Expected: asterisk; Actual: dash
Unordered list style


362-362: Expected: asterisk; Actual: dash
Unordered list style


363-363: Expected: asterisk; Actual: dash
Unordered list style


371-371: Expected: asterisk; Actual: dash
Unordered list style


379-379: Expected: asterisk; Actual: dash
Unordered list style


380-380: Expected: asterisk; Actual: dash
Unordered list style


388-388: Expected: asterisk; Actual: dash
Unordered list style


392-392: Expected: asterisk; Actual: dash
Unordered list style


393-393: Expected: asterisk; Actual: dash
Unordered list style


394-394: Expected: asterisk; Actual: dash
Unordered list style


402-402: Expected: asterisk; Actual: dash
Unordered list style


414-414: Expected: asterisk; Actual: dash
Unordered list style


415-415: Expected: asterisk; Actual: dash
Unordered list style


416-416: Expected: asterisk; Actual: dash
Unordered list style


417-417: Expected: asterisk; Actual: dash
Unordered list style


418-418: Expected: asterisk; Actual: dash
Unordered list style


419-419: Expected: asterisk; Actual: dash
Unordered list style


420-420: Expected: asterisk; Actual: dash
Unordered list style


424-424: Expected: asterisk; Actual: dash
Unordered list style


425-425: Expected: asterisk; Actual: dash
Unordered list style


426-426: Expected: asterisk; Actual: dash
Unordered list style


430-430: Expected: asterisk; Actual: dash
Unordered list style


431-431: Expected: asterisk; Actual: dash
Unordered list style


432-432: Expected: asterisk; Actual: dash
Unordered list style


433-433: Expected: asterisk; Actual: dash
Unordered list style


434-434: Expected: asterisk; Actual: dash
Unordered list style


435-435: Expected: asterisk; Actual: dash
Unordered list style


443-443: Expected: asterisk; Actual: dash
Unordered list style


451-451: Expected: asterisk; Actual: dash
Unordered list style


452-452: Expected: asterisk; Actual: dash
Unordered list style


453-453: Expected: asterisk; Actual: dash
Unordered list style


454-454: Expected: asterisk; Actual: dash
Unordered list style


455-455: Expected: asterisk; Actual: dash
Unordered list style


456-456: Expected: asterisk; Actual: dash
Unordered list style


460-460: Expected: asterisk; Actual: dash
Unordered list style


461-461: Expected: asterisk; Actual: dash
Unordered list style


462-462: Expected: asterisk; Actual: dash
Unordered list style


463-463: Expected: asterisk; Actual: dash
Unordered list style


471-471: Expected: asterisk; Actual: dash
Unordered list style


472-472: Expected: asterisk; Actual: dash
Unordered list style


473-473: Expected: asterisk; Actual: dash
Unordered list style


474-474: Expected: asterisk; Actual: dash
Unordered list style


475-475: Expected: asterisk; Actual: dash
Unordered list style


476-476: Expected: asterisk; Actual: dash
Unordered list style


477-477: Expected: asterisk; Actual: dash
Unordered list style


478-478: Expected: asterisk; Actual: dash
Unordered list style


479-479: Expected: asterisk; Actual: dash
Unordered list style


480-480: Expected: asterisk; Actual: dash
Unordered list style


481-481: Expected: asterisk; Actual: dash
Unordered list style


482-482: Expected: asterisk; Actual: dash
Unordered list style


486-486: Expected: asterisk; Actual: dash
Unordered list style


487-487: Expected: asterisk; Actual: dash
Unordered list style


488-488: Expected: asterisk; Actual: dash
Unordered list style


489-489: Expected: asterisk; Actual: dash
Unordered list style


490-490: Expected: asterisk; Actual: dash
Unordered list style


494-494: Expected: asterisk; Actual: dash
Unordered list style


495-495: Expected: asterisk; Actual: dash
Unordered list style


496-496: Expected: asterisk; Actual: dash
Unordered list style


497-497: Expected: asterisk; Actual: dash
Unordered list style


498-498: Expected: asterisk; Actual: dash
Unordered list style


499-499: Expected: asterisk; Actual: dash
Unordered list style


500-500: Expected: asterisk; Actual: dash
Unordered list style


501-501: Expected: asterisk; Actual: dash
Unordered list style


509-509: Expected: asterisk; Actual: dash
Unordered list style


510-510: Expected: asterisk; Actual: dash
Unordered list style


518-518: Expected: asterisk; Actual: dash
Unordered list style


526-526: Expected: asterisk; Actual: dash
Unordered list style


527-527: Expected: asterisk; Actual: dash
Unordered list style


528-528: Expected: asterisk; Actual: dash
Unordered list style


532-532: Expected: asterisk; Actual: dash
Unordered list style


533-533: Expected: asterisk; Actual: dash
Unordered list style


541-541: Expected: asterisk; Actual: dash
Unordered list style


542-542: Expected: asterisk; Actual: dash
Unordered list style


543-543: Expected: asterisk; Actual: dash
Unordered list style


544-544: Expected: asterisk; Actual: dash
Unordered list style


545-545: Expected: asterisk; Actual: dash
Unordered list style


553-553: Expected: asterisk; Actual: dash
Unordered list style


557-557: Expected: asterisk; Actual: dash
Unordered list style


558-558: Expected: asterisk; Actual: dash
Unordered list style


559-559: Expected: asterisk; Actual: dash
Unordered list style


560-560: Expected: asterisk; Actual: dash
Unordered list style


570-570: Expected: asterisk; Actual: dash
Unordered list style


574-574: Expected: asterisk; Actual: dash
Unordered list style


575-575: Expected: asterisk; Actual: dash
Unordered list style


576-576: Expected: asterisk; Actual: dash
Unordered list style


577-577: Expected: asterisk; Actual: dash
Unordered list style


581-581: Expected: asterisk; Actual: dash
Unordered list style


582-582: Expected: asterisk; Actual: dash
Unordered list style


593-593: Expected: asterisk; Actual: dash
Unordered list style


594-594: Expected: asterisk; Actual: dash
Unordered list style


595-595: Expected: asterisk; Actual: dash
Unordered list style


596-596: Expected: asterisk; Actual: dash
Unordered list style


597-597: Expected: asterisk; Actual: dash
Unordered list style


601-601: Expected: asterisk; Actual: dash
Unordered list style


602-602: Expected: asterisk; Actual: dash
Unordered list style


603-603: Expected: asterisk; Actual: dash
Unordered list style


613-613: Expected: asterisk; Actual: dash
Unordered list style


614-614: Expected: asterisk; Actual: dash
Unordered list style


625-625: Expected: asterisk; Actual: dash
Unordered list style


629-629: Expected: asterisk; Actual: dash
Unordered list style


630-630: Expected: asterisk; Actual: dash
Unordered list style


631-631: Expected: asterisk; Actual: dash
Unordered list style


632-632: Expected: asterisk; Actual: dash
Unordered list style


633-633: Expected: asterisk; Actual: dash
Unordered list style


634-634: Expected: asterisk; Actual: dash
Unordered list style


636-636: Expected: asterisk; Actual: dash
Unordered list style


637-637: Expected: asterisk; Actual: dash
Unordered list style


645-645: Expected: asterisk; Actual: dash
Unordered list style


649-649: Expected: asterisk; Actual: dash
Unordered list style


653-653: Expected: asterisk; Actual: dash
Unordered list style


663-663: Expected: asterisk; Actual: dash
Unordered list style


664-664: Expected: asterisk; Actual: dash
Unordered list style


665-665: Expected: asterisk; Actual: dash
Unordered list style


666-666: Expected: asterisk; Actual: dash
Unordered list style


672-672: Expected: asterisk; Actual: dash
Unordered list style


673-673: Expected: asterisk; Actual: dash
Unordered list style


677-677: Expected: asterisk; Actual: dash
Unordered list style


35-35: null
Emphasis used instead of a heading


43-43: null
Emphasis used instead of a heading


55-55: null
Emphasis used instead of a heading


63-63: null
Emphasis used instead of a heading


71-71: null
Emphasis used instead of a heading


79-79: null
Emphasis used instead of a heading


93-93: null
Emphasis used instead of a heading


111-111: null
Emphasis used instead of a heading


145-145: null
Emphasis used instead of a heading


158-158: null
Emphasis used instead of a heading


248-248: null
Emphasis used instead of a heading


268-268: null
Emphasis used instead of a heading


276-276: null
Emphasis used instead of a heading


290-290: null
Emphasis used instead of a heading


304-304: null
Emphasis used instead of a heading


312-312: null
Emphasis used instead of a heading


320-320: null
Emphasis used instead of a heading


330-330: null
Emphasis used instead of a heading


338-338: null
Emphasis used instead of a heading


346-346: null
Emphasis used instead of a heading


354-354: null
Emphasis used instead of a heading


365-365: null
Emphasis used instead of a heading


373-373: null
Emphasis used instead of a heading


382-382: null
Emphasis used instead of a heading


396-396: null
Emphasis used instead of a heading


404-404: null
Emphasis used instead of a heading


408-408: null
Emphasis used instead of a heading


437-437: null
Emphasis used instead of a heading


445-445: null
Emphasis used instead of a heading


465-465: null
Emphasis used instead of a heading


503-503: null
Emphasis used instead of a heading


512-512: null
Emphasis used instead of a heading


520-520: null
Emphasis used instead of a heading


535-535: null
Emphasis used instead of a heading


547-547: null
Emphasis used instead of a heading


562-562: null
Emphasis used instead of a heading


584-584: null
Emphasis used instead of a heading


605-605: null
Emphasis used instead of a heading


616-616: null
Emphasis used instead of a heading


639-639: null
Emphasis used instead of a heading


655-655: null
Emphasis used instead of a heading

Additional comments not posted (7)
x/e2ee/keyring/keyring_test.go (2)

1-1: Change in package declaration to package keyring_test is appropriate for avoiding cyclic dependencies and ensuring that only exported identifiers are used in the tests.


9-11: The renaming of the keyring package import to sdkkeyring in the import statements is consistent with the new package declaration and helps avoid namespace conflicts.

x/e2ee/keyring/keyring.go (1)

Line range hint 58-75: The implementation of the keystore type methods Get and Set is clean and effectively encapsulates the keyring functionality.

gomod2nix.toml (4)

23-23: Updated version and hash for cosmossdk.io/client/v2 look correct.


48-48: Updated version and hash for cosmossdk.io/store look correct.


61-61: Updated version and hash for cosmossdk.io/x/tx look correct.


173-173: Updated version and hash for github.com/cosmos/cosmos-sdk look correct.

@@ -21,6 +21,7 @@
* (e2ee)[#1421](https://github.com/crypto-org-chain/cronos/pull/1421) Validate e2ee key when register.
* (store) [#1448](https://github.com/crypto-org-chain/cronos/pull/1448) Upgrade rocksdb to `v9.1.1`.
* [#1431](https://github.com/crypto-org-chain/cronos/pull/1431) Integrate testground to run benchmark on cluster.
* (e2ee)[#](https://github.com/crypto-org-chain/cronos/pull/) Simpily new keyring for e2ee module.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure the PR number is specified for the e2ee module keyring simplification.

It appears that the PR number is missing in the changelog entry for the e2ee module keyring simplification. This should be corrected to maintain accurate documentation and traceability. Here's a suggested change:

- * (e2ee)[#](https://github.com/crypto-org-chain/cronos/pull/) Simplify new keyring for e2ee module.
+ * (e2ee)[#1419](https://github.com/crypto-org-chain/cronos/pull/1419) Simplify new keyring for e2ee module.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
* (e2ee)[#](https://github.com/crypto-org-chain/cronos/pull/) Simpily new keyring for e2ee module.
* (e2ee)[#1419](https://github.com/crypto-org-chain/cronos/pull/1419) Simplify new keyring for e2ee module.
Tools
LanguageTool

[uncategorized] ~24-~24: You might be missing the article “the” here.
Context: ...n/cronos/pull/) Simpily new keyring for e2ee module. ### Bug Fixes * (rpc) [#1397]...

)

func TestKeyring(t *testing.T) {
kr, err := New("cronosd", keyring.BackendTest, t.TempDir(), nil)
kr, err := keyring.New("cronosd", sdkkeyring.BackendTest, t.TempDir(), nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

The function call keyring.New should be updated to sdkkeyring.New to reflect the new import alias and ensure consistency.

Comment on lines +26 to +48
var db keyring.Keyring
if backend == sdkkeyring.BackendMemory {
db = keyring.NewArrayKeyring(nil)
} else {
kr, err := sdkkeyring.New(serviceName, backend, rootDir, userInput, nil)
if err != nil {
return nil, err
}
db = kr.DB()
switch backend {
case sdkkeyring.BackendTest, sdkkeyring.BackendFile:
fileDir := filepath.Join(rootDir, fmt.Sprintf(keyringDirPrefix, backend))
el := reflect.ValueOf(db).Elem()
if f := el.FieldByName("dir"); f.IsValid() {
reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Elem().SetString(fileDir)
}
case sdkkeyring.BackendPass:
prefix := fmt.Sprintf(keyringDirPrefix, serviceName)
el := reflect.ValueOf(db).Elem()
if f := el.FieldByName("prefix"); f.IsValid() {
reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Elem().SetString(prefix)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of reflection and unsafe operations in the New function increases flexibility but also adds complexity and potential risks. Consider alternative approaches that avoid reflection for better maintainability and safety.

"path/filepath"
"reflect"

Check notice

Code scanning / CodeQL

Sensitive package import Note

Certain system packages contain functions which may be a possible source of non-determinism
"path/filepath"
"reflect"
"unsafe"

Check notice

Code scanning / CodeQL

Sensitive package import Note

Certain system packages contain functions which may be a possible source of non-determinism
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.

1 participant