crypto-org-chain / cronos

Cronos is the first Ethereum-compatible blockchain network built on Cosmos SDK technology. Cronos aims to massively scale the DeFi, GameFi, and overall Web3 user community by providing builders with the ability to instantly port apps and crypto assets from other chains while benefiting from low transaction fees, high throughput, and fast finality.
Other
295 stars 237 forks source link

Problem: e2ee module not up to date #1610

Closed yihuang closed 1 month ago

yihuang commented 2 months ago

Solution:

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

PR Checklist:

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

Summary by CodeRabbit

Release Notes

coderabbitai[bot] commented 2 months ago

Walkthrough

The changes encompass various modifications across multiple files, primarily introducing functionalities related to end-to-end encryption (E2EE) and blocklist management. Key additions include the integration of the filippo.io/age package for E2EE, updates to transaction handling, and enhancements to the testing suite for E2EE key management. Dependencies have been removed, and existing functions have been refined to support the new features, particularly in transaction validation and blocklist processing.

Changes

Files Change Summary
CHANGELOG.md Added entry for synchronization of the e2ee module with the v1.3.x branch.
app/app.go, app/block_address.go Introduced E2EE functionality, including new identity handling, transaction proposal logic, and improved signer checks in block address validation.
go.mod, gomod2nix.toml Removed dependency on github.com/test-go/testify v1.1.4.
integration_tests/test_e2ee.py Enhanced tests for E2EE key management, added tests for blocklists, and refactored existing tests for clarity and structure, including new helper functions for key generation and blocklist encryption.

Possibly related PRs

Suggested reviewers

Poem

🐇 In the garden of code, new features bloom,
With blocklists and keys, there's always room.
Encrypting our secrets, we hop with delight,
In the world of E2EE, everything feels right!
So let's cheer for the changes, both big and small,
For a rabbit's new journey, we welcome them all! 🌼


📜 Recent review details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
📥 Commits Files that changed from the base of the PR and between 55f6856dbb26a11041226b68cdfda8f7284da9af and 44a007280af05d2ca964db3114070e37a5ed7f13.
📒 Files selected for processing (1) * app/app.go (10 hunks)
🚧 Files skipped from review as they are similar to previous changes (1) * app/app.go
--- 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 - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@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 using 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. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 54.01929% with 143 lines in your changes missing coverage. Please review.

Project coverage is 36.97%. Comparing base (bbdd407) to head (44a0072). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/proposal.go 22.66% 57 Missing and 1 partial :warning:
x/e2ee/client/cli/encrypt_to_validators.go 59.37% 13 Missing and 13 partials :warning:
x/cronos/types/messages.go 46.15% 13 Missing and 1 partial :warning:
x/e2ee/client/cli/pubkey.go 60.00% 5 Missing and 5 partials :warning:
x/e2ee/client/cli/query.go 82.22% 4 Missing and 4 partials :warning:
x/cronos/keeper/msg_server.go 0.00% 7 Missing :warning:
x/cronos/client/cli/tx.go 73.91% 3 Missing and 3 partials :warning:
x/cronos/keeper/grpc_query.go 0.00% 6 Missing :warning:
x/e2ee/types/msg.go 0.00% 5 Missing :warning:
x/e2ee/client/cli/tx.go 92.30% 1 Missing and 1 partial :warning:
... and 1 more
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610/graphs/tree.svg?width=650&height=150&src=pr&token=92w0Dz1Coj&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain)](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain) ```diff @@ Coverage Diff @@ ## main #1610 +/- ## ========================================== + Coverage 36.12% 36.97% +0.84% ========================================== Files 97 102 +5 Lines 7725 8035 +310 ========================================== + Hits 2791 2971 +180 - Misses 4585 4686 +101 - Partials 349 378 +29 ``` | [Files with missing lines](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain) | Coverage Δ | | |---|---|---| | [x/cronos/keeper/keeper.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=x%2Fcronos%2Fkeeper%2Fkeeper.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-eC9jcm9ub3Mva2VlcGVyL2tlZXBlci5nbw==) | `63.52% <100.00%> (+0.46%)` | :arrow_up: | | [x/cronos/types/keys.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=x%2Fcronos%2Ftypes%2Fkeys.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-eC9jcm9ub3MvdHlwZXMva2V5cy5nbw==) | `0.00% <ø> (ø)` | | | [x/e2ee/client/cli/cmd.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=x%2Fe2ee%2Fclient%2Fcli%2Fcmd.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-eC9lMmVlL2NsaWVudC9jbGkvY21kLmdv) | `100.00% <100.00%> (ø)` | | | [x/e2ee/module.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=x%2Fe2ee%2Fmodule.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-eC9lMmVlL21vZHVsZS5nbw==) | `65.95% <100.00%> (+3.16%)` | :arrow_up: | | [app/block\_address.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=app%2Fblock_address.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-YXBwL2Jsb2NrX2FkZHJlc3MuZ28=) | `23.07% <0.00%> (ø)` | | | [x/e2ee/client/cli/tx.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=x%2Fe2ee%2Fclient%2Fcli%2Ftx.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-eC9lMmVlL2NsaWVudC9jbGkvdHguZ28=) | `92.30% <92.30%> (ø)` | | | [x/e2ee/types/msg.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=x%2Fe2ee%2Ftypes%2Fmsg.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-eC9lMmVlL3R5cGVzL21zZy5nbw==) | `41.66% <0.00%> (-1.20%)` | :arrow_down: | | [x/cronos/client/cli/tx.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=x%2Fcronos%2Fclient%2Fcli%2Ftx.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-eC9jcm9ub3MvY2xpZW50L2NsaS90eC5nbw==) | `42.85% <73.91%> (+3.21%)` | :arrow_up: | | [x/cronos/keeper/grpc\_query.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=x%2Fcronos%2Fkeeper%2Fgrpc_query.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-eC9jcm9ub3Mva2VlcGVyL2dycGNfcXVlcnkuZ28=) | `0.00% <0.00%> (ø)` | | | [x/cronos/keeper/msg\_server.go](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree&filepath=x%2Fcronos%2Fkeeper%2Fmsg_server.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain#diff-eC9jcm9ub3Mva2VlcGVyL21zZ19zZXJ2ZXIuZ28=) | `14.28% <0.00%> (-1.79%)` | :arrow_down: | | ... and [5 more](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain) | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/crypto-org-chain/cronos/pull/1610/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=crypto-org-chain)
mmsqe commented 2 months ago

might add back identity part as well

yihuang commented 2 months ago

might add back identity part as well

Yes, I have sth in local, haven't finished