Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed Sep 27, 2024
1 parent 9800e40 commit 4416d5f
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 40 deletions.
14 changes: 7 additions & 7 deletions l1-contracts/contracts/bridgehub/Bridgehub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {BridgehubL2TransactionRequest, L2Message, L2Log, TxStatus} from "../comm
import {AddressAliasHelper} from "../vendor/AddressAliasHelper.sol";
import {IMessageRoot} from "./IMessageRoot.sol";
import {ICTMDeploymentTracker} from "./ICTMDeploymentTracker.sol";
import {NotChainStm, NotL1, NotRelayedSender, NotAssetRouter, TokenNotSet, ChainAlreadyPresent, ChainIdAlreadyPresent, ChainNotPresentInSTM, NotCtmDeployer, CtmNotRegistered, ChainIdMustNotMatchCurrentChainId, AssetIdNotRegistered, SecondBridgeAddressTooLow, NotInGatewayMode, SLNotWhitelisted, AssetInfo1, NotCurrentSL, HyperchainNotRegistered, IncorrectSender, AssetInfo2, AlreadyCurrentSL} from "./L1BridgehubErrors.sol";
import {NotChainCTM, NotL1, NotRelayedSender, NotAssetRouter, TokenNotSet, ChainAlreadyPresent, ChainIdAlreadyPresent, ChainNotPresentInCTM, NotCtmDeployer, CTMNotRegistered, ChainIdMustNotMatchCurrentChainId, AssetIdNotRegistered, SecondBridgeAddressTooLow, NotInGatewayMode, SLNotWhitelisted, IncorrectChainAsset, NotCurrentSL, HyperchainNotRegistered, IncorrectSender, AssetInfo2, AlreadyCurrentSL} from "./L1BridgehubErrors.sol";

Check failure on line 26 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name ChainIdMustNotMatchCurrentChainId is not used

Check failure on line 26 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name AssetIdNotRegistered is not used

Check failure on line 26 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name AssetInfo2 is not used

Check failure on line 26 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name ChainIdMustNotMatchCurrentChainId is not used

Check failure on line 26 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name AssetIdNotRegistered is not used

Check failure on line 26 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name AssetInfo2 is not used

Check failure on line 26 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name ChainIdMustNotMatchCurrentChainId is not used

Check failure on line 26 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name AssetIdNotRegistered is not used

Check failure on line 26 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name AssetInfo2 is not used
import {NoCTMForAssetId, MigrationPaused, AssetIdAlreadyRegistered, ChainAlreadyLive, ChainNotLegacy, CTMNotRegistered, ChainIdNotRegistered, AssetHandlerNotRegistered, ZKChainLimitReached, CTMAlreadyRegistered, CTMNotRegistered, ZeroChainId, ChainIdTooBig, BridgeHubAlreadyRegistered, AddressTooLow, MsgValueMismatch, ZeroAddress, Unauthorized, SharedBridgeNotSet, WrongMagicValue, ChainIdAlreadyExists, ChainIdMismatch, ChainIdCantBeCurrentChain, EmptyAssetId, AssetIdNotSupported, IncorrectBridgeHubAddress} from "../common/L1ContractErrors.sol";

Check failure on line 27 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name ChainAlreadyLive is not used

Check failure on line 27 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name ChainNotLegacy is not used

Check failure on line 27 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name AddressTooLow is not used

Check failure on line 27 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name ChainAlreadyLive is not used

Check failure on line 27 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name ChainNotLegacy is not used

Check failure on line 27 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name AddressTooLow is not used

Check failure on line 27 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name ChainAlreadyLive is not used

Check failure on line 27 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name ChainNotLegacy is not used

Check failure on line 27 in l1-contracts/contracts/bridgehub/Bridgehub.sol

View workflow job for this annotation

GitHub Actions / lint

imported name AddressTooLow is not used

/// @author Matter Labs
Expand Down Expand Up @@ -108,9 +108,9 @@ contract Bridgehub is IBridgehub, ReentrancyGuard, Ownable2StepUpgradeable, Paus
_;
}

