diff --git a/contracts/src/core/EigenDAServiceManager.sol b/contracts/src/core/EigenDAServiceManager.sol index 3e44cfab21..d5b5fb36b5 100644 --- a/contracts/src/core/EigenDAServiceManager.sol +++ b/contracts/src/core/EigenDAServiceManager.sol @@ -80,10 +80,10 @@ contract EigenDAServiceManager is EigenDAServiceManagerStorage, ServiceManagerBa "EigenDAServiceManager.confirmBatch: specified referenceBlockNumber is too far in past" ); - //make sure that the quorumNumbers and confirmationThresholdPercentages are of the same length + //make sure that the quorumNumbers and signedStakeForQuorums are of the same length require( - batchHeader.quorumNumbers.length == batchHeader.confirmationThresholdPercentages.length, - "EigenDAServiceManager.confirmBatch: quorumNumbers and confirmationThresholdPercentages must be of the same length" + batchHeader.quorumNumbers.length == batchHeader.signedStakeForQuorums.length, + "EigenDAServiceManager.confirmBatch: quorumNumbers and signedStakeForQuorums must be of the same length" ); // calculate reducedBatchHeaderHash which nodes signed @@ -101,12 +101,12 @@ contract EigenDAServiceManager is EigenDAServiceManagerStorage, ServiceManagerBa ); // check that signatories own at least a threshold percentage of each quourm - for (uint i = 0; i < batchHeader.confirmationThresholdPercentages.length; i++) { - // we don't check that the confirmationThresholdPercentages are not >100 because a greater value would trivially fail the check, implying + for (uint i = 0; i < batchHeader.signedStakeForQuorums.length; i++) { + // we don't check that the signedStakeForQuorums are not >100 because a greater value would trivially fail the check, implying // signed stake > total stake require( quorumStakeTotals.signedStakeForQuorum[i] * THRESHOLD_DENOMINATOR >= - quorumStakeTotals.totalStakeForQuorum[i] * uint8(batchHeader.confirmationThresholdPercentages[i]), + quorumStakeTotals.totalStakeForQuorum[i] * uint8(batchHeader.signedStakeForQuorums[i]), "EigenDAServiceManager.confirmBatch: signatories do not own at least threshold percentage of a quorum" ); } diff --git a/contracts/src/interfaces/IEigenDAServiceManager.sol b/contracts/src/interfaces/IEigenDAServiceManager.sol index 0b540e6941..98def440c8 100644 --- a/contracts/src/interfaces/IEigenDAServiceManager.sol +++ b/contracts/src/interfaces/IEigenDAServiceManager.sol @@ -45,7 +45,7 @@ interface IEigenDAServiceManager is IServiceManager { struct BatchHeader { bytes32 blobHeadersRoot; bytes quorumNumbers; // each byte is a different quorum number - bytes confirmationThresholdPercentages; // every bytes is an amount less than 100 specifying the percentage of stake + bytes signedStakeForQuorums; // every bytes is an amount less than 100 specifying the percentage of stake // the must have signed in the corresponding quorum in `quorumNumbers` uint32 referenceBlockNumber; } diff --git a/contracts/src/libraries/EigenDARollupUtils.sol b/contracts/src/libraries/EigenDARollupUtils.sol index 0d8dd7e092..f68be7f0c4 100644 --- a/contracts/src/libraries/EigenDARollupUtils.sol +++ b/contracts/src/libraries/EigenDARollupUtils.sol @@ -72,7 +72,7 @@ library EigenDARollupUtils { } // make sure that the stake signed for is greater than the given confirmationThresholdPercentage - require(uint8(blobVerificationProof.batchMetadata.batchHeader.confirmationThresholdPercentages[uint8(blobVerificationProof.quorumThresholdIndexes[i])]) + require(uint8(blobVerificationProof.batchMetadata.batchHeader.signedStakeForQuorums[uint8(blobVerificationProof.quorumThresholdIndexes[i])]) >= blobHeader.quorumBlobParams[i].confirmationThresholdPercentage, "EigenDARollupUtils.verifyBlob: confirmationThresholdPercentage is not met" ); diff --git a/contracts/test/unit/EigenDABlobUtils.t.sol b/contracts/test/unit/EigenDABlobUtils.t.sol index 64387197d4..f9e8e39f83 100644 --- a/contracts/test/unit/EigenDABlobUtils.t.sol +++ b/contracts/test/unit/EigenDABlobUtils.t.sol @@ -82,7 +82,7 @@ contract EigenDABlobUtilsUnit is BLSMockAVSDeployer { // add dummy quorum numbers and quorum threshold percentages making sure confirmationThresholdPercentage = adversaryThresholdPercentage + defaultCodingRatioPercentage for (uint i = 0; i < blobHeader[1].quorumBlobParams.length; i++) { batchHeader.quorumNumbers = abi.encodePacked(batchHeader.quorumNumbers, blobHeader[1].quorumBlobParams[i].quorumNumber); - batchHeader.confirmationThresholdPercentages = abi.encodePacked(batchHeader.confirmationThresholdPercentages, blobHeader[1].quorumBlobParams[i].adversaryThresholdPercentage + defaultCodingRatioPercentage); + batchHeader.signedStakeForQuorums = abi.encodePacked(batchHeader.signedStakeForQuorums, blobHeader[1].quorumBlobParams[i].adversaryThresholdPercentage + defaultCodingRatioPercentage); } batchHeader.referenceBlockNumber = uint32(block.number); @@ -168,7 +168,7 @@ contract EigenDABlobUtilsUnit is BLSMockAVSDeployer { // add dummy quorum numbers and quorum threshold percentages making sure confirmationThresholdPercentage = adversaryThresholdPercentage + defaultCodingRatioPercentage for (uint i = 0; i < blobHeader[1].quorumBlobParams.length; i++) { batchHeader.quorumNumbers = abi.encodePacked(batchHeader.quorumNumbers, blobHeader[1].quorumBlobParams[i].quorumNumber); - batchHeader.confirmationThresholdPercentages = abi.encodePacked(batchHeader.confirmationThresholdPercentages, blobHeader[1].quorumBlobParams[i].adversaryThresholdPercentage + defaultCodingRatioPercentage); + batchHeader.signedStakeForQuorums = abi.encodePacked(batchHeader.signedStakeForQuorums, blobHeader[1].quorumBlobParams[i].adversaryThresholdPercentage + defaultCodingRatioPercentage); } batchHeader.referenceBlockNumber = uint32(block.number); @@ -214,7 +214,7 @@ contract EigenDABlobUtilsUnit is BLSMockAVSDeployer { // add dummy quorum numbers and quorum threshold percentages making sure confirmationThresholdPercentage = adversaryThresholdPercentage + defaultCodingRatioPercentage for (uint i = 0; i < blobHeader[1].quorumBlobParams.length; i++) { batchHeader.quorumNumbers = abi.encodePacked(batchHeader.quorumNumbers, blobHeader[1].quorumBlobParams[i].quorumNumber); - batchHeader.confirmationThresholdPercentages = abi.encodePacked(batchHeader.confirmationThresholdPercentages, blobHeader[1].quorumBlobParams[i].adversaryThresholdPercentage + defaultCodingRatioPercentage); + batchHeader.signedStakeForQuorums = abi.encodePacked(batchHeader.signedStakeForQuorums, blobHeader[1].quorumBlobParams[i].adversaryThresholdPercentage + defaultCodingRatioPercentage); } batchHeader.referenceBlockNumber = uint32(block.number); @@ -259,7 +259,7 @@ contract EigenDABlobUtilsUnit is BLSMockAVSDeployer { // add dummy quorum numbers and quorum threshold percentages making sure confirmationThresholdPercentage = 100 for (uint i = 0; i < blobHeader[1].quorumBlobParams.length; i++) { batchHeader.quorumNumbers = abi.encodePacked(batchHeader.quorumNumbers, blobHeader[1].quorumBlobParams[i].quorumNumber); - batchHeader.confirmationThresholdPercentages = abi.encodePacked(batchHeader.confirmationThresholdPercentages, blobHeader[1].quorumBlobParams[i].confirmationThresholdPercentage - 1); + batchHeader.signedStakeForQuorums = abi.encodePacked(batchHeader.signedStakeForQuorums, blobHeader[1].quorumBlobParams[i].confirmationThresholdPercentage - 1); } batchHeader.referenceBlockNumber = uint32(block.number); diff --git a/contracts/test/unit/EigenDAServiceManagerUnit.t.sol b/contracts/test/unit/EigenDAServiceManagerUnit.t.sol index d8ea5835ea..507ade35af 100644 --- a/contracts/test/unit/EigenDAServiceManagerUnit.t.sol +++ b/contracts/test/unit/EigenDAServiceManagerUnit.t.sol @@ -171,9 +171,9 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { function testConfirmBatch_Revert_LengthMismatch(uint256 pseudoRandomNumber) public { (IEigenDAServiceManager.BatchHeader memory batchHeader, BLSSignatureChecker.NonSignerStakesAndSignature memory nonSignerStakesAndSignature) = _getHeaderandNonSigners(0, pseudoRandomNumber, 100); - batchHeader.confirmationThresholdPercentages = new bytes(0); + batchHeader.signedStakeForQuorums = new bytes(0); - cheats.expectRevert(bytes("EigenDAServiceManager.confirmBatch: quorumNumbers and confirmationThresholdPercentages must be of the same length")); + cheats.expectRevert(bytes("EigenDAServiceManager.confirmBatch: quorumNumbers and signedStakeForQuorums must be of the same length")); cheats.prank(confirmer, confirmer); eigenDAServiceManager.confirmBatch( batchHeader, @@ -204,9 +204,9 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { IEigenDAServiceManager.BatchHeader memory batchHeader; batchHeader.blobHeadersRoot = keccak256(abi.encodePacked("blobHeadersRoot", pseudoRandomNumber)); batchHeader.quorumNumbers = quorumNumbers; - batchHeader.confirmationThresholdPercentages = new bytes(quorumNumbers.length); + batchHeader.signedStakeForQuorums = new bytes(quorumNumbers.length); for (uint256 i = 0; i < quorumNumbers.length; i++) { - batchHeader.confirmationThresholdPercentages[i] = bytes1(threshold); + batchHeader.signedStakeForQuorums[i] = bytes1(threshold); } batchHeader.referenceBlockNumber = referenceBlockNumber; return batchHeader; diff --git a/contracts/test/unit/MockRollup.t.sol b/contracts/test/unit/MockRollup.t.sol index 64c38f1eec..cf493df3df 100644 --- a/contracts/test/unit/MockRollup.t.sol +++ b/contracts/test/unit/MockRollup.t.sol @@ -125,7 +125,7 @@ contract MockRollupTest is BLSMockAVSDeployer { // add dummy quorum numbers and quorum threshold percentages making sure confirmationThresholdPercentage = adversaryThresholdPercentage + defaultCodingRatioPercentage for (uint i = 0; i < blobHeader[1].quorumBlobParams.length; i++) { batchHeader.quorumNumbers = abi.encodePacked(batchHeader.quorumNumbers, blobHeader[1].quorumBlobParams[i].quorumNumber); - batchHeader.confirmationThresholdPercentages = abi.encodePacked(batchHeader.confirmationThresholdPercentages, blobHeader[1].quorumBlobParams[i].adversaryThresholdPercentage + defaultCodingRatioPercentage); + batchHeader.signedStakeForQuorums = abi.encodePacked(batchHeader.signedStakeForQuorums, blobHeader[1].quorumBlobParams[i].adversaryThresholdPercentage + defaultCodingRatioPercentage); } batchHeader.referenceBlockNumber = uint32(block.number);