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

fix: signature utils #1015

Open
wants to merge 7 commits into
base: slashing-magnitudes-fixes
Choose a base branch
from

Conversation

0xClandestine
Copy link
Contributor

@0xClandestine 0xClandestine commented Jan 11, 2025

Changes:

  • Dynamic Domain Separator: SignatureUtils.domainSeparator() is now recomputed for each signature verification. This eliminates the need for storing initial values in storage or as immutables, which is important for beacon proxy support.

  • Version Bump Command: Introduced make bump-version VERSION=2, which automatically updates the version function's return values.

Copy link
Collaborator

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

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

Can we sanity check that the domain separator of the DM/RC/AVSD is based on the proxy and not the implementation

@0xClandestine
Copy link
Contributor Author

Can we sanity check that the domain separator of the DM/RC/AVSD is based on the proxy and not the implementation

Oops, forgot that. Will do.

Copy link
Collaborator

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

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

Comments regarding version number

@@ -0,0 +1,20 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be handled via Zeus, we should coordinate with Justin to add this as a parameter that the deploy scripts can use

@@ -139,4 +139,8 @@ contract AVSDirectory is
keccak256(abi.encode(OPERATOR_AVS_REGISTRATION_TYPEHASH, operator, avs, salt, expiry))
);
}

function version() public pure override(ISignatureUtils, SignatureUtils) returns (string memory) {
return "1.0.3";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not set version as a constructor parameter so Zeus scripts can handle it?

@@ -1011,4 +1011,8 @@ contract DelegationManager is
)
);
}

function version() public pure override(ISignatureUtils, SignatureUtils) returns (string memory) {
return "1.0.3";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Per EIP-712 spec, version is simply the major version number (not minor + patch). We should follow this and keep it "1" on all environments.

https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#definition-of-domainseparator

string version the current major version of the signing domain. Signatures from different versions are not compatible.

@@ -6,6 +6,7 @@ import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol";

import "src/contracts/core/RewardsCoordinator.sol";
import "src/contracts/strategies/StrategyBase.sol";
import "src/contracts/mixins/SignatureUtils.sol";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Extra import?

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