modifier onlyChainSTM(uint256 _chainId) {
modifier onlyChainCTM(uint256 _chainId) {
if (msg.sender != chainTypeManager[_chainId]) {
revert NotChainStm(msg.sender, chainTypeManager[_chainId]);
revert NotChainCTM(msg.sender, chainTypeManager[_chainId]);
}
_;
}
Expand Down Expand Up @@ -240,7 +240,7 @@ contract Bridgehub is IBridgehub, ReentrancyGuard, Ownable2StepUpgradeable, Paus
/// Note we have to do this before CTM is upgraded.
address chainAddress = IChainTypeManager(ctm).getZKChainLegacy(_chainId);
if (chainAddress == address(0)) {
revert ChainNotPresentInSTM();
revert ChainNotPresentInCTM();
}
_registerNewZKChain(_chainId, chainAddress);
}
Expand Down Expand Up @@ -319,7 +319,7 @@ contract Bridgehub is IBridgehub, ReentrancyGuard, Ownable2StepUpgradeable, Paus
revert NotCtmDeployer(sender, address(l1CtmDeployer));
}
if (!chainTypeManagerIsRegistered[_assetAddress]) {
revert CtmNotRegistered();
revert CTMNotRegistered();
}

bytes32 assetInfo = keccak256(abi.encode(L1_CHAIN_ID, sender, _additionalData));
Expand Down Expand Up @@ -696,7 +696,7 @@ contract Bridgehub is IBridgehub, ReentrancyGuard, Ownable2StepUpgradeable, Paus

BridgehubBurnCTMAssetData memory bridgehubData = abi.decode(_data, (BridgehubBurnCTMAssetData));
if (_assetId != ctmAssetIdFromChainId(bridgehubData.chainId)) {
revert AssetInfo1(_assetId, ctmAssetIdFromChainId(bridgehubData.chainId));
revert IncorrectChainAsset(_assetId, ctmAssetIdFromChainId(bridgehubData.chainId));
}
if (settlementLayer[bridgehubData.chainId] != block.chainid) {
revert NotCurrentSL(settlementLayer[bridgehubData.chainId], block.chainid);
Expand Down Expand Up @@ -732,7 +732,7 @@ contract Bridgehub is IBridgehub, ReentrancyGuard, Ownable2StepUpgradeable, Paus
}

