From 7d788fdf7191ddf23ee24bd7b5c3134c73c1b3de Mon Sep 17 00:00:00 2001 From: Ethen Pociask Date: Tue, 2 Jul 2024 22:37:54 -0400 Subject: [PATCH] fix tests, remove debug stmts, unecessary structs --- deploy/DummyRollupManagerCreator.js | 13 ----- src/bridge/RollupManager.sol | 74 +++-------------------------- src/bridge/SequencerInbox.sol | 13 ----- src/osp/OneStepProverHostIo.sol | 2 +- 4 files changed, 7 insertions(+), 95 deletions(-) delete mode 100644 deploy/DummyRollupManagerCreator.js diff --git a/deploy/DummyRollupManagerCreator.js b/deploy/DummyRollupManagerCreator.js deleted file mode 100644 index 264e1403..00000000 --- a/deploy/DummyRollupManagerCreator.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = async hre => { - const { deployments, getNamedAccounts } = hre - const { deploy } = deployments - const { deployer } = await getNamedAccounts() - - await deploy('EigenDADummyManager', { - from: deployer, - args: [], - }) - } - - module.exports.tags = ['EigenDADummyManager'] - module.exports.dependencies = [] \ No newline at end of file diff --git a/src/bridge/RollupManager.sol b/src/bridge/RollupManager.sol index 347014e5..ea1bc7ea 100644 --- a/src/bridge/RollupManager.sol +++ b/src/bridge/RollupManager.sol @@ -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 ""; } @@ -90,11 +64,6 @@ 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 @@ -102,21 +71,10 @@ contract DummyServiceManager is IEigenDAServiceManager { 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; @@ -124,12 +82,6 @@ contract DummyServiceManager is IEigenDAServiceManager { 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; @@ -137,7 +89,6 @@ contract DummyServiceManager is IEigenDAServiceManager { return dummyAddresses; } - /// @notice Returns the EigenLayer AVSDirectory contract. function avsDirectory() external view returns (address) { address x = 0x0000000000000000000000000000000000000001; return x; @@ -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, @@ -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( diff --git a/src/bridge/SequencerInbox.sol b/src/bridge/SequencerInbox.sol index bd3092c0..90014f6a 100644 --- a/src/bridge/SequencerInbox.sol +++ b/src/bridge/SequencerInbox.sol @@ -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, diff --git a/src/osp/OneStepProverHostIo.sol b/src/osp/OneStepProverHostIo.sol index 9e4cf46a..579f9084 100644 --- a/src/osp/OneStepProverHostIo.sol +++ b/src/osp/OneStepProverHostIo.sol @@ -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:];