StrategyManager - Cross-Chain Replay Attacks After Chain Split Due to Hard-Coded DOMAIN_SEPARATOR
A. The `StrategyManager` contract allows stakers to deposit into and withdraw from strategies. A staker can either deposit themself or have someone else do it on their behalf, where the latter requires an EIP-712-compliant signature. The EIP-712 domain separator is computed in the `initialize` function and stored in a state variable for later retrieval:\\n```\\n/// @notice EIP-712 Domain separator\\nbytes32 public DOMAIN\\_SEPARATOR;\\n```\\n\\n```\\nfunction initialize(address initialOwner, address initialStrategyWhitelister, IPauserRegistry \\_pauserRegistry, uint256 initialPausedStatus, uint256 \\_withdrawalDelayBlocks)\\n    external\\n    initializer\\n{\\n    DOMAIN\\_SEPARATOR = keccak256(abi.encode(DOMAIN\\_TYPEHASH, bytes("EigenLayer"), block.chainid, address(this)));\\n```\\n\\nOnce set in the `initialize` function, the value can't be changed anymore. In particular, the chain ID is “baked into” the `DOMAIN_SEPARATOR` during initialization. However, it is not necessarily constant: In the event of a chain split, only one of the resulting chains gets to keep the original chain ID, and the other should use a new one. With the current approach to compute the `DOMAIN_SEPARATOR` during initialization, store it, and then use the stored value for signature verification, a signature will be valid on both chains after a split - but it should not be valid on the chain with the new ID. Hence, the domain separator should be computed dynamically.\\nB. The `name` in the `EIP712Domain` is of type string:\\n```\\nbytes32 public constant DOMAIN\\_TYPEHASH =\\n    keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");\\n```\\n\\nWhat's encoded when the domain separator is computed is bytes("EigenLayer"):\\n```\\nDOMAIN\\_SEPARATOR = keccak256(abi.encode(DOMAIN\\_TYPEHASH, bytes("EigenLayer"), block.chainid, address(this)));\\n```\\n\\nAccording to EIP-712,\\nThe dynamic values `bytes` and `string` are encoded as a `keccak256` hash of their contents.\\nHence, `bytes("EigenLayer")` should be replaced with `keccak256(bytes("EigenLayer"))`.\\nC. The `EIP712Domain` does not include a version string:\\n```\\nbytes32 public constant DOMAIN\\_TYPEHASH =\\n    keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");\\n```\\n\\nThat is allowed according to the specification. However, given that most, if not all, projects, as well as OpenZeppelin's EIP-712 implementation, do include a version string in their `EIP712Domain`, it might be a pragmatic choice to do the same, perhaps to avoid potential incompatibilities.
Individual recommendations have been given above. Alternatively, you might want to utilize OpenZeppelin's `EIP712Upgradeable` library, which will take care of these issues. Note that some of these changes will break existing signatures.
```\\n/// @notice EIP-712 Domain separator\\nbytes32 public DOMAIN\\_SEPARATOR;\\n```\\n