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

Optimize BLSSignatureChecker #76

Closed
wants to merge 5 commits into from
Closed

Conversation

0x0aa0
Copy link
Contributor

@0x0aa0 0x0aa0 commented Nov 29, 2023

No description provided.

calculate operators negative APK on de/registration to prevent scalar multiplication at sigcheck runtime
@0x0aa0 0x0aa0 requested a review from gpsanant November 29, 2023 19:39
@@ -404,6 +407,16 @@ contract BLSRegistryCoordinatorWithIndices is EIP712, Initializable, IBLSRegistr
newBitmap: newBitmap
});

//Update the operator contribution to aggregate public key across all quorums
BN254.G1Point memory operatorPubkey = blsPubkeyRegistry.getOperatorPubkey(operator);
Copy link
Contributor

Choose a reason for hiding this comment

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

internal function for this?

@@ -404,6 +407,16 @@ contract BLSRegistryCoordinatorWithIndices is EIP712, Initializable, IBLSRegistr
newBitmap: newBitmap
});

//Update the operator contribution to aggregate public key across all quorums
BN254.G1Point memory operatorPubkey = blsPubkeyRegistry.getOperatorPubkey(operator);
operatorNegativeAPKs[operatorId] = operatorNegativeAPKs[operatorId].plus(
Copy link
Contributor

Choose a reason for hiding this comment

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

we should get rid of the other "time series" pubkey and replace it with this

);

{
BN254.G1Point memory operatorNegativeAPK = registryCoordinator.getOperatorNegativeAPK(nonSignerPubkeyHashes[i]);
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs to be verified to be at the reference block number

@0x0aa0 0x0aa0 marked this pull request as ready for review November 30, 2023 00:31
@0x0aa0 0x0aa0 requested a review from gpsanant November 30, 2023 00:31
@@ -168,10 +146,8 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
require(pairingSuccessful, "BLSSignatureChecker.checkSignatures: pairing precompile call failed");
require(signatureIsValid, "BLSSignatureChecker.checkSignatures: signature is invalid");
}
// set signatoryRecordHash variable used for fraudproofs
Copy link
Contributor

Choose a reason for hiding this comment

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

why deleting comments

@@ -69,96 +69,74 @@ contract BLSSignatureChecker is IBLSSignatureChecker {
bytes32
)
{
// verify the provided apk was the apk at referenceBlockNumber
// loop through every quorumNumber and keep track of the apk
QuorumStakeTotals memory quorumStakeTotals;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have estimates of how much gas this saves

@0x0aa0 0x0aa0 changed the base branch from m2-mainnet to fix/blssigchecker December 13, 2023 21:45
@0x0aa0 0x0aa0 changed the base branch from fix/blssigchecker to m2-mainnet December 13, 2023 21:46
@0x0aa0 0x0aa0 closed this Dec 19, 2023
@stevennevins stevennevins deleted the optimize-blssigcheck branch November 25, 2024 17:40
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