From 9c3fb1001893c14c12165f68968980ca21a1748e Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Thu, 23 Feb 2023 04:01:39 +0800 Subject: [PATCH] refactor(protocol): extract two anchor-related functions (#13199) --- packages/protocol/.solhint.json | 2 +- .../protocol/contracts/L1/ProofVerifier.sol | 1 - .../contracts/L1/TaikoCustomErrors.sol | 2 +- packages/protocol/contracts/L1/TaikoData.sol | 5 +- .../protocol/contracts/L1/TaikoEvents.sol | 1 - packages/protocol/contracts/L1/TaikoL1.sol | 3 - packages/protocol/contracts/L1/TkoToken.sol | 1 - .../contracts/L1/libs/LibProposing.sol | 1 - .../protocol/contracts/L1/libs/LibProving.sol | 200 ++++++++++-------- .../protocol/contracts/L1/libs/LibUtils.sol | 1 - .../contracts/L1/libs/LibVerifying.sol | 1 - packages/protocol/contracts/L2/TaikoL2.sol | 3 - packages/protocol/contracts/bridge/Bridge.sol | 1 - .../contracts/bridge/BridgedERC20.sol | 3 - .../protocol/contracts/bridge/EtherVault.sol | 1 - .../protocol/contracts/bridge/IBridge.sol | 1 - .../protocol/contracts/bridge/TokenVault.sol | 1 - .../contracts/bridge/libs/LibBridgeData.sol | 1 - .../contracts/bridge/libs/LibBridgeInvoke.sol | 3 - .../bridge/libs/LibBridgeProcess.sol | 1 - .../bridge/libs/LibBridgeRelease.sol | 3 - .../contracts/bridge/libs/LibBridgeRetry.sol | 1 - .../contracts/bridge/libs/LibBridgeSend.sol | 1 - .../contracts/bridge/libs/LibBridgeStatus.sol | 3 - .../contracts/common/AddressResolver.sol | 1 - .../contracts/common/EssentialContract.sol | 1 - .../contracts/common/IAddressManager.sol | 1 - .../protocol/contracts/common/IHeaderSync.sol | 1 - .../protocol/contracts/libs/Lib1559Math.sol | 1 - .../protocol/contracts/libs/LibAddress.sol | 1 - .../contracts/libs/LibAnchorSignature.sol | 1 - .../contracts/libs/LibBlockHeader.sol | 1 - .../contracts/libs/LibInvalidTxList.sol | 1 - packages/protocol/contracts/libs/LibMath.sol | 1 - .../contracts/libs/LibReceiptDecoder.sol | 3 - .../contracts/libs/LibSharedConfig.sol | 2 +- .../protocol/contracts/libs/LibTrieProof.sol | 1 - .../protocol/contracts/libs/LibTxDecoder.sol | 1 - .../protocol/contracts/libs/LibTxUtils.sol | 1 - .../test/L1/TestTaikoL1EnableTokenomics.sol | 2 +- .../contracts/test/L1/TestTaikoL2.sol | 2 +- .../L1/TestTaikoL2EnablePublicInputsCheck.sol | 2 +- .../contracts/test/libs/TestLibProving.sol | 198 +++++++++-------- packages/relayer/TaikoL1.json | 2 +- packages/relayer/contracts/taikol1/TaikoL1.go | 4 +- packages/relayer/contracts/taikol2/TaikoL2.go | 4 +- .../status-page/src/constants/abi/TaikoL1.ts | 2 +- .../contract-documentation/L1/TaikoData.md | 2 +- 48 files changed, 236 insertions(+), 241 deletions(-) diff --git a/packages/protocol/.solhint.json b/packages/protocol/.solhint.json index ac099f7e5de..46c6ff69ac8 100644 --- a/packages/protocol/.solhint.json +++ b/packages/protocol/.solhint.json @@ -4,7 +4,7 @@ "avoid-low-level-calls": "off", "compiler-version": ["error", "^0.8.18"], "func-visibility": ["warn", { "ignoreConstructors": true }], - "max-line-length": ["warn", 80], + "max-line-length": ["warn", 100], "no-empty-blocks": "off", "no-inline-assembly": "off", "not-rely-on-time": "off", diff --git a/packages/protocol/contracts/L1/ProofVerifier.sol b/packages/protocol/contracts/L1/ProofVerifier.sol index cbf4c39adb1..4b82a284b3a 100644 --- a/packages/protocol/contracts/L1/ProofVerifier.sol +++ b/packages/protocol/contracts/L1/ProofVerifier.sol @@ -10,7 +10,6 @@ import {EssentialContract} from "../common/EssentialContract.sol"; import {LibZKP} from "../libs/LibZKP.sol"; import {LibMerkleTrie} from "../thirdparty/LibMerkleTrie.sol"; -/// @author dantaik interface IProofVerifier { function verifyZKP( string memory verifierId, diff --git a/packages/protocol/contracts/L1/TaikoCustomErrors.sol b/packages/protocol/contracts/L1/TaikoCustomErrors.sol index e19bd40a279..c4885f0dbb2 100644 --- a/packages/protocol/contracts/L1/TaikoCustomErrors.sol +++ b/packages/protocol/contracts/L1/TaikoCustomErrors.sol @@ -6,7 +6,6 @@ pragma solidity ^0.8.18; -/// @author david abstract contract TaikoCustomErrors { // The following custom errors must match the definitions in other V1 libraries. error L1_0_FEE_BASE(); @@ -21,6 +20,7 @@ abstract contract TaikoCustomErrors { error L1_ANCHOR_RECEIPT_TOPICS(); error L1_ANCHOR_SIG_R(); error L1_ANCHOR_SIG_S(); + error L1_ANCHOR_TX_PROOF(); error L1_ANCHOR_TYPE(); error L1_BLOCK_NUMBER(); error L1_CANNOT_BE_FIRST_PROVER(); diff --git a/packages/protocol/contracts/L1/TaikoData.sol b/packages/protocol/contracts/L1/TaikoData.sol index 8843adfaada..c898b85cb1e 100644 --- a/packages/protocol/contracts/L1/TaikoData.sol +++ b/packages/protocol/contracts/L1/TaikoData.sol @@ -6,7 +6,6 @@ pragma solidity ^0.8.18; -/// @author dantaik library TaikoData { struct Config { uint256 chainId; @@ -41,7 +40,7 @@ library TaikoData { uint64 proverRewardRandomizedPercentage; bool enableTokenomics; bool enablePublicInputsCheck; - bool enableProofValidation; + bool enableAnchorValidation; bool enableOracleProver; } @@ -80,7 +79,9 @@ library TaikoData { // only the latest one if verified in a batch mapping(uint256 blockId => bytes32 blockHash) l2Hashes; mapping(uint256 blockId => ProposedBlock proposedBlock) proposedBlocks; + // solhint-disable-next-line max-line-length mapping(uint256 blockId => mapping(bytes32 parentHash => ForkChoice forkChoice)) forkChoices; + // solhint-disable-next-line max-line-length mapping(address proposerAddress => mapping(uint256 commitSlot => bytes32 commitHash)) commits; // Never or rarely changed uint64 genesisHeight; diff --git a/packages/protocol/contracts/L1/TaikoEvents.sol b/packages/protocol/contracts/L1/TaikoEvents.sol index 9ba53e14db1..b223c220aa2 100644 --- a/packages/protocol/contracts/L1/TaikoEvents.sol +++ b/packages/protocol/contracts/L1/TaikoEvents.sol @@ -8,7 +8,6 @@ pragma solidity ^0.8.18; import {TaikoData} from "./TaikoData.sol"; -/// @author david abstract contract TaikoEvents { // The following events must match the definitions in other V1 libraries. event BlockVerified(uint256 indexed id, bytes32 blockHash); diff --git a/packages/protocol/contracts/L1/TaikoL1.sol b/packages/protocol/contracts/L1/TaikoL1.sol index 17823d3aebd..a7b8c584e67 100644 --- a/packages/protocol/contracts/L1/TaikoL1.sol +++ b/packages/protocol/contracts/L1/TaikoL1.sol @@ -19,9 +19,6 @@ import {LibUtils} from "./libs/LibUtils.sol"; import {LibVerifying} from "./libs/LibVerifying.sol"; import {AddressResolver} from "../common/AddressResolver.sol"; -/** - * @author dantaik - */ contract TaikoL1 is EssentialContract, IHeaderSync, diff --git a/packages/protocol/contracts/L1/TkoToken.sol b/packages/protocol/contracts/L1/TkoToken.sol index 450ce57c297..2f5f97469b1 100644 --- a/packages/protocol/contracts/L1/TkoToken.sol +++ b/packages/protocol/contracts/L1/TkoToken.sol @@ -18,7 +18,6 @@ import { IERC20Upgradeable } from "../thirdparty/ERC20Upgradeable.sol"; -/// @author dantaik /// @dev This is Taiko's governance and fee token. contract TkoToken is EssentialContract, ERC20Upgradeable, IMintableERC20 { using LibMath for uint256; diff --git a/packages/protocol/contracts/L1/libs/LibProposing.sol b/packages/protocol/contracts/L1/libs/LibProposing.sol index d44390a3382..d6f3f120fe3 100644 --- a/packages/protocol/contracts/L1/libs/LibProposing.sol +++ b/packages/protocol/contracts/L1/libs/LibProposing.sol @@ -16,7 +16,6 @@ import {LibUtils} from "./LibUtils.sol"; import {TaikoData} from "../TaikoData.sol"; import {AddressResolver} from "../../common/AddressResolver.sol"; -/// @author dantaik library LibProposing { using LibTxDecoder for bytes; using SafeCastUpgradeable for uint256; diff --git a/packages/protocol/contracts/L1/libs/LibProving.sol b/packages/protocol/contracts/L1/libs/LibProving.sol index 0cd48cba9ee..e80af17e8e4 100644 --- a/packages/protocol/contracts/L1/libs/LibProving.sol +++ b/packages/protocol/contracts/L1/libs/LibProving.sol @@ -18,8 +18,6 @@ import {LibRLPWriter} from "../../thirdparty/LibRLPWriter.sol"; import {LibUtils} from "./LibUtils.sol"; import {TaikoData} from "../../L1/TaikoData.sol"; -/// @author dantaik -/// @author david library LibProving { using LibBlockHeader for BlockHeader; using LibUtils for TaikoData.BlockMetadata; @@ -74,6 +72,7 @@ library LibProving { error L1_ANCHOR_RECEIPT_ADDR(); error L1_ANCHOR_RECEIPT_TOPICS(); error L1_ANCHOR_RECEIPT_DATA(); + error L1_ANCHOR_TX_PROOF(); error L1_HALTED(); function proveBlock( @@ -89,9 +88,6 @@ library LibProving { if (inputs.length != 3) revert L1_INPUT_SIZE(); Evidence memory evidence = abi.decode(inputs[0], (Evidence)); - bytes calldata anchorTx = inputs[1]; - bytes calldata anchorReceipt = inputs[2]; - // Check evidence if (evidence.meta.id != blockId) revert L1_ID(); @@ -106,59 +102,15 @@ library LibProving { resolver.resolve("proof_verifier", false) ); - if (config.enableProofValidation) { - // Check anchor tx is valid - LibTxDecoder.Tx memory _tx = LibTxDecoder.decodeTx( - config.chainId, - anchorTx - ); - if (_tx.txType != 0) revert L1_ANCHOR_TYPE(); - if ( - _tx.destination != - resolver.resolve(config.chainId, "taiko", false) - ) revert L1_ANCHOR_DEST(); - if (_tx.gasLimit != config.anchorTxGasLimit) - revert L1_ANCHOR_GAS_LIMIT(); - - // Check anchor tx's signature is valid and deterministic - _validateAnchorTxSignature(config.chainId, _tx); - - // Check anchor tx's calldata is valid - if ( - !LibBytesUtils.equal( - _tx.data, - bytes.concat( - ANCHOR_TX_SELECTOR, - bytes32(evidence.meta.l1Height), - evidence.meta.l1Hash - ) - ) - ) revert L1_ANCHOR_CALLDATA(); - - // Check anchor tx is the 1st tx in the block - if ( - !proofVerifier.verifyMKP({ - key: LibRLPWriter.writeUint(0), - value: anchorTx, - proof: evidence.proofs[zkProofsPerBlock], - root: evidence.header.transactionsRoot - }) - ) revert L1_ZKP(); - - // Check anchor tx does not throw - - LibReceiptDecoder.Receipt memory receipt = LibReceiptDecoder - .decodeReceipt(anchorReceipt); - - if (receipt.status != 1) revert L1_ANCHOR_RECEIPT_STATUS(); - if ( - !proofVerifier.verifyMKP({ - key: LibRLPWriter.writeUint(0), - value: anchorReceipt, - proof: evidence.proofs[zkProofsPerBlock + 1], - root: evidence.header.receiptsRoot - }) - ) revert L1_ANCHOR_RECEIPT_PROOF(); + if (config.enableAnchorValidation) { + _proveAnchorForValidBlock({ + config: config, + resolver: resolver, + proofVerifier: proofVerifier, + evidence: evidence, + anchorTx: inputs[1], + anchorReceipt: inputs[2] + }); } // ZK-prove block and mark block proven to be valid. @@ -189,7 +141,6 @@ library LibProving { inputs[1], (TaikoData.BlockMetadata) ); - bytes calldata invalidateBlockReceipt = inputs[2]; // Check evidence if (evidence.meta.id != blockId) revert L1_ID(); @@ -200,37 +151,15 @@ library LibProving { resolver.resolve("proof_verifier", false) ); - // Check the event is the first one in the throw-away block - if ( - !proofVerifier.verifyMKP({ - key: LibRLPWriter.writeUint(0), - value: invalidateBlockReceipt, - proof: evidence.proofs[config.zkProofsPerBlock], - root: evidence.header.receiptsRoot - }) - ) revert L1_ANCHOR_RECEIPT_PROOF(); - - // Check the 1st receipt is for an InvalidateBlock tx with - // a BlockInvalidated event - LibReceiptDecoder.Receipt memory receipt = LibReceiptDecoder - .decodeReceipt(invalidateBlockReceipt); - if (receipt.status != 1) revert L1_ANCHOR_RECEIPT_STATUS(); - - if (receipt.logs.length != 1) revert L1_ANCHOR_RECEIPT_LOGS(); - - { - LibReceiptDecoder.Log memory log = receipt.logs[0]; - if ( - log.contractAddress != - resolver.resolve(config.chainId, "taiko", false) - ) revert L1_ANCHOR_RECEIPT_ADDR(); - - if (log.data.length != 0) revert L1_ANCHOR_RECEIPT_DATA(); - if ( - log.topics.length != 2 || - log.topics[0] != INVALIDATE_BLOCK_LOG_TOPIC || - log.topics[1] != target.txListHash - ) revert L1_ANCHOR_RECEIPT_TOPICS(); + if (config.enableAnchorValidation) { + _proveAnchorForInvalidBlock({ + config: config, + resolver: resolver, + target: target, + proofVerifier: proofVerifier, + evidence: evidence, + invalidateBlockReceipt: inputs[2] + }); } // ZK-prove block and mark block proven as invalid. @@ -393,6 +322,97 @@ library LibProving { }); } + function _proveAnchorForValidBlock( + TaikoData.Config memory config, + AddressResolver resolver, + IProofVerifier proofVerifier, + Evidence memory evidence, + bytes calldata anchorTx, + bytes calldata anchorReceipt + ) private view { + // Check anchor tx is valid + LibTxDecoder.Tx memory _tx = LibTxDecoder.decodeTx( + config.chainId, + anchorTx + ); + if (_tx.txType != 0) revert L1_ANCHOR_TYPE(); + if (_tx.destination != resolver.resolve(config.chainId, "taiko", false)) + revert L1_ANCHOR_DEST(); + if (_tx.gasLimit != config.anchorTxGasLimit) + revert L1_ANCHOR_GAS_LIMIT(); + // Check anchor tx's signature is valid and deterministic + _validateAnchorTxSignature(config.chainId, _tx); + // Check anchor tx's calldata is valid + if ( + !LibBytesUtils.equal( + _tx.data, + bytes.concat( + ANCHOR_TX_SELECTOR, + bytes32(evidence.meta.l1Height), + evidence.meta.l1Hash + ) + ) + ) revert L1_ANCHOR_CALLDATA(); + // Check anchor tx is the 1st tx in the block + + uint256 zkProofsPerBlock = config.zkProofsPerBlock; + if ( + !proofVerifier.verifyMKP({ + key: LibRLPWriter.writeUint(0), + value: anchorTx, + proof: evidence.proofs[zkProofsPerBlock], + root: evidence.header.transactionsRoot + }) + ) revert L1_ANCHOR_TX_PROOF(); + // Check anchor tx does not throw + LibReceiptDecoder.Receipt memory receipt = LibReceiptDecoder + .decodeReceipt(anchorReceipt); + if (receipt.status != 1) revert L1_ANCHOR_RECEIPT_STATUS(); + if ( + !proofVerifier.verifyMKP({ + key: LibRLPWriter.writeUint(0), + value: anchorReceipt, + proof: evidence.proofs[zkProofsPerBlock + 1], + root: evidence.header.receiptsRoot + }) + ) revert L1_ANCHOR_RECEIPT_PROOF(); + } + + function _proveAnchorForInvalidBlock( + TaikoData.Config memory config, + AddressResolver resolver, + TaikoData.BlockMetadata memory target, + IProofVerifier proofVerifier, + Evidence memory evidence, + bytes calldata invalidateBlockReceipt + ) private view { + if ( + !proofVerifier.verifyMKP({ + key: LibRLPWriter.writeUint(0), + value: invalidateBlockReceipt, + proof: evidence.proofs[config.zkProofsPerBlock], + root: evidence.header.receiptsRoot + }) + ) revert L1_ANCHOR_RECEIPT_PROOF(); + // Check the 1st receipt is for an InvalidateBlock tx with + // a BlockInvalidated event + LibReceiptDecoder.Receipt memory receipt = LibReceiptDecoder + .decodeReceipt(invalidateBlockReceipt); + if (receipt.status != 1) revert L1_ANCHOR_RECEIPT_STATUS(); + if (receipt.logs.length != 1) revert L1_ANCHOR_RECEIPT_LOGS(); + LibReceiptDecoder.Log memory log = receipt.logs[0]; + if ( + log.contractAddress != + resolver.resolve(config.chainId, "taiko", false) + ) revert L1_ANCHOR_RECEIPT_ADDR(); + if (log.data.length != 0) revert L1_ANCHOR_RECEIPT_DATA(); + if ( + log.topics.length != 2 || + log.topics[0] != INVALIDATE_BLOCK_LOG_TOPIC || + log.topics[1] != target.txListHash + ) revert L1_ANCHOR_RECEIPT_TOPICS(); + } + function _validateAnchorTxSignature( uint256 chainId, LibTxDecoder.Tx memory _tx diff --git a/packages/protocol/contracts/L1/libs/LibUtils.sol b/packages/protocol/contracts/L1/libs/LibUtils.sol index d875024b554..7cb79610696 100644 --- a/packages/protocol/contracts/L1/libs/LibUtils.sol +++ b/packages/protocol/contracts/L1/libs/LibUtils.sol @@ -13,7 +13,6 @@ import { import {LibMath} from "../../libs/LibMath.sol"; import {TaikoData} from "../TaikoData.sol"; -/// @author dantaik library LibUtils { using LibMath for uint256; diff --git a/packages/protocol/contracts/L1/libs/LibVerifying.sol b/packages/protocol/contracts/L1/libs/LibVerifying.sol index 16285ac2e33..f207e1271ed 100644 --- a/packages/protocol/contracts/L1/libs/LibVerifying.sol +++ b/packages/protocol/contracts/L1/libs/LibVerifying.sol @@ -17,7 +17,6 @@ import {TaikoData} from "../../L1/TaikoData.sol"; /** * LibVerifying. - * @author dantaik */ library LibVerifying { using SafeCastUpgradeable for uint256; diff --git a/packages/protocol/contracts/L2/TaikoL2.sol b/packages/protocol/contracts/L2/TaikoL2.sol index 124bb4ede4e..356543d69f6 100644 --- a/packages/protocol/contracts/L2/TaikoL2.sol +++ b/packages/protocol/contracts/L2/TaikoL2.sol @@ -19,9 +19,6 @@ import {LibSharedConfig} from "../libs/LibSharedConfig.sol"; import {LibTxDecoder} from "../libs/LibTxDecoder.sol"; import {TaikoData} from "../L1/TaikoData.sol"; -/** - * @author dantaik - */ contract TaikoL2 is AddressResolver, ReentrancyGuard, IHeaderSync { using LibTxDecoder for bytes; diff --git a/packages/protocol/contracts/bridge/Bridge.sol b/packages/protocol/contracts/bridge/Bridge.sol index 5d024420d85..4134c2b2195 100644 --- a/packages/protocol/contracts/bridge/Bridge.sol +++ b/packages/protocol/contracts/bridge/Bridge.sol @@ -20,7 +20,6 @@ import {LibBridgeStatus} from "./libs/LibBridgeStatus.sol"; * Bridge contract which is deployed on both L1 and L2. Mostly a thin wrapper * which calls the library implementations. See _IBridge_ for more details. * @dev The code hash for the same address on L1 and L2 may be different. - * @author dantaik */ contract Bridge is EssentialContract, IBridge { using LibBridgeData for Message; diff --git a/packages/protocol/contracts/bridge/BridgedERC20.sol b/packages/protocol/contracts/bridge/BridgedERC20.sol index bcebde92524..64bcf33ccce 100644 --- a/packages/protocol/contracts/bridge/BridgedERC20.sol +++ b/packages/protocol/contracts/bridge/BridgedERC20.sol @@ -17,9 +17,6 @@ import { import {EssentialContract} from "../common/EssentialContract.sol"; import {ERC20Upgradeable} from "../thirdparty/ERC20Upgradeable.sol"; -/** - * @author dantaik - */ contract BridgedERC20 is EssentialContract, IERC20Upgradeable, diff --git a/packages/protocol/contracts/bridge/EtherVault.sol b/packages/protocol/contracts/bridge/EtherVault.sol index ecf98848d55..b271da003b7 100644 --- a/packages/protocol/contracts/bridge/EtherVault.sol +++ b/packages/protocol/contracts/bridge/EtherVault.sol @@ -22,7 +22,6 @@ import {LibAddress} from "../libs/LibAddress.sol"; * - Is initialized with 2^128 Ether. * - Allows the contract owner to authorize addresses. * - Allows authorized addresses to send/release Ether. - * @author dantaik */ contract EtherVault is EssentialContract { using LibAddress for address; diff --git a/packages/protocol/contracts/bridge/IBridge.sol b/packages/protocol/contracts/bridge/IBridge.sol index ea066414245..65abe84194b 100644 --- a/packages/protocol/contracts/bridge/IBridge.sol +++ b/packages/protocol/contracts/bridge/IBridge.sol @@ -10,7 +10,6 @@ pragma solidity ^0.8.18; * Bridge interface. * @dev Ether is held by Bridges on L1 and by the EtherVault on L2, * not TokenVaults. - * @author dantaik */ interface IBridge { struct Message { diff --git a/packages/protocol/contracts/bridge/TokenVault.sol b/packages/protocol/contracts/bridge/TokenVault.sol index 5dc117e0908..1d0d3883ea9 100644 --- a/packages/protocol/contracts/bridge/TokenVault.sol +++ b/packages/protocol/contracts/bridge/TokenVault.sol @@ -26,7 +26,6 @@ import {IBridge} from "./IBridge.sol"; * tokens. * @dev Ether is held by Bridges on L1 and by the EtherVault on L2, * not TokenVaults. - * @author dantaik */ contract TokenVault is EssentialContract { using SafeERC20Upgradeable for ERC20Upgradeable; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeData.sol b/packages/protocol/contracts/bridge/libs/LibBridgeData.sol index 02560f4fac9..0a16cc06a5c 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeData.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeData.sol @@ -14,7 +14,6 @@ import {IBridge} from "../IBridge.sol"; /** * Stores message metadata on the Bridge. - * @author dantaik */ library LibBridgeData { struct State { diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeInvoke.sol b/packages/protocol/contracts/bridge/libs/LibBridgeInvoke.sol index b47c66cc735..a7ba55ad1ac 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeInvoke.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeInvoke.sol @@ -8,9 +8,6 @@ pragma solidity ^0.8.18; import {LibBridgeData, IBridge, LibAddress} from "./LibBridgeData.sol"; -/** - * @author dantaik - */ library LibBridgeInvoke { using LibAddress for address; using LibBridgeData for IBridge.Message; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeProcess.sol b/packages/protocol/contracts/bridge/libs/LibBridgeProcess.sol index eac18301267..7f9ca4103cc 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeProcess.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeProcess.sol @@ -19,7 +19,6 @@ import {AddressResolver} from "../../common/AddressResolver.sol"; /** * Process bridge messages on the destination chain. * @title LibBridgeProcess - * @author dantaik */ library LibBridgeProcess { using LibMath for uint256; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeRelease.sol b/packages/protocol/contracts/bridge/libs/LibBridgeRelease.sol index 2d1cb982d71..e52ff88b7ec 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeRelease.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeRelease.sol @@ -12,9 +12,6 @@ import {LibBridgeStatus} from "./LibBridgeStatus.sol"; import {IBridge} from "../IBridge.sol"; import {AddressResolver} from "../../common/AddressResolver.sol"; -/** - * @author dantaik - */ library LibBridgeRelease { using LibBridgeData for IBridge.Message; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeRetry.sol b/packages/protocol/contracts/bridge/libs/LibBridgeRetry.sol index cd2d71f2347..20e709beda2 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeRetry.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeRetry.sol @@ -17,7 +17,6 @@ import {AddressResolver} from "../../common/AddressResolver.sol"; /** * Retry bridge messages. * @title LibBridgeRetry - * @author dantaik */ library LibBridgeRetry { using LibAddress for address; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeSend.sol b/packages/protocol/contracts/bridge/libs/LibBridgeSend.sol index 73ac988831b..d4d6172c701 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeSend.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeSend.sol @@ -16,7 +16,6 @@ import {IBridge} from "../IBridge.sol"; * Entry point for starting a bridge transaction. * * @title LibBridgeSend - * @author dantaik */ library LibBridgeSend { using LibAddress for address; diff --git a/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol b/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol index 3d918db448a..e43123c4ed4 100644 --- a/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol +++ b/packages/protocol/contracts/bridge/libs/LibBridgeStatus.sol @@ -12,9 +12,6 @@ import {LibBlockHeader, BlockHeader} from "../../libs/LibBlockHeader.sol"; import {LibTrieProof} from "../../libs/LibTrieProof.sol"; import {LibBridgeData} from "./LibBridgeData.sol"; -/** - * @author dantaik - */ library LibBridgeStatus { using LibBlockHeader for BlockHeader; diff --git a/packages/protocol/contracts/common/AddressResolver.sol b/packages/protocol/contracts/common/AddressResolver.sol index 96d0600fdeb..f9ff185d03f 100644 --- a/packages/protocol/contracts/common/AddressResolver.sol +++ b/packages/protocol/contracts/common/AddressResolver.sol @@ -14,7 +14,6 @@ import {IAddressManager} from "./IAddressManager.sol"; * it uses an AddressManager to manage the name-to-address mapping. * * @title AddressResolver - * @author dantaik */ abstract contract AddressResolver { IAddressManager internal _addressManager; diff --git a/packages/protocol/contracts/common/EssentialContract.sol b/packages/protocol/contracts/common/EssentialContract.sol index 6e759077ec4..4d882cbaa68 100644 --- a/packages/protocol/contracts/common/EssentialContract.sol +++ b/packages/protocol/contracts/common/EssentialContract.sol @@ -17,7 +17,6 @@ import { import {AddressResolver} from "./AddressResolver.sol"; /** - * @author dantaik * @dev This abstract contract serves as the base contract for many core * components in this package. */ diff --git a/packages/protocol/contracts/common/IAddressManager.sol b/packages/protocol/contracts/common/IAddressManager.sol index a5c6ab046df..6f90c7c757e 100644 --- a/packages/protocol/contracts/common/IAddressManager.sol +++ b/packages/protocol/contracts/common/IAddressManager.sol @@ -7,7 +7,6 @@ pragma solidity ^0.8.18; /** - * @author dantaik * @notice Interface to set and get an address for a name. */ interface IAddressManager { diff --git a/packages/protocol/contracts/common/IHeaderSync.sol b/packages/protocol/contracts/common/IHeaderSync.sol index fcfd264767c..741d26e1307 100644 --- a/packages/protocol/contracts/common/IHeaderSync.sol +++ b/packages/protocol/contracts/common/IHeaderSync.sol @@ -9,7 +9,6 @@ pragma solidity ^0.8.18; /** * Interface implemented by both the TaikoL1 and TaikoL2 contracts. It exposes * the methods needed to access the block hashes of the other chain. - * @author dantaik */ interface IHeaderSync { event HeaderSynced(uint256 indexed srcHeight, bytes32 srcHash); diff --git a/packages/protocol/contracts/libs/Lib1559Math.sol b/packages/protocol/contracts/libs/Lib1559Math.sol index 06746912a71..dc67773aeab 100644 --- a/packages/protocol/contracts/libs/Lib1559Math.sol +++ b/packages/protocol/contracts/libs/Lib1559Math.sol @@ -7,7 +7,6 @@ pragma solidity ^0.8.18; /** - * @author dantaik * @notice This library offers two functions for EIP-1559-style math. * See more at https://dankradfeist.de/ethereum/2022/03/16/exponential-eip1559.html */ diff --git a/packages/protocol/contracts/libs/LibAddress.sol b/packages/protocol/contracts/libs/LibAddress.sol index 61391c50a10..b1a625dad75 100644 --- a/packages/protocol/contracts/libs/LibAddress.sol +++ b/packages/protocol/contracts/libs/LibAddress.sol @@ -8,7 +8,6 @@ pragma solidity ^0.8.18; /** * This library offers address-related methods. - * @author dantaik */ library LibAddress { /** diff --git a/packages/protocol/contracts/libs/LibAnchorSignature.sol b/packages/protocol/contracts/libs/LibAnchorSignature.sol index 424244c991e..a2a8c3b713e 100644 --- a/packages/protocol/contracts/libs/LibAnchorSignature.sol +++ b/packages/protocol/contracts/libs/LibAnchorSignature.sol @@ -8,7 +8,6 @@ pragma solidity ^0.8.18; import {LibUint512Math} from "./LibUint512Math.sol"; -/// @author david library LibAnchorSignature { address public constant K_GOLDEN_TOUCH_ADDRESS = 0x0000777735367b36bC9B61C50022d9D0700dB4Ec; diff --git a/packages/protocol/contracts/libs/LibBlockHeader.sol b/packages/protocol/contracts/libs/LibBlockHeader.sol index 18532408d5e..78b4ff65158 100644 --- a/packages/protocol/contracts/libs/LibBlockHeader.sol +++ b/packages/protocol/contracts/libs/LibBlockHeader.sol @@ -8,7 +8,6 @@ pragma solidity ^0.8.18; import {LibRLPWriter} from "../thirdparty/LibRLPWriter.sol"; -/// @author david struct BlockHeader { bytes32 parentHash; bytes32 ommersHash; diff --git a/packages/protocol/contracts/libs/LibInvalidTxList.sol b/packages/protocol/contracts/libs/LibInvalidTxList.sol index da6a66971f5..3ba9aa1e9c3 100644 --- a/packages/protocol/contracts/libs/LibInvalidTxList.sol +++ b/packages/protocol/contracts/libs/LibInvalidTxList.sol @@ -31,7 +31,6 @@ import {LibRLPWriter} from "../thirdparty/LibRLPWriter.sol"; * `minTxGasLimit` (rule #5 in Ethereum yellow paper). * * @title LibInvalidTxList - * @author david */ library LibInvalidTxList { // NOTE: If the order of this enum changes, then some test cases that using diff --git a/packages/protocol/contracts/libs/LibMath.sol b/packages/protocol/contracts/libs/LibMath.sol index f1bcc74b66e..da96e245c53 100644 --- a/packages/protocol/contracts/libs/LibMath.sol +++ b/packages/protocol/contracts/libs/LibMath.sol @@ -7,7 +7,6 @@ pragma solidity ^0.8.18; /** - * @author dantaik * @notice This library offers additional math functions for uint256. */ diff --git a/packages/protocol/contracts/libs/LibReceiptDecoder.sol b/packages/protocol/contracts/libs/LibReceiptDecoder.sol index 45e31a07c7d..ea564d6d3a6 100644 --- a/packages/protocol/contracts/libs/LibReceiptDecoder.sol +++ b/packages/protocol/contracts/libs/LibReceiptDecoder.sol @@ -9,9 +9,6 @@ pragma solidity ^0.8.18; import {LibBytesUtils} from "../thirdparty/LibBytesUtils.sol"; import {LibRLPReader} from "../thirdparty/LibRLPReader.sol"; -/** - * @author david - */ library LibReceiptDecoder { struct Receipt { uint64 status; diff --git a/packages/protocol/contracts/libs/LibSharedConfig.sol b/packages/protocol/contracts/libs/LibSharedConfig.sol index 8490b3227a6..8134017d6b6 100644 --- a/packages/protocol/contracts/libs/LibSharedConfig.sol +++ b/packages/protocol/contracts/libs/LibSharedConfig.sol @@ -59,7 +59,7 @@ library LibSharedConfig { proverRewardRandomizedPercentage: 20, // owner: daniel enableTokenomics: true, enablePublicInputsCheck: true, - enableProofValidation: true, + enableAnchorValidation: true, enableOracleProver: true }); } diff --git a/packages/protocol/contracts/libs/LibTrieProof.sol b/packages/protocol/contracts/libs/LibTrieProof.sol index e9e7f3ee5c2..44c46ea5cd4 100644 --- a/packages/protocol/contracts/libs/LibTrieProof.sol +++ b/packages/protocol/contracts/libs/LibTrieProof.sol @@ -12,7 +12,6 @@ import {LibSecureMerkleTrie} from "../thirdparty/LibSecureMerkleTrie.sol"; /** * @title LibTrieProof - * @author dantaik */ library LibTrieProof { /********************* diff --git a/packages/protocol/contracts/libs/LibTxDecoder.sol b/packages/protocol/contracts/libs/LibTxDecoder.sol index 8648335e230..a7660611c82 100644 --- a/packages/protocol/contracts/libs/LibTxDecoder.sol +++ b/packages/protocol/contracts/libs/LibTxDecoder.sol @@ -9,7 +9,6 @@ pragma solidity ^0.8.18; import {LibBytesUtils} from "../thirdparty/LibBytesUtils.sol"; import {LibRLPReader} from "../thirdparty/LibRLPReader.sol"; -/// @author david library LibTxDecoder { struct TransactionLegacy { uint256 nonce; diff --git a/packages/protocol/contracts/libs/LibTxUtils.sol b/packages/protocol/contracts/libs/LibTxUtils.sol index 69bd80fb999..b99706f92f4 100644 --- a/packages/protocol/contracts/libs/LibTxUtils.sol +++ b/packages/protocol/contracts/libs/LibTxUtils.sol @@ -13,7 +13,6 @@ import {LibBytesUtils} from "../thirdparty/LibBytesUtils.sol"; import {LibRLPReader} from "../thirdparty/LibRLPReader.sol"; import {LibRLPWriter} from "../thirdparty/LibRLPWriter.sol"; -/// @author david library LibTxUtils { function hashUnsignedTx( uint256 chainId, diff --git a/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol b/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol index acd45489901..5f38020d9b5 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL1EnableTokenomics.sol @@ -51,7 +51,7 @@ contract TestTaikoL1EnableTokenomics is TaikoL1, IProofVerifier { config.proverRewardRandomizedPercentage = 0; config.enableTokenomics = true; config.enablePublicInputsCheck = false; - config.enableProofValidation = false; + config.enableAnchorValidation = false; config.enableOracleProver = false; } diff --git a/packages/protocol/contracts/test/L1/TestTaikoL2.sol b/packages/protocol/contracts/test/L1/TestTaikoL2.sol index 494cef504e7..f4a5ecea5dd 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL2.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL2.sol @@ -52,7 +52,7 @@ contract TestTaikoL2 is TaikoL2 { config.proverRewardRandomizedPercentage = 0; config.enableTokenomics = true; config.enablePublicInputsCheck = false; - config.enableProofValidation = false; + config.enableAnchorValidation = false; config.enableOracleProver = false; } } diff --git a/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol b/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol index 814f6902b18..ae94d57cf5d 100644 --- a/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol +++ b/packages/protocol/contracts/test/L1/TestTaikoL2EnablePublicInputsCheck.sol @@ -52,7 +52,7 @@ contract TestTaikoL2EnablePublicInputsCheck is TaikoL2 { config.proverRewardRandomizedPercentage = 0; config.enableTokenomics = true; config.enablePublicInputsCheck = true; - config.enableProofValidation = true; + config.enableAnchorValidation = true; config.enableOracleProver = false; } } diff --git a/packages/protocol/contracts/test/libs/TestLibProving.sol b/packages/protocol/contracts/test/libs/TestLibProving.sol index 9d163ad3048..7f8881079b1 100644 --- a/packages/protocol/contracts/test/libs/TestLibProving.sol +++ b/packages/protocol/contracts/test/libs/TestLibProving.sol @@ -81,6 +81,7 @@ library TestLibProving { error L1_ANCHOR_RECEIPT_ADDR(); error L1_ANCHOR_RECEIPT_TOPICS(); error L1_ANCHOR_RECEIPT_DATA(); + error L1_ANCHOR_TX_PROOF(); error L1_HALTED(); function proveBlock( @@ -96,9 +97,6 @@ library TestLibProving { if (inputs.length != 3) revert L1_INPUT_SIZE(); Evidence memory evidence = abi.decode(inputs[0], (Evidence)); - bytes calldata anchorTx = inputs[1]; - bytes calldata anchorReceipt = inputs[2]; - // Check evidence if (evidence.meta.id != blockId) revert L1_ID(); @@ -113,59 +111,15 @@ library TestLibProving { resolver.resolve("proof_verifier", false) ); - if (config.enableProofValidation) { - // Check anchor tx is valid - LibTxDecoder.Tx memory _tx = LibTxDecoder.decodeTx( - config.chainId, - anchorTx - ); - if (_tx.txType != 0) revert L1_ANCHOR_TYPE(); - if ( - _tx.destination != - resolver.resolve(config.chainId, "taiko", false) - ) revert L1_ANCHOR_DEST(); - if (_tx.gasLimit != config.anchorTxGasLimit) - revert L1_ANCHOR_GAS_LIMIT(); - - // Check anchor tx's signature is valid and deterministic - _validateAnchorTxSignature(config.chainId, _tx); - - // Check anchor tx's calldata is valid - if ( - !LibBytesUtils.equal( - _tx.data, - bytes.concat( - ANCHOR_TX_SELECTOR, - bytes32(evidence.meta.l1Height), - evidence.meta.l1Hash - ) - ) - ) revert L1_ANCHOR_CALLDATA(); - - // Check anchor tx is the 1st tx in the block - if ( - !proofVerifier.verifyMKP({ - key: LibRLPWriter.writeUint(0), - value: anchorTx, - proof: evidence.proofs[zkProofsPerBlock], - root: evidence.header.transactionsRoot - }) - ) revert L1_ZKP(); - - // Check anchor tx does not throw - - LibReceiptDecoder.Receipt memory receipt = LibReceiptDecoder - .decodeReceipt(anchorReceipt); - - if (receipt.status != 1) revert L1_ANCHOR_RECEIPT_STATUS(); - if ( - !proofVerifier.verifyMKP({ - key: LibRLPWriter.writeUint(0), - value: anchorReceipt, - proof: evidence.proofs[zkProofsPerBlock + 1], - root: evidence.header.receiptsRoot - }) - ) revert L1_ANCHOR_RECEIPT_PROOF(); + if (config.enableAnchorValidation) { + _proveAnchorForValidBlock({ + config: config, + resolver: resolver, + proofVerifier: proofVerifier, + evidence: evidence, + anchorTx: inputs[1], + anchorReceipt: inputs[2] + }); } // ZK-prove block and mark block proven to be valid. @@ -196,7 +150,6 @@ library TestLibProving { inputs[1], (TaikoData.BlockMetadata) ); - bytes calldata invalidateBlockReceipt = inputs[2]; // Check evidence if (evidence.meta.id != blockId) revert L1_ID(); @@ -207,37 +160,15 @@ library TestLibProving { resolver.resolve("proof_verifier", false) ); - // Check the event is the first one in the throw-away block - if ( - !proofVerifier.verifyMKP({ - key: LibRLPWriter.writeUint(0), - value: invalidateBlockReceipt, - proof: evidence.proofs[config.zkProofsPerBlock], - root: evidence.header.receiptsRoot - }) - ) revert L1_ANCHOR_RECEIPT_PROOF(); - - // Check the 1st receipt is for an InvalidateBlock tx with - // a BlockInvalidated event - LibReceiptDecoder.Receipt memory receipt = LibReceiptDecoder - .decodeReceipt(invalidateBlockReceipt); - if (receipt.status != 1) revert L1_ANCHOR_RECEIPT_STATUS(); - - if (receipt.logs.length != 1) revert L1_ANCHOR_RECEIPT_LOGS(); - - { - LibReceiptDecoder.Log memory log = receipt.logs[0]; - if ( - log.contractAddress != - resolver.resolve(config.chainId, "taiko", false) - ) revert L1_ANCHOR_RECEIPT_ADDR(); - - if (log.data.length != 0) revert L1_ANCHOR_RECEIPT_DATA(); - if ( - log.topics.length != 2 || - log.topics[0] != INVALIDATE_BLOCK_LOG_TOPIC || - log.topics[1] != target.txListHash - ) revert L1_ANCHOR_RECEIPT_TOPICS(); + if (config.enableAnchorValidation) { + _proveAnchorForInvalidBlock({ + config: config, + resolver: resolver, + target: target, + proofVerifier: proofVerifier, + evidence: evidence, + invalidateBlockReceipt: inputs[2] + }); } // ZK-prove block and mark block proven as invalid. @@ -400,6 +331,97 @@ library TestLibProving { }); } + function _proveAnchorForValidBlock( + TaikoData.Config memory config, + AddressResolver resolver, + IProofVerifier proofVerifier, + Evidence memory evidence, + bytes calldata anchorTx, + bytes calldata anchorReceipt + ) private view { + // Check anchor tx is valid + LibTxDecoder.Tx memory _tx = LibTxDecoder.decodeTx( + config.chainId, + anchorTx + ); + if (_tx.txType != 0) revert L1_ANCHOR_TYPE(); + if (_tx.destination != resolver.resolve(config.chainId, "taiko", false)) + revert L1_ANCHOR_DEST(); + if (_tx.gasLimit != config.anchorTxGasLimit) + revert L1_ANCHOR_GAS_LIMIT(); + // Check anchor tx's signature is valid and deterministic + _validateAnchorTxSignature(config.chainId, _tx); + // Check anchor tx's calldata is valid + if ( + !LibBytesUtils.equal( + _tx.data, + bytes.concat( + ANCHOR_TX_SELECTOR, + bytes32(evidence.meta.l1Height), + evidence.meta.l1Hash + ) + ) + ) revert L1_ANCHOR_CALLDATA(); + // Check anchor tx is the 1st tx in the block + + uint256 zkProofsPerBlock = config.zkProofsPerBlock; + if ( + !proofVerifier.verifyMKP({ + key: LibRLPWriter.writeUint(0), + value: anchorTx, + proof: evidence.proofs[zkProofsPerBlock], + root: evidence.header.transactionsRoot + }) + ) revert L1_ANCHOR_TX_PROOF(); + // Check anchor tx does not throw + LibReceiptDecoder.Receipt memory receipt = LibReceiptDecoder + .decodeReceipt(anchorReceipt); + if (receipt.status != 1) revert L1_ANCHOR_RECEIPT_STATUS(); + if ( + !proofVerifier.verifyMKP({ + key: LibRLPWriter.writeUint(0), + value: anchorReceipt, + proof: evidence.proofs[zkProofsPerBlock + 1], + root: evidence.header.receiptsRoot + }) + ) revert L1_ANCHOR_RECEIPT_PROOF(); + } + + function _proveAnchorForInvalidBlock( + TaikoData.Config memory config, + AddressResolver resolver, + TaikoData.BlockMetadata memory target, + IProofVerifier proofVerifier, + Evidence memory evidence, + bytes calldata invalidateBlockReceipt + ) private view { + if ( + !proofVerifier.verifyMKP({ + key: LibRLPWriter.writeUint(0), + value: invalidateBlockReceipt, + proof: evidence.proofs[config.zkProofsPerBlock], + root: evidence.header.receiptsRoot + }) + ) revert L1_ANCHOR_RECEIPT_PROOF(); + // Check the 1st receipt is for an InvalidateBlock tx with + // a BlockInvalidated event + LibReceiptDecoder.Receipt memory receipt = LibReceiptDecoder + .decodeReceipt(invalidateBlockReceipt); + if (receipt.status != 1) revert L1_ANCHOR_RECEIPT_STATUS(); + if (receipt.logs.length != 1) revert L1_ANCHOR_RECEIPT_LOGS(); + LibReceiptDecoder.Log memory log = receipt.logs[0]; + if ( + log.contractAddress != + resolver.resolve(config.chainId, "taiko", false) + ) revert L1_ANCHOR_RECEIPT_ADDR(); + if (log.data.length != 0) revert L1_ANCHOR_RECEIPT_DATA(); + if ( + log.topics.length != 2 || + log.topics[0] != INVALIDATE_BLOCK_LOG_TOPIC || + log.topics[1] != target.txListHash + ) revert L1_ANCHOR_RECEIPT_TOPICS(); + } + function _validateAnchorTxSignature( uint256 chainId, LibTxDecoder.Tx memory _tx diff --git a/packages/relayer/TaikoL1.json b/packages/relayer/TaikoL1.json index 8283d891722..5cd2e187e35 100644 --- a/packages/relayer/TaikoL1.json +++ b/packages/relayer/TaikoL1.json @@ -419,7 +419,7 @@ }, { "internalType": "bool", - "name": "enableProofValidation", + "name": "enableAnchorValidation", "type": "bool" }, { diff --git a/packages/relayer/contracts/taikol1/TaikoL1.go b/packages/relayer/contracts/taikol1/TaikoL1.go index 3679afafb56..a7356009126 100644 --- a/packages/relayer/contracts/taikol1/TaikoL1.go +++ b/packages/relayer/contracts/taikol1/TaikoL1.go @@ -84,7 +84,7 @@ type TaikoDataConfig struct { InitialUncleDelay uint64 EnableTokenomics bool EnablePublicInputsCheck bool - EnableProofValidation bool + enableAnchorValidation bool EnableOracleProver bool } @@ -104,7 +104,7 @@ type TaikoDataProposedBlock struct { } // TaikoL1ABI is the input ABI used to generate the binding from. -const TaikoL1ABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"BlockCommitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"halted\",\"type\":\"bool\"}],\"name\":\"Halted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"commitBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockHashHistory\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zkProofsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxProofsPerForkChoice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTransactionsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBytesPerTxList\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"anchorTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"slotSmoothingFactor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardBurnBips\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerDepositPctg\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBaseMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"rewardMultiplierPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeGracePeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeMaxPeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"bootstrapDiscountHalvingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"initialUncleDelay\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enableTokenomics\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enablePublicInputsCheck\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableProofValidation\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableOracleProver\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"address[]\",\"name\":\"provers\",\"type\":\"address[]\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"name\":\"getProofReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getProposedBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.ProposedBlock\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"statusBits\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeBase\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgBlockTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgProofTime\",\"type\":\"uint64\"}],\"internalType\":\"structLibUtils.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getUncleProofDelay\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"toHalt\",\"type\":\"bool\"}],\"name\":\"halt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_feeBase\",\"type\":\"uint256\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"isBlockVerifiable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"commitSlot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"isCommitValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isHalted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proposeBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlockInvalid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signWithGoldenTouch\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedA1\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"statusBits\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeBase\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgBlockTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__avgGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgProofTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedC1\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxBlocks\",\"type\":\"uint256\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" +const TaikoL1ABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"BlockCommitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"halted\",\"type\":\"bool\"}],\"name\":\"Halted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"commitBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockHashHistory\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zkProofsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxProofsPerForkChoice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTransactionsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBytesPerTxList\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"anchorTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"slotSmoothingFactor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardBurnBips\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerDepositPctg\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBaseMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"rewardMultiplierPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeGracePeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeMaxPeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"bootstrapDiscountHalvingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"initialUncleDelay\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enableTokenomics\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enablePublicInputsCheck\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableAnchorValidation\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableOracleProver\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"address[]\",\"name\":\"provers\",\"type\":\"address[]\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"name\":\"getProofReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getProposedBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.ProposedBlock\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"statusBits\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeBase\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgBlockTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgProofTime\",\"type\":\"uint64\"}],\"internalType\":\"structLibUtils.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getUncleProofDelay\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"toHalt\",\"type\":\"bool\"}],\"name\":\"halt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_feeBase\",\"type\":\"uint256\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"isBlockVerifiable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"commitSlot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"isCommitValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isHalted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proposeBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlockInvalid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signWithGoldenTouch\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedA1\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"statusBits\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeBase\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgBlockTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__avgGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgProofTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedC1\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxBlocks\",\"type\":\"uint256\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // TaikoL1 is an auto generated Go binding around an Ethereum contract. type TaikoL1 struct { diff --git a/packages/relayer/contracts/taikol2/TaikoL2.go b/packages/relayer/contracts/taikol2/TaikoL2.go index 180eeeea62b..05dc8311c1c 100644 --- a/packages/relayer/contracts/taikol2/TaikoL2.go +++ b/packages/relayer/contracts/taikol2/TaikoL2.go @@ -55,11 +55,11 @@ type TaikoDataConfig struct { InitialUncleDelay uint64 EnableTokenomics bool EnablePublicInputsCheck bool - EnableProofValidation bool + enableAnchorValidation bool } // TaikoL2ABI is the input ABI used to generate the binding from. -const TaikoL2ABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"}],\"name\":\"BlockInvalidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockHashHistory\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zkProofsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxProofsPerForkChoice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTransactionsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBytesPerTxList\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"anchorTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feePremiumLamda\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardBurnBips\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerDepositPctg\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBaseMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"rewardMultiplierPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeGracePeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeMaxPeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"bootstrapDiscountHalvingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"initialUncleDelay\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enableTokenomics\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enablePublicInputsCheck\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableProofValidation\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"},{\"internalType\":\"enumLibInvalidTxList.Reason\",\"name\":\"hint\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"txIdx\",\"type\":\"uint256\"}],\"name\":\"invalidateBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" +const TaikoL2ABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"}],\"name\":\"BlockInvalidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockHashHistory\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zkProofsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxProofsPerForkChoice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTransactionsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBytesPerTxList\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"anchorTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feePremiumLamda\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardBurnBips\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerDepositPctg\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBaseMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"rewardMultiplierPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeGracePeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeMaxPeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"bootstrapDiscountHalvingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"initialUncleDelay\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enableTokenomics\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enablePublicInputsCheck\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableAnchorValidation\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"},{\"internalType\":\"enumLibInvalidTxList.Reason\",\"name\":\"hint\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"txIdx\",\"type\":\"uint256\"}],\"name\":\"invalidateBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" // TaikoL2 is an auto generated Go binding around an Ethereum contract. type TaikoL2 struct { diff --git a/packages/status-page/src/constants/abi/TaikoL1.ts b/packages/status-page/src/constants/abi/TaikoL1.ts index 4eca5b67bf6..807baeafe70 100644 --- a/packages/status-page/src/constants/abi/TaikoL1.ts +++ b/packages/status-page/src/constants/abi/TaikoL1.ts @@ -419,7 +419,7 @@ export default [ }, { internalType: "bool", - name: "enableProofValidation", + name: "enableAnchorValidation", type: "bool", }, { diff --git a/packages/website/pages/docs/reference/contract-documentation/L1/TaikoData.md b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoData.md index 88940f827dd..1e78e0fefd7 100644 --- a/packages/website/pages/docs/reference/contract-documentation/L1/TaikoData.md +++ b/packages/website/pages/docs/reference/contract-documentation/L1/TaikoData.md @@ -35,7 +35,7 @@ struct Config { uint64 initialUncleDelay; bool enableTokenomics; bool enablePublicInputsCheck; - bool enableProofValidation; + bool enableAnchorValidation; bool enableOracleProver; } ```