/// @dev IL1AssetHandler interface, used to receive a chain on the settlement layer.
/// @param _assetId the assetId of the chain's STM
/// @param _assetId the assetId of the chain's CTM
/// @param _bridgehubMintData the data for the mint
function bridgeMint(
uint256, // originChainId
Expand Down
4 changes: 2 additions & 2 deletions l1-contracts/contracts/bridgehub/CTMDeploymentTracker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {IAssetRouterBase} from "../bridge/asset-router/IAssetRouterBase.sol";
import {ReentrancyGuard} from "../common/ReentrancyGuard.sol";
import {TWO_BRIDGES_MAGIC_VALUE} from "../common/Config.sol";
import {L2_BRIDGEHUB_ADDR} from "../common/L2ContractAddresses.sol";
import {OnlyBridgehub, CtmNotRegistered, NotOwnerViaRouter, NoEthAllowed, NotOwner, WrongCounterPart} from "./L1BridgehubErrors.sol";
import {OnlyBridgehub, CTMNotRegistered, NotOwnerViaRouter, NoEthAllowed, NotOwner, WrongCounterPart} from "./L1BridgehubErrors.sol";

/// @dev The encoding version of the data.
bytes1 constant CTM_DEPLOYMENT_TRACKER_ENCODING_VERSION = 0x01;
Expand Down Expand Up @@ -67,7 +67,7 @@ contract CTMDeploymentTracker is ICTMDeploymentTracker, ReentrancyGuard, Ownable
// solhint-disable-next-line gas-custom-errors

if (!BRIDGE_HUB.chainTypeManagerIsRegistered(_ctmAddress)) {
revert CtmNotRegistered();
revert CTMNotRegistered();
}
L1_ASSET_ROUTER.setAssetHandlerAddressThisChain(bytes32(uint256(uint160(_ctmAddress))), address(BRIDGE_HUB));
BRIDGE_HUB.setAssetHandlerAddress(bytes32(uint256(uint160(_ctmAddress))), _ctmAddress);
Expand Down
8 changes: 4 additions & 4 deletions l1-contracts/contracts/bridgehub/L1BridgehubErrors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.21;

error NotChainStm(address msgSender, address chainTypeManager);
error NotChainCTM(address msgSender, address chainTypeManager);

error NotRelayedSender(address msgSender, address settlementLayerRelaySender);

Expand All @@ -14,13 +14,13 @@ error ChainAlreadyPresent();

error ChainIdAlreadyPresent();

error ChainNotPresentInSTM();
error ChainNotPresentInCTM();

error AssetIdAlreadyRegistered();

error NotCtmDeployer(address sender, address l1CtmDeployer);

error CtmNotRegistered();
error CTMNotRegistered();

error ChainIdMustNotMatchCurrentChainId(uint256 chainId, uint256 blockChainId);

Expand All @@ -34,7 +34,7 @@ error NotInGatewayMode();

error SLNotWhitelisted();

error AssetInfo1(bytes32 assetId, bytes32 assetIdFromChainId);
error IncorrectChainAsset(bytes32 assetId, bytes32 assetIdFromChainId);

error NotCurrentSL(uint256 settlementLayerChainId, uint256 blockChainId);

Expand Down
14 changes: 7 additions & 7 deletions l1-contracts/contracts/state-transition/ChainTypeManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable-v4/ac
import {ReentrancyGuard} from "../common/ReentrancyGuard.sol";
import {L2_TO_L1_LOG_SERIALIZE_SIZE, DEFAULT_L2_LOGS_TREE_ROOT_HASH, EMPTY_STRING_KECCAK} from "../common/Config.sol";
import {Unauthorized, ZeroAddress, HashMismatch, GenesisUpgradeZero, GenesisBatchHashZero, GenesisIndexStorageZero, GenesisBatchCommitmentZero} from "../common/L1ContractErrors.sol";
import {InitialForceDeploymentMismatch, ZeroChainId, SyncLayerNotRegistered, AdminZero, OutdatedProtocolVersion} from "./L1StateTransitionErrors.sol";
import {InitialForceDeploymentMismatch, ZeroChainId, SettlementLayerNotRegisteredsteredstered, AdminZero, OutdatedProtocolVersion} from "./L1StateTransitionErrors.sol";
import {SemVer} from "../common/libraries/SemVer.sol";
import {IBridgehub} from "../bridgehub/IBridgehub.sol";

Expand Down Expand Up @@ -447,9 +447,9 @@ contract ChainTypeManager is IChainTypeManager, ReentrancyGuard, Ownable2StepUpg
revert ZeroChainId();
}

// Currently, we require that the sync layer is deployed by the same STM.
// Currently, we require that the sync layer is deployed by the same CTM.
if (getZKChain(_newSettlementLayerChainId) == address(0)) {
revert SyncLayerNotRegistered();
revert SettlementLayerNotRegisteredsteredstered();
}

