Skip to content

Commit

Permalink
update blob verifier (#992)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0aa0 authored Dec 12, 2024
1 parent 6588b33 commit 06e88b3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
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

0 comments on commit 06e88b3

Please sign in to comment.