Skip to content

Commit

Permalink
Change vectorx for implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
gianbelinche committed Jan 6, 2025
1 parent 76d8d3b commit 72eaa62
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions da-contracts/contracts/da-layers/eigenda/DummyEigenDABridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
pragma solidity 0.8.24;

import {IEigenDABridge} from "./IEigenDABridge.sol";
import {IVectorx} from "./IVectorx.sol";
import {DummyVectorX} from "./DummyVectorX.sol";
import {IImplementation} from "./IImplementation.sol";
import {DummyImplementation} from "./DummyImplementation.sol";

contract DummyEigenDABridge is IEigenDABridge {
IVectorx public vectorxContract;
IImplementation public implementationContract;

constructor() {
vectorxContract = new DummyVectorX();
implementationContract = new DummyImplementation();
}

function vectorx() external view returns (IVectorx) {
return vectorxContract;
function implementation() external view returns (IImplementation) {
return implementationContract;
}

function verifyBlobLeaf(bytes calldata) external view returns (bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

pragma solidity 0.8.24;

import {IVectorx} from "./IVectorx.sol";
import {IImplementation} from "./IImplementation.sol";

contract DummyVectorX is IVectorx {
contract DummyImplementation is IImplementation {
function rangeStartBlocks(bytes32) external view returns (uint32 startBlock) {
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.24;

import {IEigenDABridge} from "./IEigenDABridge.sol";
import {IVectorx} from "./IVectorx.sol";
import {IImplementation} from "./IImplementation.sol";

abstract contract EigenDAAttestationLib {
struct AttestationData {
Expand All @@ -11,7 +11,7 @@ abstract contract EigenDAAttestationLib {
}

IEigenDABridge public bridge;
IVectorx public vectorx;
IImplementation public implementation;

/// @dev Mapping from attestation leaf to attestation data.
/// It is necessary for recovery of the state from the onchain data.
Expand All @@ -21,13 +21,13 @@ abstract contract EigenDAAttestationLib {

constructor(IEigenDABridge _bridge) {
bridge = _bridge;
vectorx = bridge.vectorx();
implementation = bridge.implementation();
}

function _attest(bytes memory input) internal virtual {
if (!bridge.verifyBlobLeaf(input)) revert InvalidAttestationProof();
/*attestations[input.leaf] = AttestationData(
vectorx.rangeStartBlocks(input.rangeHash) + uint32(input.dataRootIndex) + 1,
implementation.rangeStartBlocks(input.rangeHash) + uint32(input.dataRootIndex) + 1,
uint128(input.leafIndex)
);*/
}
Expand Down
6 changes: 3 additions & 3 deletions da-contracts/contracts/da-layers/eigenda/IEigenDABridge.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.24;

import {IVectorx} from "./IVectorx.sol";
import {IImplementation} from "./IImplementation.sol";

interface IEigenDABridge {
// solhint-disable-next-line gas-struct-packing
Expand All @@ -27,7 +27,7 @@ interface IEigenDABridge {
bytes32[] dataRootProof;
// proof of inclusion of leaf within blob/bridge root
bytes32[] leafProof;
// abi.encodePacked(startBlock, endBlock) of header range commitment on vectorx
// abi.encodePacked(startBlock, endBlock) of header range commitment on implementation
bytes32 rangeHash;
// index of the data root in the commitment tree
uint256 dataRootIndex;
Expand All @@ -41,6 +41,6 @@ interface IEigenDABridge {
uint256 leafIndex;
}

function vectorx() external view returns (IVectorx vectorx);
function implementation() external view returns (IImplementation implementation);
function verifyBlobLeaf(bytes calldata input) external view returns (bool);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.24;

interface IVectorx {
interface IImplementation {
function rangeStartBlocks(bytes32 rangeHash) external view returns (uint32 startBlock);
}

0 comments on commit 72eaa62

Please sign in to comment.