Skip to content

Commit

Permalink
Merge branch 'pacaya_fork' into add-solver-support-l2-to-l1-erc20-bri…
Browse files Browse the repository at this point in the history
…dging
  • Loading branch information
dantaik authored Dec 23, 2024
2 parents 08d1f17 + 65041c8 commit 5c1e029
Show file tree
Hide file tree
Showing 28 changed files with 330 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/eventindexer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: go test `go list ./... | grep -v ./contracts | grep -v ./mock | grep -v ./cmd` -coverprofile=coverage.txt -covermode=atomic

- name: eventindexer - Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./packages/eventindexer/coverage.txt
flags: eventindexer
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/guardian-prover-health-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: go test `go list ./... | grep -v ./contracts | grep -v ./mock | grep -v ./cmd` -coverprofile=coverage.txt -covermode=atomic

- name: guardian-prover-health-check - Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./packages/guardian-prover-health-check/coverage.txt
flags: guardian-prover-health-check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/relayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: go test `go list ./... | grep -v ./contracts | grep -v ./mock | grep -v ./cmd` -coverprofile=coverage.txt -covermode=atomic

- name: relayer - Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./packages/relayer/coverage.txt
flags: relayer
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/taiko-client--test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ jobs:
run: make test

- name: Codecov.io
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: packages/taiko-client/coverage.out
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages/bridge-ui": "2.12.0",
"packages/bridge-ui": "2.13.0",
"packages/docs-site": "1.20.3",
"packages/eventindexer": "0.13.0",
"packages/fork-diff": "0.6.1",
Expand All @@ -9,7 +9,7 @@
"packages/relayer": "0.12.0",
"packages/snaefell-ui": "1.1.0",
"packages/supplementary-contracts": "1.0.0",
"packages/taiko-client": "0.39.2",
"packages/taiko-client": "0.40.0",
"packages/taikoon-ui": "1.3.0",
"packages/ui-lib": "1.0.0"
}
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ require (
github.com/gorilla/websocket v1.5.3
github.com/joho/godotenv v1.5.1
github.com/labstack/echo-contrib v0.17.1
github.com/labstack/echo/v4 v4.13.2
github.com/labstack/echo/v4 v4.13.3
github.com/labstack/gommon v0.4.2
github.com/modern-go/reflect2 v1.0.2
github.com/morkid/paginate v1.1.8
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
github.com/pkg/errors v0.9.1
github.com/pressly/goose/v3 v3.23.0
github.com/pressly/goose/v3 v3.24.0
github.com/prometheus/client_golang v1.20.5
github.com/prysmaticlabs/prysm/v5 v5.1.2
github.com/prysmaticlabs/prysm/v5 v5.2.0
github.com/rabbitmq/amqp091-go v1.10.0
github.com/shopspring/decimal v1.4.0
github.com/stretchr/testify v1.10.0
Expand Down Expand Up @@ -206,7 +206,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ github.com/labstack/echo-contrib v0.17.1 h1:7I/he7ylVKsDUieaGRZ9XxxTYOjfQwVzHzUY
github.com/labstack/echo-contrib v0.17.1/go.mod h1:SnsCZtwHBAZm5uBSAtQtXQHI3wqEA73hvTn0bYMKnZA=
github.com/labstack/echo/v4 v4.0.0/go.mod h1:tZv7nai5buKSg5h/8E6zz4LsD/Dqh9/91Mvs7Z5Zyno=
github.com/labstack/echo/v4 v4.1.15/go.mod h1:GWO5IBVzI371K8XJe50CSvHjQCafK6cw8R/moLhEU6o=
github.com/labstack/echo/v4 v4.13.2 h1:9aAt4hstpH54qIcqkuUXRLTf+v7yOTfMPWzDtuqLmtA=
github.com/labstack/echo/v4 v4.13.2/go.mod h1:uc9gDtHB8UWt3FfbYx0HyxcCuvR4YuPYOxF/1QjoV/c=
github.com/labstack/echo/v4 v4.13.3 h1:pwhpCPrTl5qry5HRdM5FwdXnhXSLSY+WE+YQSeCaafY=
github.com/labstack/echo/v4 v4.13.3/go.mod h1:o90YNEeQWjDozo584l7AwhJMHN0bOC4tAfg+Xox9q5g=
github.com/labstack/gommon v0.2.8/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4=
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
Expand Down Expand Up @@ -424,8 +424,8 @@ github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGA
github.com/microcosm-cc/bluemonday v1.0.4/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w=
github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58=
github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs=
github.com/microsoft/go-mssqldb v1.7.2 h1:CHkFJiObW7ItKTJfHo1QX7QBBD1iV+mn1eOyRP3b/PA=
github.com/microsoft/go-mssqldb v1.7.2/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA=
github.com/microsoft/go-mssqldb v1.8.0 h1:7cyZ/AT7ycDsEoWPIXibd+aVKFtteUNhDGf3aobP+tw=
github.com/microsoft/go-mssqldb v1.8.0/go.mod h1:6znkekS3T2vp0waiMhen4GPU1BiAsrP+iXHcE7a7rFo=
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
Expand Down Expand Up @@ -510,8 +510,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/pressly/goose/v3 v3.23.0 h1:57hqKos8izGek4v6D5+OXBa+Y4Rq8MU//+MmnevdpVA=
github.com/pressly/goose/v3 v3.23.0/go.mod h1:rpx+D9GX/+stXmzKa+uh1DkjPnNVMdiOCV9iLdle4N8=
github.com/pressly/goose/v3 v3.24.0 h1:sFbNms7Bd++2VMq6HSgDHDLWa7kHz1qXzPb3ZIU72VU=
github.com/pressly/goose/v3 v3.24.0/go.mod h1:rEWreU9uVtt0DHCyLzF9gRcWiiTF/V+528DV+4DORug=
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
Expand All @@ -529,8 +529,8 @@ github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b h1
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b/go.mod h1:HRuvtXLZ4WkaB1MItToVH2e8ZwKwZPY5/Rcby+CvvLY=
github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294 h1:q9wE0ZZRdTUAAeyFP/w0SwBEnCqlVy2+on6X2/e+eAU=
github.com/prysmaticlabs/protoc-gen-go-cast v0.0.0-20230228205207-28762a7b9294/go.mod h1:ZVEbRdnMkGhp/pu35zq4SXxtvUwWK0J1MATtekZpH2Y=
github.com/prysmaticlabs/prysm/v5 v5.1.2 h1:ib9D7Drh7QPoetJPnYXAHaArmjIreXPZ0FboW9EMzT8=
github.com/prysmaticlabs/prysm/v5 v5.1.2/go.mod h1:ykj3Bl9dHv35cC7fRw6Cd1aCd9l+eNvInHY6gsPbEig=
github.com/prysmaticlabs/prysm/v5 v5.2.0 h1:JqKKK5aqehZN9GiSOSSw4M57NpbvG0nIxqFK5KpPnRw=
github.com/prysmaticlabs/prysm/v5 v5.2.0/go.mod h1:cQc+NIMKaHjPvY566HsYcuni763nzuUWnDsDbk45bbs=
github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
Expand Down Expand Up @@ -716,8 +716,8 @@ golang.org/x/net v0.0.0-20220906165146-f3363e06e74c/go.mod h1:YDH+HFinaLZZlnHAfS
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
Expand Down
28 changes: 28 additions & 0 deletions packages/bridge-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## [2.13.0](https://github.com/taikoxyz/taiko-mono/compare/bridge-ui-v2.12.0...bridge-ui-v2.13.0) (2024-12-17)


### Features

* **bridge-ui:** add curve ([#18549](https://github.com/taikoxyz/taiko-mono/issues/18549)) ([fd6feef](https://github.com/taikoxyz/taiko-mono/commit/fd6feef545c2432eea8e71c68dc3f3964fe65c17))
* **bridge-ui:** add padding when claiming to smart contract ([#18141](https://github.com/taikoxyz/taiko-mono/issues/18141)) ([ce5d485](https://github.com/taikoxyz/taiko-mono/commit/ce5d4859a77631ec406ccb5d571efcd91e5fd2f8))
* **bridge-ui:** more detailed transactions view ([#17899](https://github.com/taikoxyz/taiko-mono/issues/17899)) ([6fe7c44](https://github.com/taikoxyz/taiko-mono/commit/6fe7c447b7c9c13b5868c65c69a9ddfeb968901a))
* **bridge-ui:** remove fee padding ([#18546](https://github.com/taikoxyz/taiko-mono/issues/18546)) ([3966bb1](https://github.com/taikoxyz/taiko-mono/commit/3966bb1cea358923284de74b81e3ce512b8291dd))


### Bug Fixes

* **bridge-ui:** balance visually not updating correctly when switching chains ([#17832](https://github.com/taikoxyz/taiko-mono/issues/17832)) ([f495e40](https://github.com/taikoxyz/taiko-mono/commit/f495e406633fc9349e8d3a125c463c0be1e15b66))
* **bridge-ui:** increase pagesize ([#17886](https://github.com/taikoxyz/taiko-mono/issues/17886)) ([9e38a33](https://github.com/taikoxyz/taiko-mono/commit/9e38a33cd361dc6bd2e2e77a8017151eb08400f3))


### Workflow

* **protocol:** trigger patch release (1.10.1) ([#18358](https://github.com/taikoxyz/taiko-mono/issues/18358)) ([f4f4796](https://github.com/taikoxyz/taiko-mono/commit/f4f4796488059b02c79d6fb15170df58dd31dc4e))


### Build

* **deps-dev:** bump @sveltejs/kit from 2.5.7 to 2.5.21 ([#17901](https://github.com/taikoxyz/taiko-mono/issues/17901)) ([7a32ac4](https://github.com/taikoxyz/taiko-mono/commit/7a32ac40a654521c82cb3ff5b6f5af87d0a915a4))
* **deps:** bump github.com/stretchr/testify from 1.9.0 to 1.10.0 ([#18539](https://github.com/taikoxyz/taiko-mono/issues/18539)) ([79f3fab](https://github.com/taikoxyz/taiko-mono/commit/79f3fab5f1d1ec1bb4ee18afb9268b622e894780))
* **deps:** bump golang.org/x/sync from 0.9.0 to 0.10.0 ([#18560](https://github.com/taikoxyz/taiko-mono/issues/18560)) ([3d51970](https://github.com/taikoxyz/taiko-mono/commit/3d51970aa0953bbfecaeebf76ea7e664c875c0e4))

## [2.12.0](https://github.com/taikoxyz/taiko-mono/compare/bridge-ui-v2.11.0...bridge-ui-v2.12.0) (2024-07-18)


Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bridge-ui",
"version": "2.12.0",
"version": "2.13.0",
"private": true,
"scripts": {
"dev": "vite dev",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ description: Network reference page describing various important addresses on Ta
| ------------------------------- | -------------------------------------------- | -------------------------- |
| TaikoL1 | `0x06a9Ab27c7e2255df1815E6CC0168d7755Feb19a` | based.taiko.eth |
| RollupAddressManager | `0x579f40D0BE111b823962043702cabe6Aaa290780` | ram.based.taiko.eth |
| TierRouter | `0x394E30d83d020469a1F8b16E89D7fD5FdB1935b0` | N/A |
| TierRouter | `0x8a4c692F12d3a9750E744A4CE24a1d351bE52E66` | N/A |
| GuardianProver | `0xE3D777143Ea25A6E031d1e921F396750885f43aC` | guardians.based.taiko.eth |
| GuardianProverMinority | `0x579A8d63a2Db646284CBFE31FE5082c9989E985c` | guardians1.based.taiko.eth |
| AssignmentHook | `0x537a2f0D3a5879b41BCb5A2afE2EA5c4961796F6` | N/A |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can find all the corresponding values below in the [deployed TierProviderBas

## Tier configuration (Mainnet)

You can view the full `MainnetTierRouter` tier configuration [here](https://etherscan.io/address/0x394E30d83d020469a1F8b16E89D7fD5FdB1935b0#code):
You can view the full `MainnetTierRouter` tier configuration [here](https://etherscan.io/address/0x8a4c692F12d3a9750E744A4CE24a1d351bE52E66#code):

![mainnet proof tiers](~/assets/content/docs/network-reference/proof-tier-config-mn.webp)

Expand Down
10 changes: 9 additions & 1 deletion packages/protocol/contracts/layer1/based/TaikoInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.24;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "src/shared/common/EssentialContract.sol";
import "src/shared/based/ITaiko.sol";
import "src/shared/libs/LibAddress.sol";
import "src/shared/libs/LibMath.sol";
import "src/shared/libs/LibNetwork.sol";
Expand All @@ -24,7 +25,7 @@ import "./ITaikoInbox.sol";
///
/// @dev Registered in the address resolver as "taiko".
/// @custom:security-contact security@taiko.xyz
abstract contract TaikoInbox is EssentialContract, ITaikoInbox {
abstract contract TaikoInbox is EssentialContract, ITaikoInbox, ITaiko {
using LibMath for uint256;

State public state; // storage layout much match Ontake fork
Expand Down Expand Up @@ -364,6 +365,13 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox {
require(blk_.blockId == _blockId, BlockNotFound());
}

/// @notice Determines the operational layer of the contract, whether it is on Layer 1 (L1) or
/// Layer 2 (L2).
/// @return True if the contract is operating on L1, false if on L2.
function isOnL1() external pure override returns (bool) {
return true;
}

// Public functions -------------------------------------------------------------------------

/// @inheritdoc EssentialContract
Expand Down
25 changes: 8 additions & 17 deletions packages/protocol/contracts/layer1/provers/ProverSet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,30 +94,21 @@ contract ProverSet is EssentialContract, IERC1271 {
LibAddress.sendEtherAndVerify(admin, _amount);
}

/// @notice Proposes a batch blocks only when it is the first batch blocks proposal in the
/// current L1 block.
function proposeBlocksV3Conditionally(
ITaikoInbox.BlockParamsV3[] calldata _paramsArray,
bytes calldata _txList
)
external
onlyProver
{
ITaikoInbox taiko = ITaikoInbox(inbox());
// Ensure this block is the first block proposed in the current L1 block.
require(taiko.getStats2().lastProposedIn != block.number, NOT_FIRST_PROPOSAL());
taiko.proposeBlocksV3(address(0), address(0), _paramsArray, _txList);
}

/// @notice Propose multiple Taiko blocks.
function proposeBlocksV3(
ITaikoInbox.BlockParamsV3[] calldata _paramsArray,
bytes calldata _txList
bytes calldata _txList,
bool _revertIfNotFirstProposal
)
external
onlyProver
{
ITaikoInbox(inbox()).proposeBlocksV3(address(0), address(0), _paramsArray, _txList);
ITaikoInbox taiko = ITaikoInbox(inbox());
if (_revertIfNotFirstProposal) {
// Ensure this block is the first block proposed in the current L1 block.
require(taiko.getStats2().lastProposedIn != block.number, NOT_FIRST_PROPOSAL());
}
taiko.proposeBlocksV3(address(0), address(0), _paramsArray, _txList);
}

/// @notice Batch proves or contests Taiko blocks.
Expand Down
8 changes: 8 additions & 0 deletions packages/protocol/contracts/layer2/based/TaikoAnchor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "src/shared/common/EssentialContract.sol";
import "src/shared/based/ITaiko.sol";
import "src/shared/libs/LibStrings.sol";
import "src/shared/libs/LibAddress.sol";
import "src/shared/libs/LibMath.sol";
Expand Down Expand Up @@ -239,6 +240,13 @@ contract TaikoAnchor is EssentialContract, IBlockHashProvider, TaikoAnchorDeprec
return _blockhashes[_blockId];
}

/// @notice Determines the operational layer of the contract, whether it is on Layer 1 (L1) or
/// Layer 2 (L2).
/// @return True if the contract is operating on L1, false if on L2.
function isOnL1() external pure returns (bool) {
return false;
}

/// @notice Tells if we need to validate basefee (for simulation).
/// @return Returns true to skip checking basefee mismatch.
function skipFeeCheck() public pure virtual returns (bool) {
Expand Down
13 changes: 13 additions & 0 deletions packages/protocol/contracts/shared/based/ITaiko.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @title ITaiko
/// @notice This interface is used for contracts identified by the "taiko" label in the address
/// resolver, specifically the TaikoInbox and TaikoAnchor contracts.
/// @custom:security-contact security@taiko.xyz
interface ITaiko {
/// @notice Determines the operational layer of the contract, whether it is on Layer 1 (L1) or
/// Layer 2 (L2).
/// @return True if the contract is operating on L1, false if on L2.
function isOnL1() external pure returns (bool);
}
29 changes: 29 additions & 0 deletions packages/protocol/test/layer1/based/InboxTest_Suite1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,35 @@ contract InboxTest_Suite1 is InboxTestBase {
_logAllBlocksAndTransitions();
}

function test_proposeBlocksV3_reverts_for_invalid_proposer_and_preconfRouter()
external
transactBy(Alice)
{
uint64 count = 1;

vm.expectRevert(ITaikoInbox.CustomProposerNotAllowed.selector);
inbox.proposeBlocksV3(Alice, address(0), new ITaikoInbox.BlockParamsV3[](count), "txList");

vm.startPrank(deployer);
address preconfRouter = Bob;
resolver.registerAddress(block.chainid, "preconf_router", preconfRouter);
vm.stopPrank();

vm.startPrank(Alice);
vm.expectRevert(ITaikoInbox.NotPreconfRouter.selector);
inbox.proposeBlocksV3(
preconfRouter, address(0), new ITaikoInbox.BlockParamsV3[](count), "txList"
);
vm.stopPrank();

vm.startPrank(preconfRouter);
vm.expectRevert(ITaikoInbox.CustomProposerMissing.selector);
inbox.proposeBlocksV3(
address(0), address(0), new ITaikoInbox.BlockParamsV3[](count), "txList"
);
vm.stopPrank();
}

function test_inbox_measure_gas_used()
external
transactBy(Alice)
Expand Down
Loading

0 comments on commit 5c1e029

Please sign in to comment.