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

Remediations re 7739 update #216

Merged
merged 6 commits into from
Nov 11, 2024
Merged

Conversation

filmakarov
Copy link
Collaborator

@filmakarov filmakarov commented Nov 8, 2024

Screenshot 2024-11-11 at 11 51 24

@filmakarov filmakarov changed the base branch from main to dev November 8, 2024 12:46
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.

Project coverage is 84.45%. Comparing base (bbe68ea) to head (0fd6769).
Report is 8 commits behind head on dev.

Files with missing lines Patch % Lines
contracts/Nexus.sol 46.15% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #216      +/-   ##
==========================================
- Coverage   84.68%   84.45%   -0.24%     
==========================================
  Files          13       13              
  Lines         849      849              
  Branches      271      249      -22     
==========================================
- Hits          719      717       -2     
- Misses        115      117       +2     
  Partials       15       15              
Files with missing lines Coverage Δ
contracts/modules/validators/K1Validator.sol 70.12% <ø> (+1.45%) ⬆️
contracts/Nexus.sol 82.41% <46.15%> (-2.25%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d015436...0fd6769. Read the comment docs.

Copy link

openzeppelin-code bot commented Nov 8, 2024

Remediations re 7739 update

Generated at commit: 0fd6769c7aa33c76ce0226bc435319475aea723e

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
1
0
6
27
35

For more details view the full report in OpenZeppelin Code Inspector

@@ -226,7 +227,9 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra
/// @dev Delegates the validation to a validator module specified within the signature data.
function isValidSignature(bytes32 hash, bytes calldata signature) external view virtual override returns (bytes4) {
// Handle potential ERC7739 support detection request
if (checkERC7739Support(hash, signature)) return SUPPORTS_ERC7739;
if (signature.length == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if signature length is 0 then check? is this correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, it's in 7739 spec

if (IValidator(next).isValidSignatureWithSender(msg.sender, hash, signature) == SUPPORTS_ERC7739) return true;
}
// Forces the compiler to optimize for smaller bytecode size.
if (uint256(hash) == (~signature.length / 0xffff) * 0x7739) {
Copy link
Contributor

Choose a reason for hiding this comment

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

curious what does ~ do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is bitwise negation. so it makes 0xfff..fff out of 0.

Copy link
Contributor

@livingrockrises livingrockrises left a comment

Choose a reason for hiding this comment

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

reviewed

Copy link

Changes to gas cost

Generated at commit: c4021ebc40f20b984ae8a173d2e0605f3bfac4cf, compared to commit: d015436cd84f554ed22033dd399387a494b7a0dd

🧾 Summary (5% most significant diffs)

Contract Method Avg (+/-) %
Nexus validateUserOp +6 ❌ +0.04%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
Nexus 4,762,675 (+30,870) validateUserOp 13,865 (+6) +0.04% 15,436 (+6) +0.04% 13,865 (+6) +0.04% 42,634 (+6) +0.01% 347 (0)
MockValidator 990,635 (+12,833)

Copy link

🤖 Slither Analysis Report 🔎

Slither report

# Slither report

THIS CHECKLIST IS NOT COMPLETE. Use --show-ignored-findings to show all the results.
Summary
🟡 - locked-ether (1 results) (Medium)

locked-ether

🟡 Impact: Medium
🔴 Confidence: High

utils/NexusBootstrap.sol#L33-L165

constable-states

Impact: Optimization
🔴 Confidence: High

base/RegistryAdapter.sol#L10

factory/RegistryFactory.sol#L39

_This comment was automatically generated by the GitHub Actions workflow._

@filmakarov filmakarov merged commit 72499c9 into dev Nov 11, 2024
9 of 10 checks passed
@filmakarov filmakarov deleted the fix/cantina-notes-on-7739-update branch November 11, 2024 16:42
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.

2 participants