Skip to content

Commit

Permalink
Add blobVerificationProof
Browse files Browse the repository at this point in the history
  • Loading branch information
gianbelinche committed Jan 7, 2025
1 parent 9cc2eb1 commit da387dd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ contract DummyEigenDABridge is IEigenDABridge {
function verifyBlobLeaf(MerkleProofInput calldata merkleProof) external view returns (bool) {
// Inspired by eigenlayer contracts Merkle.verifyInclusionKeccak
// https://github.com/Layr-Labs/eigenlayer-contracts/blob/3f3f83bd194b3bdc77d06d8fe6b101fafc3bcfd5/src/contracts/libraries/Merkle.sol
uint256 index = merkleProof.index;
bytes memory inclusionProof = merkleProof.inclusionProof;
uint256 index = merkleProof.blobVerificationProof.blobIndex;
bytes memory inclusionProof = merkleProof.blobVerificationProof.inclusionProof;
require(inclusionProof.length % 32 == 0, "proof length not multiple of 32");

Check failure on line 25 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements

Check failure on line 25 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements

Check failure on line 25 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements
bytes32 computedHash = merkleProof.leaf;
uint256 length = inclusionProof.length;
Expand All @@ -44,7 +44,7 @@ contract DummyEigenDABridge is IEigenDABridge {
}
}
}
require(computedHash == merkleProof.batchRoot, "invalid proof");
require(computedHash == merkleProof.blobVerificationProof.batchMetadata.batchHeader.blobHeadersRoot, "invalid proof");

Check failure on line 47 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements

Check failure on line 47 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements

Check failure on line 47 in da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol

View workflow job for this annotation

GitHub Actions / lint

GC: Use Custom Errors instead of require statements
return true;
}
}
25 changes: 22 additions & 3 deletions da-contracts/contracts/da-layers/eigenda/IEigenDABridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,30 @@ import {IImplementation} from "./IImplementation.sol";
interface IEigenDABridge {
// solhint-disable-next-line gas-struct-packing

struct BatchHeader {
bytes32 blobHeadersRoot;
bytes quorumNumbers;
bytes signedStakeForQuorums;
uint32 referenceBlockNumber;
}

struct BatchMetadata {
BatchHeader batchHeader;
bytes32 signatoryRecordHash;
uint32 confirmationBlockNumber;
}

struct BlobVerificationProof {
uint32 batchId;
uint32 blobIndex;
BatchMetadata batchMetadata;
bytes inclusionProof;
bytes quorumIndices;
}

struct MerkleProofInput {
bytes32 batchRoot;
bytes32 leaf;
uint256 index;
bytes inclusionProof;
BlobVerificationProof blobVerificationProof;
}

function implementation() external view returns (IImplementation implementation);
Expand Down

0 comments on commit da387dd

Please sign in to comment.