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

update blob verifier #992

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/src/core/EigenDABlobVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ contract EigenDABlobVerifier is IEigenDABlobVerifier {
return EigenDABlobVerificationUtils._getNonSignerStakesAndSignature(
operatorStateRetriever,
registryCoordinator,
signedBatch.attestation
signedBatch
);
}

Expand Down
1 change: 0 additions & 1 deletion contracts/src/interfaces/IEigenDAStructs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ struct Attestation {
BN254.G1Point sigma;
BN254.G2Point apkG2;
uint32[] quorumNumbers;
uint32 referenceBlockNumber;
}

///////////////////////// SIGNATURE VERIFIER ///////////////////////////////
Expand Down
26 changes: 13 additions & 13 deletions contracts/src/libraries/EigenDABlobVerificationUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ library EigenDABlobVerificationUtils {
NonSignerStakesAndSignature memory nonSignerStakesAndSignature = _getNonSignerStakesAndSignature(
operatorStateRetriever,
registryCoordinator,
signedBatch.attestation
signedBatch
);

_verifyBlobV2ForQuorums(
Expand Down Expand Up @@ -336,7 +336,7 @@ library EigenDABlobVerificationUtils {
NonSignerStakesAndSignature memory nonSignerStakesAndSignature = _getNonSignerStakesAndSignature(
operatorStateRetriever,
registryCoordinator,
signedBatch.attestation
signedBatch
);

_verifyBlobV2ForQuorumsForThresholds(
Expand All @@ -354,30 +354,30 @@ library EigenDABlobVerificationUtils {
function _getNonSignerStakesAndSignature(
OperatorStateRetriever operatorStateRetriever,
IRegistryCoordinator registryCoordinator,
Attestation memory attestation
SignedBatch memory signedBatch
) internal view returns (NonSignerStakesAndSignature memory nonSignerStakesAndSignature) {
bytes32[] memory nonSignerOperatorIds = new bytes32[](attestation.nonSignerPubkeys.length);
for (uint i = 0; i < attestation.nonSignerPubkeys.length; ++i) {
nonSignerOperatorIds[i] = BN254.hashG1Point(attestation.nonSignerPubkeys[i]);
bytes32[] memory nonSignerOperatorIds = new bytes32[](signedBatch.attestation.nonSignerPubkeys.length);
for (uint i = 0; i < signedBatch.attestation.nonSignerPubkeys.length; ++i) {
nonSignerOperatorIds[i] = BN254.hashG1Point(signedBatch.attestation.nonSignerPubkeys[i]);
}

bytes memory quorumNumbers;
for (uint i = 0; i < attestation.quorumNumbers.length; ++i) {
quorumNumbers = abi.encodePacked(quorumNumbers, uint8(attestation.quorumNumbers[i]));
for (uint i = 0; i < signedBatch.attestation.quorumNumbers.length; ++i) {
quorumNumbers = abi.encodePacked(quorumNumbers, uint8(signedBatch.attestation.quorumNumbers[i]));
}

OperatorStateRetriever.CheckSignaturesIndices memory checkSignaturesIndices = operatorStateRetriever.getCheckSignaturesIndices(
registryCoordinator,
attestation.referenceBlockNumber,
signedBatch.batchHeader.referenceBlockNumber,
quorumNumbers,
nonSignerOperatorIds
);

nonSignerStakesAndSignature.nonSignerQuorumBitmapIndices = checkSignaturesIndices.nonSignerQuorumBitmapIndices;
nonSignerStakesAndSignature.nonSignerPubkeys = attestation.nonSignerPubkeys;
nonSignerStakesAndSignature.quorumApks = attestation.quorumApks;
nonSignerStakesAndSignature.apkG2 = attestation.apkG2;
nonSignerStakesAndSignature.sigma = attestation.sigma;
nonSignerStakesAndSignature.nonSignerPubkeys = signedBatch.attestation.nonSignerPubkeys;
nonSignerStakesAndSignature.quorumApks = signedBatch.attestation.quorumApks;
nonSignerStakesAndSignature.apkG2 = signedBatch.attestation.apkG2;
nonSignerStakesAndSignature.sigma = signedBatch.attestation.sigma;
nonSignerStakesAndSignature.quorumApkIndices = checkSignaturesIndices.quorumApkIndices;
nonSignerStakesAndSignature.totalStakeIndices = checkSignaturesIndices.totalStakeIndices;
nonSignerStakesAndSignature.nonSignerStakeIndices = checkSignaturesIndices.nonSignerStakeIndices;
Expand Down
Loading