-
Notifications
You must be signed in to change notification settings - Fork 83
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
fix: epk encryption variable name typo #1544
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used📓 Learnings (2)📓 Common learnings
packages/transaction-manager/test/unit/utils/test-data.ts (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (2)
Finishing Touches
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? 🪧 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 (
|
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)
packages/transaction-manager/src/transactions-factory.ts (1)
222-222
: LGTM! Consider the planned refactoring.The fix correctly passes a single encryption parameter, consistent with the previous change. Note that this duplicated encryption logic is already tracked for refactoring when the epk-decryption-provider is removed.
While the current fix is correct, the FIXME comment could be enhanced with a reference to the tracking issue/PR for better documentation:
- // FIXME: Refactor, duplicated from createEncryptedTransactionInNewChannel + // FIXME: Refactor duplicated encryption logic from createEncryptedTransactionInNewChannel + // This will be addressed when removing epk-decryption-provider
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/transaction-manager/src/transactions-factory.ts
(2 hunks)
🧰 Additional context used
📓 Learnings (2)
📓 Common learnings
Learnt from: rodrigopavezi
PR: RequestNetwork/requestNetwork#1475
File: packages/transaction-manager/src/transactions-factory.ts:68-150
Timestamp: 2024-11-15T13:02:55.926Z
Learning: Refactoring of duplicate logic for encryption parameter handling in `packages/transaction-manager/src/transactions-factory.ts` will be addressed when removing `epk-decryption-provider`.
packages/transaction-manager/src/transactions-factory.ts (1)
Learnt from: rodrigopavezi
PR: RequestNetwork/requestNetwork#1475
File: packages/transaction-manager/src/transactions-factory.ts:68-150
Timestamp: 2024-11-15T13:02:55.926Z
Learning: Refactoring of duplicate logic for encryption parameter handling in `packages/transaction-manager/src/transactions-factory.ts` will be addressed when removing `epk-decryption-provider`.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-and-test
🔇 Additional comments (1)
packages/transaction-manager/src/transactions-factory.ts (1)
88-88
: LGTM! Verify the encryption works with the fixed parameter.The fix correctly passes a single encryption parameter instead of the array, which should resolve the EPK encryption issue.
To verify the fix works as expected, we can check for any error handling or logging related to encryption failures:
✅ Verification successful
✅ The encryption parameter fix is correctly implemented and well-tested
The test suite comprehensively verifies:
- Correct handling of encryption parameters in both methods
- Proper encryption output format and structure
- Error cases for invalid parameters
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for error handling or logging related to encryption failures rg -A 3 "encryption.*fail|fail.*encrypt"Length of output: 1914
Script:
#!/bin/bash # Get the test implementations for encryption-related tests ast-grep --pattern 'test($_, async () => { $$$ encryptedData $$$ })'Length of output: 76
Script:
#!/bin/bash # Search for encryption-related test cases rg -B 2 -A 10 "describe\(.*encrypt" packages/transaction-manager/test/unit/transactions-factory.test.tsLength of output: 105
Script:
#!/bin/bash # First find and then show content of the test file fd "transactions-factory.test.ts" && cat $(fd "transactions-factory.test.ts")Length of output: 9862
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.
@rodrigopavezi Can you add more detail why the current code is broken and the impact of this bug?
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.
Are we missing a test for this?
@alexandre-abrioux good call. Test added. |
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.
Approved 👍 pending comment resolution 🚧
Problem
EPK encryption through the EthereumPrivateKeyCipherProvider is broken. This issue was reported by @benjaminshafii where he was trying to create encrypted requests with the EthereumPrivateKeyCipherProvider and it was falling with the following error message:
Description of the changes
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Note: These changes are internal and should not directly impact end-user functionality.