Skip to content

Commit

Permalink
feat: comment out bls checks
Browse files Browse the repository at this point in the history
  • Loading branch information
AnshuJalan committed Sep 19, 2024
1 parent ec553f7 commit bc70110
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions SmartContracts/src/avs/PreconfRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,19 @@ contract PreconfRegistry is IPreconfRegistry, BLSSignatureChecker, Initializable
revert PreconferNotRegistered();
}

bytes memory message = _createMessage(ValidatorOp.ADD, addValidatorParams[i].signatureExpiry, msg.sender);
// Note: BLS signature checks are commented out for the POC

// bytes memory message = _createMessage(ValidatorOp.ADD, addValidatorParams[i].signatureExpiry, msg.sender);

// Revert if any signature is invalid
if (!verifySignature(message, addValidatorParams[i].signature, addValidatorParams[i].pubkey)) {
revert InvalidValidatorSignature();
}
// if (!verifySignature(message, addValidatorParams[i].signature, addValidatorParams[i].pubkey)) {
// revert InvalidValidatorSignature();
// }

// Revert if the signature has expired
if (block.timestamp > addValidatorParams[i].signatureExpiry) {
revert ValidatorSignatureExpired();
}
// if (block.timestamp > addValidatorParams[i].signatureExpiry) {
// revert ValidatorSignatureExpired();
// }

// Point compress the public key just how it is done on the consensus layer
uint256[2] memory compressedPubKey = addValidatorParams[i].pubkey.compress();
Expand Down Expand Up @@ -167,18 +169,20 @@ contract PreconfRegistry is IPreconfRegistry, BLSSignatureChecker, Initializable
revert ValidatorAlreadyInactive();
}

bytes memory message =
_createMessage(ValidatorOp.REMOVE, removeValidatorParams[i].signatureExpiry, validator.preconfer);
// Note: BLS signature checks have been commented out

// Revert if any signature is invalid
if (!verifySignature(message, removeValidatorParams[i].signature, removeValidatorParams[i].pubkey)) {
revert InvalidValidatorSignature();
}
// bytes memory message =
// _createMessage(ValidatorOp.REMOVE, removeValidatorParams[i].signatureExpiry, validator.preconfer);

// Revert if the signature has expired
if (block.timestamp > removeValidatorParams[i].signatureExpiry) {
revert ValidatorSignatureExpired();
}
// // Revert if any signature is invalid
// if (!verifySignature(message, removeValidatorParams[i].signature, removeValidatorParams[i].pubkey)) {
// revert InvalidValidatorSignature();
// }

// // Revert if the signature has expired
// if (block.timestamp > removeValidatorParams[i].signatureExpiry) {
// revert ValidatorSignatureExpired();
// }

unchecked {
// We also need to delay the removal by two epochs to avoid contradicting the lookahead
Expand Down

0 comments on commit bc70110

Please sign in to comment.