Skip to content

Commit

Permalink
Merge branch 'test_failure' of github.com:taikochain/taiko-mono into …
Browse files Browse the repository at this point in the history
…test_failure
  • Loading branch information
cyberhorsey committed Feb 16, 2023
2 parents 976d960 + cbccb9a commit 20b90bc
Show file tree
Hide file tree
Showing 78 changed files with 353 additions and 278 deletions.
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/ProofVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../common/EssentialContract.sol";
import "../libs/LibZKP.sol";
Expand Down
49 changes: 49 additions & 0 deletions packages/protocol/contracts/L1/TaikoCustomErrors.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// SPDX-License-Identifier: MIT
// _____ _ _ _ _
// |_ _|_ _(_) |_____ | | __ _| |__ ___
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;

/// @author david <[email protected]>
abstract contract TaikoCustomErrors {
// The following custom errors must match the definitions in other V1 libraries.
error L1_0_FEE_BASE();
error L1_ANCHOR_CALLDATA();
error L1_ANCHOR_DEST();
error L1_ANCHOR_GAS_LIMIT();
error L1_ANCHOR_RECEIPT_ADDR();
error L1_ANCHOR_RECEIPT_DATA();
error L1_ANCHOR_RECEIPT_LOGS();
error L1_ANCHOR_RECEIPT_PROOF();
error L1_ANCHOR_RECEIPT_STATUS();
error L1_ANCHOR_RECEIPT_TOPICS();
error L1_ANCHOR_SIG_R();
error L1_ANCHOR_SIG_S();
error L1_ANCHOR_TYPE();
error L1_BLOCK_NUMBER();
error L1_CANNOT_BE_FIRST_PROVER();
error L1_CIRCUIT_LENGTH();
error L1_COMMITTED();
error L1_CONFLICT_PROOF();
error L1_DUP_PROVERS();
error L1_EXTRA_DATA();
error L1_GAS_LIMIT();
error L1_HALTED();
error L1_HALT_CONDITION();
error L1_ID();
error L1_INPUT_SIZE();
error L1_METADATA_FIELD();
error L1_META_MISMATCH();
error L1_NOT_COMMITTED();
error L1_NOT_FIRST_PROVER();
error L1_PROOF_LENGTH();
error L1_PROVER();
error L1_SOLO_PROPOSER();
error L1_TOO_LATE();
error L1_TOO_MANY();
error L1_TOO_MANY_PROVERS();
error L1_TX_LIST();
error L1_ZKP();
}
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/TaikoData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

/// @author dantaik <[email protected]>
library TaikoData {
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/TaikoEvents.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "./TaikoData.sol";

Expand Down
10 changes: 8 additions & 2 deletions packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../common/EssentialContract.sol";
import "../common/IHeaderSync.sol";
import "../libs/LibAnchorSignature.sol";
import "../libs/LibSharedConfig.sol";
import "./TaikoData.sol";
import "./TaikoEvents.sol";
import "./TaikoCustomErrors.sol";
import "./libs/LibProposing.sol";
import "./libs/LibProving.sol";
import "./libs/LibUtils.sol";
Expand All @@ -20,7 +21,12 @@ import "./libs/LibVerifying.sol";
/**
* @author dantaik <[email protected]>
*/
contract TaikoL1 is EssentialContract, IHeaderSync, TaikoEvents {
contract TaikoL1 is
EssentialContract,
IHeaderSync,
TaikoEvents,
TaikoCustomErrors
{
using LibUtils for TaikoData.State;

TaikoData.State public state;
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/TkoToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol";

Expand Down
12 changes: 8 additions & 4 deletions packages/protocol/contracts/L1/libs/LibProposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../../libs/LibTxDecoder.sol";
import "../TkoToken.sol";
Expand Down Expand Up @@ -109,9 +109,13 @@ library LibProposing {
meta.l1Hash = blockhash(block.number - 1);
meta.timestamp = uint64(block.timestamp);

// if multiple L2 blocks included in the same L1 block,
// their block.mixHash fields for randomness will be the same.
meta.mixHash = bytes32(block.difficulty);
// After The Merge, L1 mixHash contains the prevrandao
// from the beacon chain. Since multiple Taiko blocks
// can be proposed in one Ethereum block, we need to
// add salt to this random number as L2 mixHash
meta.mixHash = keccak256(
abi.encodePacked(block.prevrandao, state.nextBlockId)
);
}

uint256 deposit;
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/libs/LibProving.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import {IProofVerifier} from "../ProofVerifier.sol";
import "../../common/AddressResolver.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/libs/LibUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/libs/LibVerifying.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../../common/AddressResolver.sol";
import "../TkoToken.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L2/TaikoL2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../common/EssentialContract.sol";
import "./IBridge.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/bridge/BridgedERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
// solhint-disable-next-line max-line-length
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/bridge/EtherVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

// solhint-disable-next-line max-line-length
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/bridge/IBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

/**
* Bridge interface.
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/bridge/TokenVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

// solhint-disable-next-line max-line-length
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/bridge/libs/LibBridgeData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../../common/AddressResolver.sol";
import "../../libs/LibAddress.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "./LibBridgeData.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../../signal/ISignalService.sol";
import "../EtherVault.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../EtherVault.sol";
import "./LibBridgeData.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/bridge/libs/LibBridgeRetry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../EtherVault.sol";
import "./LibBridgeInvoke.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/bridge/libs/LibBridgeSend.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../../signal/ISignalService.sol";
import "./LibBridgeData.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../../common/IHeaderSync.sol";
import "../../libs/LibBlockHeader.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/common/AddressResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "@openzeppelin/contracts/utils/Strings.sol";
import "./IAddressManager.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/common/EssentialContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
// solhint-disable-next-line max-line-length
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/common/IAddressManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

/**
* @author dantaik <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/common/IHeaderSync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

/**
* Interface implemented by both the TaikoL1 and TaikoL2 contracts. It exposes
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/common/IMintableERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/libs/Lib1559Math.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

/**
* @author dantaik <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/libs/LibAddress.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

/**
* This library offers address-related methods.
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/libs/LibAnchorSignature.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "./LibUint512Math.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/libs/LibBlockHeader.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../thirdparty/LibRLPWriter.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/libs/LibInvalidTxList.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../L1/TaikoData.sol";
import "../libs/LibTxDecoder.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/libs/LibMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

/**
* @author dantaik <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/libs/LibReceiptDecoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// | |/ _` | | / / _ \ | |__/ _` | '_ (_-<
// |_|\__,_|_|_\_\___/ |____\__,_|_.__/__/

pragma solidity ^0.8.9;
pragma solidity ^0.8.18;

import "../thirdparty/LibBytesUtils.sol";
import "../thirdparty/LibRLPReader.sol";
Expand Down
Loading

0 comments on commit 20b90bc

Please sign in to comment.