Skip to content

Commit

Permalink
fix tests, remove debug stmts, unecessary structs
Browse files Browse the repository at this point in the history
  • Loading branch information
EthenNotEthan committed Jul 3, 2024
1 parent 63bdd82 commit 7d788fd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 95 deletions.
13 changes: 0 additions & 13 deletions deploy/DummyRollupManagerCreator.js

This file was deleted.

74 changes: 6 additions & 68 deletions src/bridge/RollupManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,72 +13,46 @@ import {IPaymentCoordinator} from "@eigenda/eigenda-utils/interfaces/IPaymentCoo
import {ISignatureUtils} from "@eigenda/eigenda-utils/interfaces/ISignatureUtils.sol";


// DummyServiceManager is a dummy implementation of IEigenDAServiceManager
// and is used in nitro-testnode to avoid the overhead of deploying core EigenDA contracts
// to simplify the testing process.
contract DummyServiceManager is IEigenDAServiceManager {
// EVENTS

// CONSTRUCTOR
constructor() {
// Constructor code can be added here if needed
}

/// @notice mapping between the batchId to the hash of the metadata of the corresponding Batch
function batchIdToBatchMetadataHash(uint32 batchId) external view override returns (bytes32) {
// Stubbed implementation
return bytes32(0);
}


/**
* @notice This function is used for
* - submitting data availability certificates,
* - check that the aggregate signature is valid,
* - and check whether quorum has been achieved or not.
*/
function confirmBatch(
BatchHeader calldata batchHeader,
IBLSSignatureChecker.NonSignerStakesAndSignature memory nonSignerStakesAndSignature
) external override {
// Stubbed implementation
}

/// @notice This function is used for changing the batch confirmer
function setBatchConfirmer(address _batchConfirmer) external override {
// Stubbed implementation
}

/// @notice Returns the current batchId
function taskNumber() external view override returns (uint32) {
// Stubbed implementation
return 0;
}

/// @notice Given a reference block number, returns the block until which operators must serve.
function latestServeUntilBlock(uint32 referenceBlockNumber) external view override returns (uint32) {
// Stubbed implementation
return 0;
}

/// @notice The maximum amount of blocks in the past that the service will consider stake amounts to still be 'valid'.
function BLOCK_STALE_MEASURE() external view override returns (uint32) {
// Stubbed implementation
return 0;
}

/// @notice Returns the bytes array of quorumAdversaryThresholdPercentages
function quorumAdversaryThresholdPercentages() external view override returns (bytes memory) {
// Stubbed implementation
return "";
}

/// @notice Returns the bytes array of quorumAdversaryThresholdPercentages
function quorumConfirmationThresholdPercentages() external view override returns (bytes memory) {
// Stubbed implementation
return "";
}

/// @notice Returns the bytes array of quorumsNumbersRequired
function quorumNumbersRequired() external view override returns (bytes memory) {
// Stubbed implementation
return "";
}

Expand All @@ -90,54 +64,31 @@ contract DummyServiceManager is IEigenDAServiceManager {
return;
}

/**
* @notice Forwards a call to EigenLayer's DelegationManager contract to confirm operator registration with the AVS
* @param operator The address of the operator to register.
* @param operatorSignature The signature, salt, and expiry of the operator's signature.
*/
function registerOperatorToAVS(
address operator,
ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature
) external override {
return;
}

/**
* @notice Forwards a call to EigenLayer's DelegationManager contract to confirm operator deregistration from the AVS
* @param operator The address of the operator to deregister.
*/
function deregisterOperatorFromAVS(address operator) external override {
return;
}

/**
* @notice Returns the list of strategies that the operator has potentially restaked on the AVS
* @param operator The address of the operator to get restaked strategies for
* @dev This function is intended to be called off-chain
* @dev No guarantee is made on whether the operator has shares for a strategy in a quorum or uniqueness
* of each element in the returned array. The off-chain service should do that validation separately
*/
function getOperatorRestakedStrategies(address operator) external view override returns (address[] memory){
address[] memory dummyAddresses = new address[](2);
dummyAddresses[0] = 0x0000000000000000000000000000000000000001;
dummyAddresses[1] = 0x0000000000000000000000000000000000000002;
return dummyAddresses;
}

/**
* @notice Returns the list of strategies that the AVS supports for restaking
* @dev This function is intended to be called off-chain
* @dev No guarantee is made on uniqueness of each element in the returned array.
* The off-chain service should do that validation separately
*/
function getRestakeableStrategies() external view override returns (address[] memory) {
address[] memory dummyAddresses = new address[](2);
dummyAddresses[0] = 0x0000000000000000000000000000000000000001;
dummyAddresses[1] = 0x0000000000000000000000000000000000000002;
return dummyAddresses;
}

/// @notice Returns the EigenLayer AVSDirectory contract.
function avsDirectory() external view returns (address) {
address x = 0x0000000000000000000000000000000000000001;
return x;
Expand All @@ -147,21 +98,6 @@ contract DummyServiceManager is IEigenDAServiceManager {

interface IRollupManager {

struct ProofMetadata {
uint32 batchID;
uint32 blobIndex;
bytes32 signatoryRecordHash;
uint32 confirmationBlockNumber;
bytes inclusionProof;
bytes quorumIndices;
}

struct SequenceMetadata {
uint256 afterDelayedMessagesRead;
uint256 prevMessageCount;
uint256 newMessageCount;
}

function verifyBlob(
IEigenDAServiceManager.BlobHeader calldata blobHeader,
IEigenDAServiceManager eigenDAServiceManager,
Expand All @@ -178,7 +114,9 @@ interface IRollupManager {

}


// EigenDADummyManager is a dummy implementation of IRollupManager
// and is used in nitro-testnode to avoid the overhead of deploying core EigenDA contracts
// to simplify the testing process.
contract EigenDADummyManager {

function verifyBlob(
Expand Down
13 changes: 0 additions & 13 deletions src/bridge/SequencerInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -497,19 +497,6 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
revert BadSequencerNumber(seqMessageIndex, sequenceNumber_);
}

/*
emit SequencerBatchDelivered(
seqMessageIndex,
beforeAcc,
afterAcc,
delayedAcc,
totalDelayedMessagesRead,
timeBounds,
IBridge.BatchDataLocation.EigenDA
);
*/

emit SequencerBatchDelivered(
seqMessageIndex,
beforeAcc,
Expand Down
2 changes: 1 addition & 1 deletion src/osp/OneStepProverHostIo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ contract OneStepProverHostIo is IOneStepProver {
} else if (inst.argumentData == 3) {
// The machine is asking for a EigenDA versioned hash preimage

require(proofType == 0, "UNKNOWN_PREIMAGE_PROOF");
require(proofType == 1, "UNKNOWN_PREIMAGE_PROOF");

bytes calldata kzgProof = proof[proofOffset:];

Expand Down

0 comments on commit 7d788fd

Please sign in to comment.