IBridgehub(BRIDGE_HUB).registerSettlementLayer(_newSettlementLayerChainId, _isWhitelisted);
Expand All @@ -463,17 +463,17 @@ contract ChainTypeManager is IChainTypeManager, ReentrancyGuard, Ownable2StepUpg
bytes calldata _data
) external view override onlyBridgehub returns (bytes memory ctmForwardedBridgeMintData) {
// Note that the `_diamondCut` here is not for the current chain, for the chain where the migration
// happens. The correctness of it will be checked on the STM on the new settlement layer.
// happens. The correctness of it will be checked on the CTM on the new settlement layer.
(address _newSettlementLayerAdmin, bytes memory _diamondCut) = abi.decode(_data, (address, bytes));
if (_newSettlementLayerAdmin == address(0)) {
revert AdminZero();
}

// We ensure that the chain has the latest protocol version to avoid edge cases
// related to different protocol version support.
address zkChain = getZKChain(_chainId);
if (IZKChain(zkChain).getProtocolVersion() != protocolVersion) {
revert OutdatedProtocolVersion(IZKChain(zkChain).getProtocolVersion(), protocolVersion);
address chainProtocolVersion = IZKChain(getZKChain(_chainId)).getProtocolVersion();
if (chainProtocolVersion != protocolVersion) {
revert OutdatedProtocolVersion(chainProtocolVersion, protocolVersion);
}

return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ error InvalidNumberOfBatchHashes(uint256 batchHashesLength, uint256 expected);

error PriorityQueueNotReady();

error VerifiedIsNotConsistentWithExecuted(uint256 totalBatchesExecuted, uint256 totalBatchesVerified);

error UnsupportedProofMetadataVersion(uint256 metadataVersion);

error LocalRootIsZero();

error LocalRootMustBeZero();

error MailboxWrongStateTransitionManager();

error NotSettlementLayers();
error NotSettlementLayer

error NotHyperchain();

Expand Down Expand Up @@ -74,7 +70,7 @@ error InitialForceDeploymentMismatch(bytes32 forceDeploymentHash, bytes32 initia

error ZeroChainId();

error SyncLayerNotRegistered();
error SettlementLayerNotRegistered();

error AdminZero();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {ZKChainBase} from "./ZKChainBase.sol";
import {IChainTypeManager} from "../../IChainTypeManager.sol";
import {IL1GenesisUpgrade} from "../../../upgrades/IL1GenesisUpgrade.sol";
import {Unauthorized, TooMuchGas, PriorityTxPubdataExceedsMaxPubDataPerBatch, InvalidPubdataPricingMode, ProtocolIdMismatch, ChainAlreadyLive, HashMismatch, ProtocolIdNotGreater, DenominatorIsZero, DiamondAlreadyFrozen, DiamondNotFrozen} from "../../../common/L1ContractErrors.sol";
import {NotL1, L1DAValidatorAddressIsZero, L2DAValidatorAddressIsZero, AlreadyMigrated, NotChainAdmin, ProtocolVersionNotUpToDate, ExecutedIsNotConsistentWithVerified, VerifiedIsNotConsistentWithCommitted, InvalidNumberOfBatchHashes, PriorityQueueNotReady, VerifiedIsNotConsistentWithExecuted, VerifiedIsNotConsistentWithCommitted} from "../../L1StateTransitionErrors.sol";
import {NotL1, L1DAValidatorAddressIsZero, L2DAValidatorAddressIsZero, AlreadyMigrated, NotChainAdmin, ProtocolVersionNotUpToDate, ExecutedIsNotConsistentWithVerified, VerifiedIsNotConsistentWithCommitted, InvalidNumberOfBatchHashes, PriorityQueueNotReady, VerifiedIsNotConsistentWithCommitted} from "../../L1StateTransitionErrors.sol";

// While formally the following import is not used, it is needed to inherit documentation from it
import {IZKChainBase} from "../../chain-interfaces/IZKChainBase.sol";
Expand Down Expand Up @@ -268,7 +268,6 @@ contract AdminFacet is ZKChainBase, IAdmin {
uint256 protocolVersion = abi.decode(_data, (uint256));

uint256 currentProtocolVersion = s.protocolVersion;
// uint256 protocolVersion = stm.protocolVersion();

if (currentProtocolVersion != protocolVersion) {
revert ProtocolVersionNotUpToDate(currentProtocolVersion, protocolVersion);
Expand Down Expand Up @@ -396,7 +395,7 @@ contract AdminFacet is ZKChainBase, IAdmin {

// just in case
if (commitment.totalBatchesExecuted > commitment.totalBatchesVerified) {
revert VerifiedIsNotConsistentWithExecuted(
revert ExecutedIsNotConsistentWithVerified(
commitment.totalBatchesExecuted,
commitment.totalBatchesVerified
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {IBridgehub} from "../../../bridgehub/IBridgehub.sol";

import {IChainTypeManager} from "../../IChainTypeManager.sol";
import {MerklePathEmpty, OnlyEraSupported, BatchNotExecuted, HashedLogIsDefault, BaseTokenGasPriceDenominatorNotSet, TransactionNotAllowed, GasPerPubdataMismatch, TooManyFactoryDeps, MsgValueTooLow} from "../../../common/L1ContractErrors.sol";
import {NotL1, UnsupportedProofMetadataVersion, LocalRootIsZero, LocalRootMustBeZero, MailboxWrongStateTransitionManager, NotSettlementLayers, NotHyperchain} from "../../L1StateTransitionErrors.sol";
import {NotL1, UnsupportedProofMetadataVersion, LocalRootIsZero, LocalRootMustBeZero, NotSettlementLayer, NotHyperchain} from "../../L1StateTransitionErrors.sol";

// While formally the following import is not used, it is needed to inherit documentation from it
import {IZKChainBase} from "../../chain-interfaces/IZKChainBase.sol";
Expand Down Expand Up @@ -280,7 +280,7 @@ contract MailboxFacet is ZKChainBase, IMailbox {
//
// We trust all chains whitelisted by the Bridgehub governance.
if (!IBridgehub(s.bridgehub).whitelistedSettlementLayers(settlementLayerChainId)) {
revert MailboxWrongStateTransitionManager();
revert NotSettlementLayer();
}

settlementLayerAddress = IBridgehub(s.bridgehub).getZKChain(settlementLayerChainId);
Expand Down Expand Up @@ -380,7 +380,7 @@ contract MailboxFacet is ZKChainBase, IMailbox {
uint64 _expirationTimestamp
) external override onlyL1 returns (bytes32 canonicalTxHash) {
if (!IBridgehub(s.bridgehub).whitelistedSettlementLayers(s.chainId)) {
revert NotSettlementLayers();
revert NotSettlementLayer();
}
if (IChainTypeManager(s.chainTypeManager).getZKChain(_chainId) != msg.sender) {
revert NotHyperchain();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ contract GatewayTransactionFilterer is ITransactionFilterer, ReentrancyGuard, Ow

if (IL2AssetRouter.setAssetHandlerAddress.selector == l2TxSelector) {
(, bytes32 decodedAssetId, ) = abi.decode(l2Calldata[4:], (uint256, bytes32, address));
return _checkSTMAssetId(decodedAssetId);
return _checkCTMAssetId(decodedAssetId);
}

if (
Expand All @@ -97,13 +97,13 @@ contract GatewayTransactionFilterer is ITransactionFilterer, ReentrancyGuard, Ow
}

(, bytes32 decodedAssetId, ) = abi.decode(l2Calldata[4:], (uint256, bytes32, bytes));
return _checkSTMAssetId(decodedAssetId);
return _checkCTMAssetId(decodedAssetId);
}

return whitelistedSenders[sender];
}

function _checkSTMAssetId(bytes32 assetId) internal view returns (bool) {
function _checkCTMAssetId(bytes32 assetId) internal view returns (bool) {
address stmAddress = BRIDGE_HUB.ctmAssetIdToAddress(assetId);
return stmAddress != address(0);
}
Expand Down
6 changes: 3 additions & 3 deletions system-contracts/contracts/SystemContext.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {SystemContractBase} from "./abstract/SystemContractBase.sol";
import {ISystemContextDeprecated} from "./interfaces/ISystemContextDeprecated.sol";
import {SystemContractHelper} from "./libraries/SystemContractHelper.sol";
import {BOOTLOADER_FORMAL_ADDRESS, SystemLogKey, COMPLEX_UPGRADER_CONTRACT} from "./Constants.sol";
import {UpgradeTransactionMustBeFirst, L2BlockNumberIsNeverExpectedToBeZero, PreviousL2BlockHashIsIncorrect, CannotInitializeFirstVirtualBlock, TimestampOfL2BlockMustBeGreaterThanOrEqualToTimestampOfCurrentBatch, ThereMustBeVirtualBlockCreatedAtStartOfBatch, CannotReuseL2BlockNumberFromPreviousBatch, TimestampOfSameL2BlockMustBeSame, PreviousHashOfSameL2BlockMustBeSame, CannotCreateVirtualBlocksInMiddleOfMiniblock, CurrentL2BlockHashIsIncorrect, TimestampOfNewL2BlockMustBeGreaterThanTimestampOfPreviousL2Block, CurrentBatchNumberMustBeGreaterThanZero, TimestampOfBatchMustBeGreaterThanTimestampOfPreviousBlock, TimestampsShouldBeIncremental, ProvidedBatchNumberIsNotCorrect} from "contracts/SystemContractErrors.sol";
import {CannotCreateVirtualBlocksInMiddleOfMiniblock, PreviousHashOfSameL2BlockMustBeSame, TimestampOfSameL2BlockMustBeSame, CannotReuseL2BlockNumberFromPreviousBatch, ThereMustBeVirtualBlockCreatedAtStartOfBatch, L2BlockAndBatchTimestampMismatch, UpgradeTransactionMustBeFirst, L2BlockNumberIsNeverExpectedToBeZero, PreviousL2BlockHashIsIncorrect, CannotInitializeFirstVirtualBlock, CurrentL2BlockHashIsIncorrect, NonMonotonicL2BlockTimestamp, CurrentBatchNumberMustBeGreaterThanZero, TimestampOfBatchMustBeGreaterThanTimestampOfPreviousBlock, TimestampsShouldBeIncremental, ProvidedBatchNumberIsNotCorrect} from "contracts/SystemContractErrors.sol";

/**
* @author Matter Labs
Expand Down Expand Up @@ -365,7 +365,7 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, SystemContra
if (_isFirstInBatch) {
uint128 currentBatchTimestamp = currentBatchInfo.timestamp;
if (_l2BlockTimestamp < currentBatchTimestamp) {
revert TimestampOfL2BlockMustBeGreaterThanOrEqualToTimestampOfCurrentBatch(
revert L2BlockAndBatchTimestampMismatch(
_l2BlockTimestamp,
currentBatchTimestamp
);
Expand Down Expand Up @@ -414,7 +414,7 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, SystemContra
revert CurrentL2BlockHashIsIncorrect(_expectedPrevL2BlockHash, pendingL2BlockHash);
}
if (_l2BlockTimestamp <= currentL2BlockTimestamp) {
revert TimestampOfNewL2BlockMustBeGreaterThanTimestampOfPreviousL2Block(
revert NonMonotonicL2BlockTimestamp(
_l2BlockTimestamp,
currentL2BlockTimestamp
);
Expand Down
4 changes: 2 additions & 2 deletions system-contracts/contracts/SystemContractErrors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ error PreviousL2BlockHashIsIncorrect(bytes32 correctPrevBlockHash, bytes32 expec

error CannotInitializeFirstVirtualBlock();

error TimestampOfL2BlockMustBeGreaterThanOrEqualToTimestampOfCurrentBatch(
error L2BlockAndBatchTimestampMismatch(
uint128 l2BlockTimestamp,
uint128 currentBatchTimestamp
);
Expand All @@ -140,7 +140,7 @@ error CannotCreateVirtualBlocksInMiddleOfMiniblock();

error CurrentL2BlockHashIsIncorrect(bytes32 expectedPrevL2BlockHash, bytes32 pendingL2BlockHash);

error TimestampOfNewL2BlockMustBeGreaterThanTimestampOfPreviousL2Block(
error NonMonotonicL2BlockTimestamp(
uint128 l2BlockTimestamp,
uint128 currentL2BlockTimestamp
);
Expand Down

0 comments on commit 4416d5f

Please sign in to comment.