diff --git a/contracts/lib/eigenlayer-middleware b/contracts/lib/eigenlayer-middleware index b42aa0b7ae..91400d9776 160000 --- a/contracts/lib/eigenlayer-middleware +++ b/contracts/lib/eigenlayer-middleware @@ -1 +1 @@ -Subproject commit b42aa0b7aefb5b30721c3f4b9ad7ab02e8215648 +Subproject commit 91400d9776d4f7276a2807a53559f49f7edf5378 diff --git a/contracts/src/core/EigenDAServiceManager.sol b/contracts/src/core/EigenDAServiceManager.sol index d0de396fd0..1d76358bf1 100644 --- a/contracts/src/core/EigenDAServiceManager.sol +++ b/contracts/src/core/EigenDAServiceManager.sol @@ -32,7 +32,7 @@ contract EigenDAServiceManager is EigenDAServiceManagerStorage, ServiceManagerBa /// @notice when applied to a function, ensures that the function is only callable by the `batchConfirmer`. modifier onlyBatchConfirmer() { - require(isBatchConfirmer[msg.sender], "onlyBatchConfirmer: not from batch confirmer"); + require(isBatchConfirmer[msg.sender]); _; } @@ -82,21 +82,21 @@ contract EigenDAServiceManager is EigenDAServiceManagerStorage, ServiceManagerBa NonSignerStakesAndSignature memory nonSignerStakesAndSignature ) external onlyWhenNotPaused(PAUSED_CONFIRM_BATCH) onlyBatchConfirmer() { // make sure the information needed to derive the non-signers and batch is in calldata to avoid emitting events - require(tx.origin == msg.sender, "EigenDAServiceManager.confirmBatch: header and nonsigner data must be in calldata"); + require(tx.origin == msg.sender, "header and nonsigner data must be in calldata"); // make sure the stakes against which the Batch is being confirmed are not stale require( - batchHeader.referenceBlockNumber < block.number, "EigenDAServiceManager.confirmBatch: specified referenceBlockNumber is in future" + batchHeader.referenceBlockNumber < block.number, "specified referenceBlockNumber is in future" ); require( (batchHeader.referenceBlockNumber + BLOCK_STALE_MEASURE) >= uint32(block.number), - "EigenDAServiceManager.confirmBatch: specified referenceBlockNumber is too far in past" + "specified referenceBlockNumber is too far in past" ); //make sure that the quorumNumbers and signedStakeForQuorums are of the same length require( batchHeader.quorumNumbers.length == batchHeader.signedStakeForQuorums.length, - "EigenDAServiceManager.confirmBatch: quorumNumbers and signedStakeForQuorums must be of the same length" + "quorumNumbers and signedStakeForQuorums must be same length" ); // calculate reducedBatchHeaderHash which nodes signed @@ -120,7 +120,7 @@ contract EigenDAServiceManager is EigenDAServiceManagerStorage, ServiceManagerBa require( quorumStakeTotals.signedStakeForQuorum[i] * THRESHOLD_DENOMINATOR >= quorumStakeTotals.totalStakeForQuorum[i] * uint8(batchHeader.signedStakeForQuorums[i]), - "EigenDAServiceManager.confirmBatch: signatories do not own at least threshold percentage of a quorum" + "signatories do not own threshold percentage of a quorum" ); } diff --git a/contracts/test/unit/EigenDAServiceManagerUnit.t.sol b/contracts/test/unit/EigenDAServiceManagerUnit.t.sol index dbc1740da8..8c14a98c0c 100644 --- a/contracts/test/unit/EigenDAServiceManagerUnit.t.sol +++ b/contracts/test/unit/EigenDAServiceManagerUnit.t.sol @@ -160,7 +160,7 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { (BatchHeader memory batchHeader, BLSSignatureChecker.NonSignerStakesAndSignature memory nonSignerStakesAndSignature) = _getHeaderandNonSigners(0, pseudoRandomNumber, 100); - cheats.expectRevert(bytes("EigenDAServiceManager.confirmBatch: header and nonsigner data must be in calldata")); + cheats.expectRevert(bytes("header and nonsigner data must be in calldata")); cheats.prank(confirmer, notConfirmer); eigenDAServiceManager.confirmBatch( batchHeader, @@ -172,7 +172,7 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { (BatchHeader memory batchHeader, BLSSignatureChecker.NonSignerStakesAndSignature memory nonSignerStakesAndSignature) = _getHeaderandNonSigners(0, pseudoRandomNumber, 100); - cheats.expectRevert(bytes("onlyBatchConfirmer: not from batch confirmer")); + cheats.expectRevert(); cheats.prank(notConfirmer, notConfirmer); eigenDAServiceManager.confirmBatch( batchHeader, @@ -194,7 +194,7 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { bytes32 batchHeaderHash = batchHeader.hashBatchHeaderMemory(); nonSignerStakesAndSignature.sigma = BN254.hashToG1(batchHeaderHash).scalar_mul(aggSignerPrivKey); - cheats.expectRevert(bytes("EigenDAServiceManager.confirmBatch: specified referenceBlockNumber is in future")); + cheats.expectRevert(bytes("specified referenceBlockNumber is in future")); cheats.prank(confirmer, confirmer); eigenDAServiceManager.confirmBatch( batchHeader, @@ -207,7 +207,7 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { = _getHeaderandNonSigners(0, pseudoRandomNumber, 100); cheats.roll(block.number + eigenDAServiceManager.BLOCK_STALE_MEASURE()); - cheats.expectRevert(bytes("EigenDAServiceManager.confirmBatch: specified referenceBlockNumber is too far in past")); + cheats.expectRevert(bytes("specified referenceBlockNumber is too far in past")); cheats.prank(confirmer, confirmer); eigenDAServiceManager.confirmBatch( batchHeader, @@ -219,7 +219,7 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { (BatchHeader memory batchHeader, BLSSignatureChecker.NonSignerStakesAndSignature memory nonSignerStakesAndSignature) = _getHeaderandNonSigners(1, pseudoRandomNumber, 100); - cheats.expectRevert(bytes("EigenDAServiceManager.confirmBatch: signatories do not own at least threshold percentage of a quorum")); + cheats.expectRevert(bytes("signatories do not own threshold percentage of a quorum")); cheats.prank(confirmer, confirmer); eigenDAServiceManager.confirmBatch( batchHeader, @@ -253,7 +253,7 @@ contract EigenDAServiceManagerUnit is BLSMockAVSDeployer { = _getHeaderandNonSigners(0, pseudoRandomNumber, 100); batchHeader.signedStakeForQuorums = new bytes(0); - cheats.expectRevert(bytes("EigenDAServiceManager.confirmBatch: quorumNumbers and signedStakeForQuorums must be of the same length")); + cheats.expectRevert(bytes("quorumNumbers and signedStakeForQuorums must be same length")); cheats.prank(confirmer, confirmer); eigenDAServiceManager.confirmBatch( batchHeader, diff --git a/disperser/controller/dispatcher.go b/disperser/controller/dispatcher.go index 231213fe48..f48a9783ff 100644 --- a/disperser/controller/dispatcher.go +++ b/disperser/controller/dispatcher.go @@ -7,8 +7,6 @@ import ( "math" "time" - "github.com/prometheus/client_golang/prometheus" - "github.com/Layr-Labs/eigenda/api/clients/v2" "github.com/Layr-Labs/eigenda/common" "github.com/Layr-Labs/eigenda/core" diff --git a/disperser/dataapi/docs/docs.go b/disperser/dataapi/docs/docs.go index 550f7938ed..79e490408e 100644 --- a/disperser/dataapi/docs/docs.go +++ b/disperser/dataapi/docs/docs.go @@ -15,7 +15,7 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { - "/batch/{batch_header_hash}": { + "/batches/{batch_header_hash}": { "get": { "produces": [ "application/json" @@ -61,7 +61,7 @@ const docTemplate = `{ } } }, - "/blob/{blob_key}": { + "/blobs/{blob_key}": { "get": { "produces": [ "application/json" diff --git a/disperser/dataapi/docs/swagger.json b/disperser/dataapi/docs/swagger.json index 1fc232d13d..82011b9bbb 100644 --- a/disperser/dataapi/docs/swagger.json +++ b/disperser/dataapi/docs/swagger.json @@ -11,7 +11,7 @@ "version": "1" }, "paths": { - "/batch/{batch_header_hash}": { + "/batches/{batch_header_hash}": { "get": { "produces": [ "application/json" @@ -57,7 +57,7 @@ } } }, - "/blob/{blob_key}": { + "/blobs/{blob_key}": { "get": { "produces": [ "application/json" diff --git a/disperser/dataapi/docs/swagger.yaml b/disperser/dataapi/docs/swagger.yaml index 53f58bf5c0..84b9f71826 100644 --- a/disperser/dataapi/docs/swagger.yaml +++ b/disperser/dataapi/docs/swagger.yaml @@ -361,7 +361,7 @@ info: title: EigenDA Data Access API version: "1" paths: - /batch/{batch_header_hash}: + /batches/{batch_header_hash}: get: parameters: - description: Batch header hash in hex string @@ -391,7 +391,7 @@ paths: summary: Fetch batch by the batch header hash tags: - Feed - /blob/{blob_key}: + /blobs/{blob_key}: get: parameters: - description: Blob key in hex string diff --git a/disperser/dataapi/server_v2.go b/disperser/dataapi/server_v2.go index f8bc44dd5c..74d12e4a80 100644 --- a/disperser/dataapi/server_v2.go +++ b/disperser/dataapi/server_v2.go @@ -105,13 +105,13 @@ func (s *ServerV2) Start() error { { blob := v2.Group("/blob") { - blob.GET("/blob/feed", s.FetchBlobFeedHandler) - blob.GET("/blob/:blob_key", s.FetchBlobHandler) + blob.GET("/blobs/feed", s.FetchBlobFeedHandler) + blob.GET("/blobs/:blob_key", s.FetchBlobHandler) } batch := v2.Group("/batch") { - batch.GET("/batch/feed", s.FetchBatchFeedHandler) - batch.GET("/batch/:batch_header_hash", s.FetchBatchHandler) + batch.GET("/batches/feed", s.FetchBatchFeedHandler) + batch.GET("/batches/:batch_header_hash", s.FetchBatchHandler) } operators := v2.Group("/operators") { @@ -180,7 +180,7 @@ func (s *ServerV2) FetchBlobFeedHandler(c *gin.Context) { // @Failure 400 {object} ErrorResponse "error: Bad request" // @Failure 404 {object} ErrorResponse "error: Not found" // @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /blob/{blob_key} [get] +// @Router /blobs/{blob_key} [get] func (s *ServerV2) FetchBlobHandler(c *gin.Context) { start := time.Now() blobKey, err := corev2.HexToBlobKey(c.Param("blob_key")) @@ -221,7 +221,7 @@ func (s *ServerV2) FetchBatchFeedHandler(c *gin.Context) { // @Failure 400 {object} ErrorResponse "error: Bad request" // @Failure 404 {object} ErrorResponse "error: Not found" // @Failure 500 {object} ErrorResponse "error: Server error" -// @Router /batch/{batch_header_hash} [get] +// @Router /batches/{batch_header_hash} [get] func (s *ServerV2) FetchBatchHandler(c *gin.Context) { start := time.Now() batchHeaderHashHex := c.Param("batch_header_hash") diff --git a/disperser/dataapi/server_v2_test.go b/disperser/dataapi/server_v2_test.go index e8cecdfdb8..17458e5718 100644 --- a/disperser/dataapi/server_v2_test.go +++ b/disperser/dataapi/server_v2_test.go @@ -174,9 +174,9 @@ func TestFetchBlobHandlerV2(t *testing.T) { require.NoError(t, err) require.NoError(t, err) - r.GET("/v2/blob/:blob_key", testDataApiServerV2.FetchBlobHandler) + r.GET("/v2/blobs/:blob_key", testDataApiServerV2.FetchBlobHandler) w := httptest.NewRecorder() - req := httptest.NewRequest(http.MethodGet, "/v2/blob/"+blobKey.Hex(), nil) + req := httptest.NewRequest(http.MethodGet, "/v2/blobs/"+blobKey.Hex(), nil) r.ServeHTTP(w, req) res := w.Result() defer res.Body.Close() @@ -232,9 +232,9 @@ func TestFetchBatchHandlerV2(t *testing.T) { err = blobMetadataStore.PutAttestation(context.Background(), attestation) require.NoError(t, err) - r.GET("/v2/batch/:batch_header_hash", testDataApiServerV2.FetchBatchHandler) + r.GET("/v2/batches/:batch_header_hash", testDataApiServerV2.FetchBatchHandler) w := httptest.NewRecorder() - req := httptest.NewRequest(http.MethodGet, "/v2/batch/"+batchHeaderHash, nil) + req := httptest.NewRequest(http.MethodGet, "/v2/batches/"+batchHeaderHash, nil) r.ServeHTTP(w, req) res := w.Result() defer res.Body.Close() diff --git a/tools/kzgpad/Makefile b/tools/kzgpad/Makefile index 58fd90e94f..c97d859e88 100644 --- a/tools/kzgpad/Makefile +++ b/tools/kzgpad/Makefile @@ -3,4 +3,4 @@ clean: build: clean go mod tidy - go build -o ./bin/kzgpad ./cmd \ No newline at end of file + go build -o ./bin/kzgpad . \ No newline at end of file diff --git a/tools/kzgpad/cmd/main.go b/tools/kzgpad/main.go similarity index 100% rename from tools/kzgpad/cmd/main.go rename to tools/kzgpad/main.go