diff --git a/.github/workflows/guardian-prover-health-check-ui.yml b/.github/workflows/guardian-prover-health-check-ui.yml index 69b91f2a79e..f95cd350ad4 100644 --- a/.github/workflows/guardian-prover-health-check-ui.yml +++ b/.github/workflows/guardian-prover-health-check-ui.yml @@ -29,8 +29,6 @@ jobs: # vercel_org_id: ${{ secrets.VERCEL_ORG_ID }} # vercel_token: ${{ secrets.VERCEL_TOKEN }} - - deploy_guardians-ui_hekla_preview: if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} needs: build-and-test diff --git a/.github/workflows/taiko-client--pages.yml b/.github/workflows/taiko-client--pages.yml new file mode 100644 index 00000000000..997b2ed7c73 --- /dev/null +++ b/.github/workflows/taiko-client--pages.yml @@ -0,0 +1,60 @@ +name: "Taiko Client Github Pages" + +on: + push: + branches: [main] + paths: + - "packages/taiko-client/**" + +jobs: + swagger-gen: + runs-on: [arc-runner-set] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.23" + + - name: Install swaggo + run: | + export CGO_ENABLED=0 + go install github.com/swaggo/swag/cmd/swag@latest + + - name: Generate Swagger documentation + run: | + export CGO_ENABLED=0 + cd packages/taiko-client + ./scripts/gen_swagger_json.sh + + - name: Commit Swagger docs + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add . + if ! git diff --quiet; then + git commit -m "Update Swagger documentation" + git push origin HEAD:${{ github.ref_name }} + else + echo "No changes to commit" + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + deploy: + runs-on: [arc-runner-set] + needs: swagger-gen + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: packages/taiko-client/docs # Set this to where your `index.html` is located + publish_branch: gh-pages + destination_dir: soft-block-apis diff --git a/go.mod b/go.mod index b7e01be7c1d..40eb12ac0f0 100644 --- a/go.mod +++ b/go.mod @@ -21,6 +21,7 @@ require ( github.com/gorilla/websocket v1.5.3 github.com/joho/godotenv v1.5.1 github.com/labstack/echo-contrib v0.17.2 + github.com/labstack/echo-jwt/v4 v4.3.0 github.com/labstack/echo/v4 v4.13.3 github.com/labstack/gommon v0.4.2 github.com/modern-go/reflect2 v1.0.2 @@ -113,6 +114,7 @@ require ( github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.1 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -232,7 +234,7 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -replace github.com/ethereum/go-ethereum v1.14.11 => github.com/taikoxyz/taiko-geth v1.11.1 +replace github.com/ethereum/go-ethereum v1.14.11 => github.com/taikoxyz/taiko-geth v1.11.2-0.20241117065921-51d42ec9f39f replace github.com/ethereum-optimism/optimism v1.7.4 => github.com/taikoxyz/optimism v0.0.0-20241003061504-cdf8af288f39 diff --git a/go.sum b/go.sum index 2ac34714762..968b63e00d3 100644 --- a/go.sum +++ b/go.sum @@ -247,6 +247,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo= github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= @@ -373,6 +375,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/labstack/echo-jwt/v4 v4.3.0 h1:8JcvVCrK9dRkPx/aWY3ZempZLO336Bebh4oAtBcxAv4= +github.com/labstack/echo-jwt/v4 v4.3.0/go.mod h1:OlWm3wqfnq3Ma8DLmmH7GiEAz2S7Bj23im2iPMEAR+Q= github.com/labstack/echo-contrib v0.17.2 h1:K1zivqmtcC70X9VdBFdLomjPDEVHlrcAObqmuFj1c6w= github.com/labstack/echo-contrib v0.17.2/go.mod h1:NeDh3PX7j/u+jR4iuDt1zHmWZSCz9c/p9mxXcDpyS8E= github.com/labstack/echo/v4 v4.0.0/go.mod h1:tZv7nai5buKSg5h/8E6zz4LsD/Dqh9/91Mvs7Z5Zyno= @@ -599,8 +603,8 @@ github.com/taikoxyz/hive v0.0.0-20240827015317-405b241dd082 h1:ymZR+Y88LOnA8i3Ke github.com/taikoxyz/hive v0.0.0-20240827015317-405b241dd082/go.mod h1:RHnIu3EFehrWX3JhFAMQSXD5uz7l0xaNroTzXrap7EQ= github.com/taikoxyz/optimism v0.0.0-20241003061504-cdf8af288f39 h1:JssMxaDmORjQ9RPZNulVJhAD8zSPd6LZFq5wsr6Nwz8= github.com/taikoxyz/optimism v0.0.0-20241003061504-cdf8af288f39/go.mod h1:ym7scR7ZHvEmwx1DLGVDzFlAdR+uhP1+Z4XCiFuSD5s= -github.com/taikoxyz/taiko-geth v1.11.1 h1:pur1WP6YJkwKhLVeN3Zf7dOwbPq6tS88gYod6QKlJc4= -github.com/taikoxyz/taiko-geth v1.11.1/go.mod h1:+l/fr42Mma+xBnhefL/+z11/hcmJ2egl+ScIVPjhc7E= +github.com/taikoxyz/taiko-geth v1.11.2-0.20241117065921-51d42ec9f39f h1:Jccr7lSc98y4YeXRT0Tb601nMDxFYUFm4wrVKZILcmA= +github.com/taikoxyz/taiko-geth v1.11.2-0.20241117065921-51d42ec9f39f/go.mod h1:+l/fr42Mma+xBnhefL/+z11/hcmJ2egl+ScIVPjhc7E= github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybuB4GY8G2HHgCkbMzMHo= github.com/testcontainers/testcontainers-go v0.34.0/go.mod h1:6P/kMkQe8yqPHfPWNulFGdFHTD8HB2vLq/231xY2iPQ= github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e h1:cR8/SYRgyQCt5cNCMniB/ZScMkhI9nk8U5C7SbISXjo= diff --git a/packages/protocol/contract_layout_layer1.md b/packages/protocol/contract_layout_layer1.md index 45bda27324b..c5392a2e241 100644 --- a/packages/protocol/contract_layout_layer1.md +++ b/packages/protocol/contract_layout_layer1.md @@ -1,1043 +1,1019 @@ ## ERC1155Vault ╭--------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | | -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | | -| __gap | uint256[48] | 303 | 0 | 1536 | +| **gap | uint256[48] | 303 | 0 | 1536 | | -| __gap | uint256[50] | 351 | 0 | 1600 | +| **gap | uint256[50] | 351 | 0 | 1600 | | -| __gap | uint256[50] | 401 | 0 | 1600 | +| **gap | uint256[50] | 401 | 0 | 1600 | | -| __gap | uint256[50] | 451 | 0 | 1600 | +| \_\_gap | uint256[50] | 451 | 0 | 1600 | ╰--------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - ## ERC20Vault ╭--------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | +| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | | -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | | -| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | | -| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | | -| __gap | uint256[46] | 305 | 0 | 1472 | +| **gap | uint256[46] | 305 | 0 | 1472 | ╰--------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╯ - ## ERC721Vault ╭--------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | | -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | | -| __gap | uint256[48] | 303 | 0 | 1536 | +| **gap | uint256[48] | 303 | 0 | 1536 | | -| __gap | uint256[50] | 351 | 0 | 1600 | +| \_\_gap | uint256[50] | 351 | 0 | 1600 | ╰--------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯ - ## BridgedERC20 ╭------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| _balances | mapping(address => uint256) | 251 | 0 | 32 | +| \_balances | mapping(address => uint256) | 251 | 0 | 32 | | -| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| \_allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | | -| _totalSupply | uint256 | 253 | 0 | 32 | +| \_totalSupply | uint256 | 253 | 0 | 32 | | -| _name | string | 254 | 0 | 32 | +| \_name | string | 254 | 0 | 32 | | -| _symbol | string | 255 | 0 | 32 | +| \_symbol | string | 255 | 0 | 32 | | -| __gap | uint256[45] | 256 | 0 | 1440 | +| **gap | uint256[45] | 256 | 0 | 1440 | | -| srcToken | address | 301 | 0 | 20 | +| srcToken | address | 301 | 0 | 20 | | -| __srcDecimals | uint8 | 301 | 20 | 1 | +| **srcDecimals | uint8 | 301 | 20 | 1 | | -| srcChainId | uint256 | 302 | 0 | 32 | +| srcChainId | uint256 | 302 | 0 | 32 | | -| migratingAddress | address | 303 | 0 | 20 | +| migratingAddress | address | 303 | 0 | 20 | | -| migratingInbound | bool | 303 | 20 | 1 | +| migratingInbound | bool | 303 | 20 | 1 | | -| __gap | uint256[47] | 304 | 0 | 1504 | +| \_\_gap | uint256[47] | 304 | 0 | 1504 | ╰------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - ## BridgedERC20V2 ╭------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| _balances | mapping(address => uint256) | 251 | 0 | 32 | +| \_balances | mapping(address => uint256) | 251 | 0 | 32 | | -| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| \_allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | | -| _totalSupply | uint256 | 253 | 0 | 32 | +| \_totalSupply | uint256 | 253 | 0 | 32 | | -| _name | string | 254 | 0 | 32 | +| \_name | string | 254 | 0 | 32 | | -| _symbol | string | 255 | 0 | 32 | +| \_symbol | string | 255 | 0 | 32 | | -| __gap | uint256[45] | 256 | 0 | 1440 | +| **gap | uint256[45] | 256 | 0 | 1440 | | -| srcToken | address | 301 | 0 | 20 | +| srcToken | address | 301 | 0 | 20 | | -| __srcDecimals | uint8 | 301 | 20 | 1 | +| **srcDecimals | uint8 | 301 | 20 | 1 | | -| srcChainId | uint256 | 302 | 0 | 32 | +| srcChainId | uint256 | 302 | 0 | 32 | | -| migratingAddress | address | 303 | 0 | 20 | +| migratingAddress | address | 303 | 0 | 20 | | -| migratingInbound | bool | 303 | 20 | 1 | +| migratingInbound | bool | 303 | 20 | 1 | | -| __gap | uint256[47] | 304 | 0 | 1504 | +| **gap | uint256[47] | 304 | 0 | 1504 | | -| _hashedName | bytes32 | 351 | 0 | 32 | +| \_hashedName | bytes32 | 351 | 0 | 32 | | -| _hashedVersion | bytes32 | 352 | 0 | 32 | +| \_hashedVersion | bytes32 | 352 | 0 | 32 | | -| _name | string | 353 | 0 | 32 | +| \_name | string | 353 | 0 | 32 | | -| _version | string | 354 | 0 | 32 | +| \_version | string | 354 | 0 | 32 | | -| __gap | uint256[48] | 355 | 0 | 1536 | +| **gap | uint256[48] | 355 | 0 | 1536 | | -| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| \_nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | | -| __gap | uint256[49] | 404 | 0 | 1568 | +| \_\_gap | uint256[49] | 404 | 0 | 1568 | ╰------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ - ## BridgedERC721 ╭--------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| _name | string | 301 | 0 | 32 | +| \_name | string | 301 | 0 | 32 | | -| _symbol | string | 302 | 0 | 32 | +| \_symbol | string | 302 | 0 | 32 | | -| _owners | mapping(uint256 => address) | 303 | 0 | 32 | +| \_owners | mapping(uint256 => address) | 303 | 0 | 32 | | -| _balances | mapping(address => uint256) | 304 | 0 | 32 | +| \_balances | mapping(address => uint256) | 304 | 0 | 32 | | -| _tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | +| \_tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | | -| _operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | +| \_operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | | -| __gap | uint256[44] | 307 | 0 | 1408 | +| **gap | uint256[44] | 307 | 0 | 1408 | | -| srcToken | address | 351 | 0 | 20 | +| srcToken | address | 351 | 0 | 20 | | -| srcChainId | uint256 | 352 | 0 | 32 | +| srcChainId | uint256 | 352 | 0 | 32 | | -| __gap | uint256[48] | 353 | 0 | 1536 | +| \_\_gap | uint256[48] | 353 | 0 | 1536 | ╰--------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ - ## BridgedERC1155 ╭--------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| _balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | +| \_balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | | -| _operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | +| \_operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | | -| _uri | string | 303 | 0 | 32 | +| \_uri | string | 303 | 0 | 32 | | -| __gap | uint256[47] | 304 | 0 | 1504 | +| **gap | uint256[47] | 304 | 0 | 1504 | | -| srcToken | address | 351 | 0 | 20 | +| srcToken | address | 351 | 0 | 20 | | -| srcChainId | uint256 | 352 | 0 | 32 | +| srcChainId | uint256 | 352 | 0 | 32 | | -| symbol | string | 353 | 0 | 32 | +| symbol | string | 353 | 0 | 32 | | -| name | string | 354 | 0 | 32 | +| name | string | 354 | 0 | 32 | | -| __gap | uint256[46] | 355 | 0 | 1472 | +| \_\_gap | uint256[46] | 355 | 0 | 1472 | ╰--------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ - ## Bridge ╭------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __reserved1 | uint64 | 251 | 0 | 8 | +| **reserved1 | uint64 | 251 | 0 | 8 | | -| nextMessageId | uint64 | 251 | 8 | 8 | +| nextMessageId | uint64 | 251 | 8 | 8 | | -| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | +| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | | -| __ctx | struct IBridge.Context | 253 | 0 | 64 | +| **ctx | struct IBridge.Context | 253 | 0 | 64 | | -| __reserved2 | uint256 | 255 | 0 | 32 | +| **reserved2 | uint256 | 255 | 0 | 32 | | -| __reserved3 | uint256 | 256 | 0 | 32 | +| **reserved3 | uint256 | 256 | 0 | 32 | | -| __gap | uint256[44] | 257 | 0 | 1408 | +| \_\_gap | uint256[44] | 257 | 0 | 1408 | ╰------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╯ - ## QuotaManager ╭------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | +| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | | -| quotaPeriod | uint24 | 252 | 0 | 3 | +| quotaPeriod | uint24 | 252 | 0 | 3 | | -| __gap | uint256[48] | 253 | 0 | 1536 | +| \_\_gap | uint256[48] | 253 | 0 | 1536 | ╰------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╯ - ## AddressManager ╭------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | +| **addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | | -| __gap | uint256[49] | 252 | 0 | 1568 | +| **gap | uint256[49] | 252 | 0 | 1568 | ╰------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - ## AddressResolver ╭----------------+-------------+------+--------+-------+-------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +====================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| addressManager | address | 0 | 2 | 20 | +| addressManager | address | 0 | 2 | 20 | | -| __gap | uint256[49] | 1 | 0 | 1568 | +| \_\_gap | uint256[49] | 1 | 0 | 1568 | ╰----------------+-------------+------+--------+-------+-------------------------------------------------------------╯ - ## EssentialContract ╭------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==========================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | ╰------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ - ## SignalService ╭------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +====================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | +| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | | -| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | +| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | | -| __gap | uint256[48] | 253 | 0 | 1536 | +| \_\_gap | uint256[48] | 253 | 0 | 1536 | ╰------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╯ - ## TaikoToken ╭-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +================================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | +| **slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | | -| _balances | mapping(address => uint256) | 301 | 0 | 32 | +| \_balances | mapping(address => uint256) | 301 | 0 | 32 | | -| _allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | +| \_allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | | -| _totalSupply | uint256 | 303 | 0 | 32 | +| \_totalSupply | uint256 | 303 | 0 | 32 | | -| _name | string | 304 | 0 | 32 | +| \_name | string | 304 | 0 | 32 | | -| _symbol | string | 305 | 0 | 32 | +| \_symbol | string | 305 | 0 | 32 | | -| __gap | uint256[45] | 306 | 0 | 1440 | +| **gap | uint256[45] | 306 | 0 | 1440 | | -| _hashedName | bytes32 | 351 | 0 | 32 | +| \_hashedName | bytes32 | 351 | 0 | 32 | | -| _hashedVersion | bytes32 | 352 | 0 | 32 | +| \_hashedVersion | bytes32 | 352 | 0 | 32 | | -| _name | string | 353 | 0 | 32 | +| \_name | string | 353 | 0 | 32 | | -| _version | string | 354 | 0 | 32 | +| \_version | string | 354 | 0 | 32 | | -| __gap | uint256[48] | 355 | 0 | 1536 | +| **gap | uint256[48] | 355 | 0 | 1536 | | -| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| \_nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | | -| _PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | +| \_PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | | -| __gap | uint256[49] | 405 | 0 | 1568 | +| **gap | uint256[49] | 405 | 0 | 1568 | | -| _delegates | mapping(address => address) | 454 | 0 | 32 | +| \_delegates | mapping(address => address) | 454 | 0 | 32 | | -| _checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | +| \_checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | | -| _totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | +| \_totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | | -| __gap | uint256[47] | 457 | 0 | 1504 | +| **gap | uint256[47] | 457 | 0 | 1504 | | -| __gap | uint256[50] | 504 | 0 | 1600 | +| **gap | uint256[50] | 504 | 0 | 1600 | ╰-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+--------------------------------------------------╯ - ## ComposeVerifier ╭------------------+-------------+------+--------+-------+------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| \_\_gap | uint256[50] | 251 | 0 | 1600 | ╰------------------+-------------+------+--------+-------+------------------------------------------------------------------------╯ - ## TeeAnyVerifier ╭------------------+-------------+------+--------+-------+----------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===============================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| __gap | uint256[50] | 301 | 0 | 1600 | +| **gap | uint256[50] | 301 | 0 | 1600 | ╰------------------+-------------+------+--------+-------+----------------------------------------------------------------------╯ - ## ZkAndTeeVerifier ╭------------------+-------------+------+--------+-------+--------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| __gap | uint256[50] | 301 | 0 | 1600 | +| **gap | uint256[50] | 301 | 0 | 1600 | ╰------------------+-------------+------+--------+-------+--------------------------------------------------------------------------╯ - ## ZkAnyVerifier ╭------------------+-------------+------+--------+-------+--------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=============================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| __gap | uint256[50] | 301 | 0 | 1600 | +| **gap | uint256[50] | 301 | 0 | 1600 | ╰------------------+-------------+------+--------+-------+--------------------------------------------------------------------╯ - ## Risc0Verifier ╭------------------+--------------------------+------+--------+-------+------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| isImageTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | +| isImageTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | | -| __gap | uint256[49] | 252 | 0 | 1568 | +| \_\_gap | uint256[49] | 252 | 0 | 1568 | ╰------------------+--------------------------+------+--------+-------+------------------------------------------------------------╯ - ## SP1Verifier ╭------------------+--------------------------+------+--------+-------+--------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==============================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| isProgramTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | +| isProgramTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | | -| __gap | uint256[49] | 252 | 0 | 1568 | +| \_\_gap | uint256[49] | 252 | 0 | 1568 | ╰------------------+--------------------------+------+--------+-------+--------------------------------------------------------╯ - ## SgxVerifier ╭-------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +======================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| nextInstanceId | uint256 | 251 | 0 | 32 | +| nextInstanceId | uint256 | 251 | 0 | 32 | | -| instances | mapping(uint256 => struct SgxVerifier.Instance) | 252 | 0 | 32 | +| instances | mapping(uint256 => struct SgxVerifier.Instance) | 252 | 0 | 32 | | -| addressRegistered | mapping(address => bool) | 253 | 0 | 32 | +| addressRegistered | mapping(address => bool) | 253 | 0 | 32 | | -| __gap | uint256[47] | 254 | 0 | 1504 | +| \_\_gap | uint256[47] | 254 | 0 | 1504 | ╰-------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------╯ - ## AutomataDcapV3Attestation ╭-------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===================================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| sigVerifyLib | contract ISigVerifyLib | 251 | 0 | 20 | +| sigVerifyLib | contract ISigVerifyLib | 251 | 0 | 20 | | -| pemCertLib | contract IPEMCertChainLib | 252 | 0 | 20 | +| pemCertLib | contract IPEMCertChainLib | 252 | 0 | 20 | | -| checkLocalEnclaveReport | bool | 252 | 20 | 1 | +| checkLocalEnclaveReport | bool | 252 | 20 | 1 | | -| trustedUserMrEnclave | mapping(bytes32 => bool) | 253 | 0 | 32 | +| trustedUserMrEnclave | mapping(bytes32 => bool) | 253 | 0 | 32 | | -| trustedUserMrSigner | mapping(bytes32 => bool) | 254 | 0 | 32 | +| trustedUserMrSigner | mapping(bytes32 => bool) | 254 | 0 | 32 | | -| serialNumIsRevoked | mapping(uint256 => mapping(bytes => bool)) | 255 | 0 | 32 | +| serialNumIsRevoked | mapping(uint256 => mapping(bytes => bool)) | 255 | 0 | 32 | | -| tcbInfo | mapping(string => struct TCBInfoStruct.TCBInfo) | 256 | 0 | 32 | +| tcbInfo | mapping(string => struct TCBInfoStruct.TCBInfo) | 256 | 0 | 32 | | -| qeIdentity | struct EnclaveIdStruct.EnclaveId | 257 | 0 | 128 | +| qeIdentity | struct EnclaveIdStruct.EnclaveId | 257 | 0 | 128 | | -| __gap | uint256[39] | 261 | 0 | 1248 | +| \_\_gap | uint256[39] | 261 | 0 | 1248 | ╰-------------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------------------------------------------╯ - ## TaikoL1 ╭------------------+------------------------+------+--------+-------+--------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| state | struct TaikoData.State | 251 | 0 | 1600 | +| state | struct TaikoData.State | 251 | 0 | 1600 | | -| __gap | uint256[50] | 301 | 0 | 1600 | +| \_\_gap | uint256[50] | 301 | 0 | 1600 | ╰------------------+------------------------+------+--------+-------+--------------------------------------------╯ - ## HeklaTaikoL1 ╭------------------+------------------------+------+--------+-------+------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==========================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| state | struct TaikoData.State | 251 | 0 | 1600 | +| state | struct TaikoData.State | 251 | 0 | 1600 | | -| __gap | uint256[50] | 301 | 0 | 1600 | +| \_\_gap | uint256[50] | 301 | 0 | 1600 | ╰------------------+------------------------+------+--------+-------+------------------------------------------------------╯ - ## HeklaTierRouter ╭------+------+------+--------+-------+----------╮ @@ -1045,265 +1021,258 @@ +================================================+ ╰------+------+------+--------+-------+----------╯ - ## MainnetBridge ╭------------------+-----------------------------------------+------+--------+-------+----------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __reserved1 | uint64 | 251 | 0 | 8 | +| **reserved1 | uint64 | 251 | 0 | 8 | | -| nextMessageId | uint64 | 251 | 8 | 8 | +| nextMessageId | uint64 | 251 | 8 | 8 | | -| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | +| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | | -| __ctx | struct IBridge.Context | 253 | 0 | 64 | +| **ctx | struct IBridge.Context | 253 | 0 | 64 | | -| __reserved2 | uint256 | 255 | 0 | 32 | +| **reserved2 | uint256 | 255 | 0 | 32 | | -| __reserved3 | uint256 | 256 | 0 | 32 | +| **reserved3 | uint256 | 256 | 0 | 32 | | -| __gap | uint256[44] | 257 | 0 | 1408 | +| \_\_gap | uint256[44] | 257 | 0 | 1408 | ╰------------------+-----------------------------------------+------+--------+-------+----------------------------------------------------------------------╯ - ## MainnetSignalService ╭------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===============================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | +| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | | -| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | +| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | | -| __gap | uint256[48] | 253 | 0 | 1536 | +| \_\_gap | uint256[48] | 253 | 0 | 1536 | ╰------------------+-----------------------------------------------+------+--------+-------+------------------------------------------------------------------------------------╯ - ## MainnetERC20Vault ╭--------------------+------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | +| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | | -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | | -| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | | -| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | | -| __gap | uint256[46] | 305 | 0 | 1472 | +| **gap | uint256[46] | 305 | 0 | 1472 | ╰--------------------+------------------------------------------------------+------+--------+-------+------------------------------------------------------------------------------╯ - ## MainnetERC1155Vault ╭--------------------+------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +======================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | | -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | | -| __gap | uint256[48] | 303 | 0 | 1536 | +| **gap | uint256[48] | 303 | 0 | 1536 | | -| __gap | uint256[50] | 351 | 0 | 1600 | +| **gap | uint256[50] | 351 | 0 | 1600 | | -| __gap | uint256[50] | 401 | 0 | 1600 | +| **gap | uint256[50] | 401 | 0 | 1600 | | -| __gap | uint256[50] | 451 | 0 | 1600 | +| \_\_gap | uint256[50] | 451 | 0 | 1600 | ╰--------------------+------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------------------╯ - ## MainnetERC721Vault ╭--------------------+------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +====================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | | -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | | -| __gap | uint256[48] | 303 | 0 | 1536 | +| **gap | uint256[48] | 303 | 0 | 1536 | | -| __gap | uint256[50] | 351 | 0 | 1600 | +| \_\_gap | uint256[50] | 351 | 0 | 1600 | ╰--------------------+------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╯ - ## MainnetSharedAddressManager ╭------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===============================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | +| **addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | | -| __gap | uint256[49] | 252 | 0 | 1568 | +| **gap | uint256[49] | 252 | 0 | 1568 | ╰------------------+-------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------------------------╯ - ## RollupAddressCache ╭------+------+------+--------+-------+----------╮ @@ -1311,7 +1280,6 @@ +================================================+ ╰------+------+------+--------+-------+----------╯ - ## SharedAddressCache ╭------+------+------+--------+-------+----------╮ @@ -1319,7 +1287,6 @@ +================================================+ ╰------+------+------+--------+-------+----------╯ - ## AddressCache ╭------+------+------+--------+-------+----------╮ @@ -1327,356 +1294,346 @@ +================================================+ ╰------+------+------+--------+-------+----------╯ - ## MainnetSgxVerifier ╭-------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| nextInstanceId | uint256 | 251 | 0 | 32 | +| nextInstanceId | uint256 | 251 | 0 | 32 | | -| instances | mapping(uint256 => struct SgxVerifier.Instance) | 252 | 0 | 32 | +| instances | mapping(uint256 => struct SgxVerifier.Instance) | 252 | 0 | 32 | | -| addressRegistered | mapping(address => bool) | 253 | 0 | 32 | +| addressRegistered | mapping(address => bool) | 253 | 0 | 32 | | -| __gap | uint256[47] | 254 | 0 | 1504 | +| \_\_gap | uint256[47] | 254 | 0 | 1504 | ╰-------------------+-------------------------------------------------+------+--------+-------+-------------------------------------------------------------------------------------╯ - ## MainnetSP1Verifier ╭------------------+--------------------------+------+--------+-------+-------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| isProgramTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | +| isProgramTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | | -| __gap | uint256[49] | 252 | 0 | 1568 | +| \_\_gap | uint256[49] | 252 | 0 | 1568 | ╰------------------+--------------------------+------+--------+-------+-------------------------------------------------------------------------------------╯ - ## MainnetZkAnyVerifier ╭------------------+-------------+------+--------+-------+-----------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| __gap | uint256[50] | 301 | 0 | 1600 | +| **gap | uint256[50] | 301 | 0 | 1600 | ╰------------------+-------------+------+--------+-------+-----------------------------------------------------------------------------------------╯ - ## MainnetRisc0Verifier ╭------------------+--------------------------+------+--------+-------+-----------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| isImageTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | +| isImageTrusted | mapping(bytes32 => bool) | 251 | 0 | 32 | | -| __gap | uint256[49] | 252 | 0 | 1568 | +| \_\_gap | uint256[49] | 252 | 0 | 1568 | ╰------------------+--------------------------+------+--------+-------+-----------------------------------------------------------------------------------------╯ - ## MainnetZkAndTeeVerifier ╭------------------+-------------+------+--------+-------+-----------------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| __gap | uint256[50] | 301 | 0 | 1600 | +| **gap | uint256[50] | 301 | 0 | 1600 | ╰------------------+-------------+------+--------+-------+-----------------------------------------------------------------------------------------------╯ - ## MainnetTeeAnyVerifier ╭------------------+-------------+------+--------+-------+-------------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +====================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| __gap | uint256[50] | 301 | 0 | 1600 | +| **gap | uint256[50] | 301 | 0 | 1600 | ╰------------------+-------------+------+--------+-------+-------------------------------------------------------------------------------------------╯ - ## MainnetGuardianProver ╭-------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=====================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| guardianIds | mapping(address => uint256) | 251 | 0 | 32 | +| guardianIds | mapping(address => uint256) | 251 | 0 | 32 | | -| approvals | mapping(uint256 => mapping(bytes32 => uint256)) | 252 | 0 | 32 | +| approvals | mapping(uint256 => mapping(bytes32 => uint256)) | 252 | 0 | 32 | | -| guardians | address[] | 253 | 0 | 32 | +| guardians | address[] | 253 | 0 | 32 | | -| version | uint32 | 254 | 0 | 4 | +| version | uint32 | 254 | 0 | 4 | | -| minGuardians | uint32 | 254 | 4 | 4 | +| minGuardians | uint32 | 254 | 4 | 4 | | -| provingAutoPauseEnabled | bool | 254 | 8 | 1 | +| provingAutoPauseEnabled | bool | 254 | 8 | 1 | | -| latestProofHash | mapping(uint256 => mapping(uint256 => bytes32)) | 255 | 0 | 32 | +| latestProofHash | mapping(uint256 => mapping(uint256 => bytes32)) | 255 | 0 | 32 | | -| __gap | uint256[45] | 256 | 0 | 1440 | +| \_\_gap | uint256[45] | 256 | 0 | 1440 | ╰-------------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------╯ - ## MainnetTaikoL1 ╭------------------+------------------------+------+--------+-------+-------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=======================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| state | struct TaikoData.State | 251 | 0 | 1600 | +| state | struct TaikoData.State | 251 | 0 | 1600 | | -| __gap | uint256[50] | 301 | 0 | 1600 | +| \_\_gap | uint256[50] | 301 | 0 | 1600 | ╰------------------+------------------------+------+--------+-------+-------------------------------------------------------------------╯ - ## MainnetRollupAddressManager ╭------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==========================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | +| **addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | | -| __gap | uint256[49] | 252 | 0 | 1568 | +| **gap | uint256[49] | 252 | 0 | 1568 | ╰------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------------------------------------╯ - ## MainnetTierRouter ╭------+------+------+--------+-------+----------╮ @@ -1684,195 +1641,188 @@ +================================================+ ╰------+------+------+--------+-------+----------╯ - ## MainnetProverSet ╭------------------+--------------------------+------+--------+-------+-----------------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=============================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| isProver | mapping(address => bool) | 251 | 0 | 32 | +| isProver | mapping(address => bool) | 251 | 0 | 32 | | -| admin | address | 252 | 0 | 20 | +| admin | address | 252 | 0 | 20 | | -| __gap | uint256[48] | 253 | 0 | 1536 | +| \_\_gap | uint256[48] | 253 | 0 | 1536 | ╰------------------+--------------------------+------+--------+-------+-----------------------------------------------------------------------╯ - ## TokenUnlock ╭------------------+--------------------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=====================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| amountVested | uint256 | 251 | 0 | 32 | +| amountVested | uint256 | 251 | 0 | 32 | | -| recipient | address | 252 | 0 | 20 | +| recipient | address | 252 | 0 | 20 | | -| tgeTimestamp | uint64 | 252 | 20 | 8 | +| tgeTimestamp | uint64 | 252 | 20 | 8 | | -| isProverSet | mapping(address => bool) | 253 | 0 | 32 | +| isProverSet | mapping(address => bool) | 253 | 0 | 32 | | -| __gap | uint256[47] | 254 | 0 | 1504 | +| \_\_gap | uint256[47] | 254 | 0 | 1504 | ╰------------------+--------------------------+------+--------+-------+---------------------------------------------------------------╯ - ## ProverSet ╭------------------+--------------------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +========================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| isProver | mapping(address => bool) | 251 | 0 | 32 | +| isProver | mapping(address => bool) | 251 | 0 | 32 | | -| admin | address | 252 | 0 | 20 | +| admin | address | 252 | 0 | 20 | | -| __gap | uint256[48] | 253 | 0 | 1536 | +| \_\_gap | uint256[48] | 253 | 0 | 1536 | ╰------------------+--------------------------+------+--------+-------+--------------------------------------------------╯ - ## GuardianProver ╭-------------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| guardianIds | mapping(address => uint256) | 251 | 0 | 32 | +| guardianIds | mapping(address => uint256) | 251 | 0 | 32 | | -| approvals | mapping(uint256 => mapping(bytes32 => uint256)) | 252 | 0 | 32 | +| approvals | mapping(uint256 => mapping(bytes32 => uint256)) | 252 | 0 | 32 | | -| guardians | address[] | 253 | 0 | 32 | +| guardians | address[] | 253 | 0 | 32 | | -| version | uint32 | 254 | 0 | 4 | +| version | uint32 | 254 | 0 | 4 | | -| minGuardians | uint32 | 254 | 4 | 4 | +| minGuardians | uint32 | 254 | 4 | 4 | | -| provingAutoPauseEnabled | bool | 254 | 8 | 1 | +| provingAutoPauseEnabled | bool | 254 | 8 | 1 | | -| latestProofHash | mapping(uint256 => mapping(uint256 => bytes32)) | 255 | 0 | 32 | +| latestProofHash | mapping(uint256 => mapping(uint256 => bytes32)) | 255 | 0 | 32 | | -| __gap | uint256[45] | 256 | 0 | 1440 | +| \_\_gap | uint256[45] | 256 | 0 | 1440 | ╰-------------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------------------╯ - ## ForkManager ╭---------------+-------------+------+--------+-------+---------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=========================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| \_\_gap | uint256[49] | 102 | 0 | 1568 | ╰---------------+-------------+------+--------+-------+---------------------------------------------------╯ - - diff --git a/packages/protocol/contract_layout_layer2.md b/packages/protocol/contract_layout_layer2.md index fd6476114df..d71e2364207 100644 --- a/packages/protocol/contract_layout_layer2.md +++ b/packages/protocol/contract_layout_layer2.md @@ -1,844 +1,825 @@ ## ERC1155Vault ╭--------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | | -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | | -| __gap | uint256[48] | 303 | 0 | 1536 | +| **gap | uint256[48] | 303 | 0 | 1536 | | -| __gap | uint256[50] | 351 | 0 | 1600 | +| **gap | uint256[50] | 351 | 0 | 1600 | | -| __gap | uint256[50] | 401 | 0 | 1600 | +| **gap | uint256[50] | 401 | 0 | 1600 | | -| __gap | uint256[50] | 451 | 0 | 1600 | +| \_\_gap | uint256[50] | 451 | 0 | 1600 | ╰--------------------+------------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - ## ERC20Vault ╭--------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | +| bridgedToCanonical | mapping(address => struct ERC20Vault.CanonicalERC20) | 301 | 0 | 32 | | -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | | -| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | +| btokenDenylist | mapping(address => bool) | 303 | 0 | 32 | | -| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | +| lastMigrationStart | mapping(uint256 => mapping(address => uint256)) | 304 | 0 | 32 | | -| __gap | uint256[46] | 305 | 0 | 1472 | +| **gap | uint256[46] | 305 | 0 | 1472 | ╰--------------------+------------------------------------------------------+------+--------+-------+-------------------------------------------------------╯ - ## ERC721Vault ╭--------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | +| bridgedToCanonical | mapping(address => struct BaseNFTVault.CanonicalNFT) | 301 | 0 | 32 | | -| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | +| canonicalToBridged | mapping(uint256 => mapping(address => address)) | 302 | 0 | 32 | | -| __gap | uint256[48] | 303 | 0 | 1536 | +| **gap | uint256[48] | 303 | 0 | 1536 | | -| __gap | uint256[50] | 351 | 0 | 1600 | +| \_\_gap | uint256[50] | 351 | 0 | 1600 | ╰--------------------+------------------------------------------------------+------+--------+-------+---------------------------------------------------------╯ - ## BridgedERC20 ╭------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| _balances | mapping(address => uint256) | 251 | 0 | 32 | +| \_balances | mapping(address => uint256) | 251 | 0 | 32 | | -| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| \_allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | | -| _totalSupply | uint256 | 253 | 0 | 32 | +| \_totalSupply | uint256 | 253 | 0 | 32 | | -| _name | string | 254 | 0 | 32 | +| \_name | string | 254 | 0 | 32 | | -| _symbol | string | 255 | 0 | 32 | +| \_symbol | string | 255 | 0 | 32 | | -| __gap | uint256[45] | 256 | 0 | 1440 | +| **gap | uint256[45] | 256 | 0 | 1440 | | -| srcToken | address | 301 | 0 | 20 | +| srcToken | address | 301 | 0 | 20 | | -| __srcDecimals | uint8 | 301 | 20 | 1 | +| **srcDecimals | uint8 | 301 | 20 | 1 | | -| srcChainId | uint256 | 302 | 0 | 32 | +| srcChainId | uint256 | 302 | 0 | 32 | | -| migratingAddress | address | 303 | 0 | 20 | +| migratingAddress | address | 303 | 0 | 20 | | -| migratingInbound | bool | 303 | 20 | 1 | +| migratingInbound | bool | 303 | 20 | 1 | | -| __gap | uint256[47] | 304 | 0 | 1504 | +| \_\_gap | uint256[47] | 304 | 0 | 1504 | ╰------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - ## BridgedERC20V2 ╭------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| _balances | mapping(address => uint256) | 251 | 0 | 32 | +| \_balances | mapping(address => uint256) | 251 | 0 | 32 | | -| _allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | +| \_allowances | mapping(address => mapping(address => uint256)) | 252 | 0 | 32 | | -| _totalSupply | uint256 | 253 | 0 | 32 | +| \_totalSupply | uint256 | 253 | 0 | 32 | | -| _name | string | 254 | 0 | 32 | +| \_name | string | 254 | 0 | 32 | | -| _symbol | string | 255 | 0 | 32 | +| \_symbol | string | 255 | 0 | 32 | | -| __gap | uint256[45] | 256 | 0 | 1440 | +| **gap | uint256[45] | 256 | 0 | 1440 | | -| srcToken | address | 301 | 0 | 20 | +| srcToken | address | 301 | 0 | 20 | | -| __srcDecimals | uint8 | 301 | 20 | 1 | +| **srcDecimals | uint8 | 301 | 20 | 1 | | -| srcChainId | uint256 | 302 | 0 | 32 | +| srcChainId | uint256 | 302 | 0 | 32 | | -| migratingAddress | address | 303 | 0 | 20 | +| migratingAddress | address | 303 | 0 | 20 | | -| migratingInbound | bool | 303 | 20 | 1 | +| migratingInbound | bool | 303 | 20 | 1 | | -| __gap | uint256[47] | 304 | 0 | 1504 | +| **gap | uint256[47] | 304 | 0 | 1504 | | -| _hashedName | bytes32 | 351 | 0 | 32 | +| \_hashedName | bytes32 | 351 | 0 | 32 | | -| _hashedVersion | bytes32 | 352 | 0 | 32 | +| \_hashedVersion | bytes32 | 352 | 0 | 32 | | -| _name | string | 353 | 0 | 32 | +| \_name | string | 353 | 0 | 32 | | -| _version | string | 354 | 0 | 32 | +| \_version | string | 354 | 0 | 32 | | -| __gap | uint256[48] | 355 | 0 | 1536 | +| **gap | uint256[48] | 355 | 0 | 1536 | | -| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| \_nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | | -| __gap | uint256[49] | 404 | 0 | 1568 | +| \_\_gap | uint256[49] | 404 | 0 | 1568 | ╰------------------+--------------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ - ## BridgedERC721 ╭--------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| _name | string | 301 | 0 | 32 | +| \_name | string | 301 | 0 | 32 | | -| _symbol | string | 302 | 0 | 32 | +| \_symbol | string | 302 | 0 | 32 | | -| _owners | mapping(uint256 => address) | 303 | 0 | 32 | +| \_owners | mapping(uint256 => address) | 303 | 0 | 32 | | -| _balances | mapping(address => uint256) | 304 | 0 | 32 | +| \_balances | mapping(address => uint256) | 304 | 0 | 32 | | -| _tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | +| \_tokenApprovals | mapping(uint256 => address) | 305 | 0 | 32 | | -| _operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | +| \_operatorApprovals | mapping(address => mapping(address => bool)) | 306 | 0 | 32 | | -| __gap | uint256[44] | 307 | 0 | 1408 | +| **gap | uint256[44] | 307 | 0 | 1408 | | -| srcToken | address | 351 | 0 | 20 | +| srcToken | address | 351 | 0 | 20 | | -| srcChainId | uint256 | 352 | 0 | 32 | +| srcChainId | uint256 | 352 | 0 | 32 | | -| __gap | uint256[48] | 353 | 0 | 1536 | +| \_\_gap | uint256[48] | 353 | 0 | 1536 | ╰--------------------+----------------------------------------------+------+--------+-------+-------------------------------------------------------------╯ - ## BridgedERC1155 ╭--------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==============================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __gap | uint256[50] | 251 | 0 | 1600 | +| **gap | uint256[50] | 251 | 0 | 1600 | | -| _balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | +| \_balances | mapping(uint256 => mapping(address => uint256)) | 301 | 0 | 32 | | -| _operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | +| \_operatorApprovals | mapping(address => mapping(address => bool)) | 302 | 0 | 32 | | -| _uri | string | 303 | 0 | 32 | +| \_uri | string | 303 | 0 | 32 | | -| __gap | uint256[47] | 304 | 0 | 1504 | +| **gap | uint256[47] | 304 | 0 | 1504 | | -| srcToken | address | 351 | 0 | 20 | +| srcToken | address | 351 | 0 | 20 | | -| srcChainId | uint256 | 352 | 0 | 32 | +| srcChainId | uint256 | 352 | 0 | 32 | | -| symbol | string | 353 | 0 | 32 | +| symbol | string | 353 | 0 | 32 | | -| name | string | 354 | 0 | 32 | +| name | string | 354 | 0 | 32 | | -| __gap | uint256[46] | 355 | 0 | 1472 | +| \_\_gap | uint256[46] | 355 | 0 | 1472 | ╰--------------------+-------------------------------------------------+------+--------+-------+---------------------------------------------------------------╯ - ## Bridge ╭------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __reserved1 | uint64 | 251 | 0 | 8 | +| **reserved1 | uint64 | 251 | 0 | 8 | | -| nextMessageId | uint64 | 251 | 8 | 8 | +| nextMessageId | uint64 | 251 | 8 | 8 | | -| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | +| messageStatus | mapping(bytes32 => enum IBridge.Status) | 252 | 0 | 32 | | -| __ctx | struct IBridge.Context | 253 | 0 | 64 | +| **ctx | struct IBridge.Context | 253 | 0 | 64 | | -| __reserved2 | uint256 | 255 | 0 | 32 | +| **reserved2 | uint256 | 255 | 0 | 32 | | -| __reserved3 | uint256 | 256 | 0 | 32 | +| **reserved3 | uint256 | 256 | 0 | 32 | | -| __gap | uint256[44] | 257 | 0 | 1408 | +| \_\_gap | uint256[44] | 257 | 0 | 1408 | ╰------------------+-----------------------------------------+------+--------+-------+-------------------------------------------╯ - ## QuotaManager ╭------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | +| tokenQuota | mapping(address => struct QuotaManager.Quota) | 251 | 0 | 32 | | -| quotaPeriod | uint24 | 252 | 0 | 3 | +| quotaPeriod | uint24 | 252 | 0 | 3 | | -| __gap | uint256[48] | 253 | 0 | 1536 | +| \_\_gap | uint256[48] | 253 | 0 | 1536 | ╰------------------+-----------------------------------------------+------+--------+-------+-------------------------------------------------------╯ - ## AddressManager ╭------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +========================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | +| **addresses | mapping(uint256 => mapping(bytes32 => address)) | 251 | 0 | 32 | | -| __gap | uint256[49] | 252 | 0 | 1568 | +| **gap | uint256[49] | 252 | 0 | 1568 | ╰------------------+-------------------------------------------------+------+--------+-------+-----------------------------------------------------------╯ - ## AddressResolver ╭----------------+-------------+------+--------+-------+-------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +====================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| addressManager | address | 0 | 2 | 20 | +| addressManager | address | 0 | 2 | 20 | | -| __gap | uint256[49] | 1 | 0 | 1568 | +| \_\_gap | uint256[49] | 1 | 0 | 1568 | ╰----------------+-------------+------+--------+-------+-------------------------------------------------------------╯ - ## EssentialContract ╭------------------+-------------+------+--------+-------+-----------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==========================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | ╰------------------+-------------+------+--------+-------+-----------------------------------------------------------------╯ - ## SignalService ╭------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +====================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | +| topBlockId | mapping(uint64 => mapping(bytes32 => uint64)) | 251 | 0 | 32 | | -| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | +| isAuthorized | mapping(address => bool) | 252 | 0 | 32 | | -| __gap | uint256[48] | 253 | 0 | 1536 | +| \_\_gap | uint256[48] | 253 | 0 | 1536 | ╰------------------+-----------------------------------------------+------+--------+-------+---------------------------------------------------------╯ - ## BridgedTaikoToken ╭-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +==============================================================================================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| __slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | +| **slots_previously_used_by_ERC20SnapshotUpgradeable | uint256[50] | 251 | 0 | 1600 | | -| _balances | mapping(address => uint256) | 301 | 0 | 32 | +| \_balances | mapping(address => uint256) | 301 | 0 | 32 | | -| _allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | +| \_allowances | mapping(address => mapping(address => uint256)) | 302 | 0 | 32 | | -| _totalSupply | uint256 | 303 | 0 | 32 | +| \_totalSupply | uint256 | 303 | 0 | 32 | | -| _name | string | 304 | 0 | 32 | +| \_name | string | 304 | 0 | 32 | | -| _symbol | string | 305 | 0 | 32 | +| \_symbol | string | 305 | 0 | 32 | | -| __gap | uint256[45] | 306 | 0 | 1440 | +| **gap | uint256[45] | 306 | 0 | 1440 | | -| _hashedName | bytes32 | 351 | 0 | 32 | +| \_hashedName | bytes32 | 351 | 0 | 32 | | -| _hashedVersion | bytes32 | 352 | 0 | 32 | +| \_hashedVersion | bytes32 | 352 | 0 | 32 | | -| _name | string | 353 | 0 | 32 | +| \_name | string | 353 | 0 | 32 | | -| _version | string | 354 | 0 | 32 | +| \_version | string | 354 | 0 | 32 | | -| __gap | uint256[48] | 355 | 0 | 1536 | +| **gap | uint256[48] | 355 | 0 | 1536 | | -| _nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | +| \_nonces | mapping(address => struct CountersUpgradeable.Counter) | 403 | 0 | 32 | | -| _PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | +| \_PERMIT_TYPEHASH_DEPRECATED_SLOT | bytes32 | 404 | 0 | 32 | | -| __gap | uint256[49] | 405 | 0 | 1568 | +| **gap | uint256[49] | 405 | 0 | 1568 | | -| _delegates | mapping(address => address) | 454 | 0 | 32 | +| \_delegates | mapping(address => address) | 454 | 0 | 32 | | -| _checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | +| \_checkpoints | mapping(address => struct ERC20VotesUpgradeable.Checkpoint[]) | 455 | 0 | 32 | | -| _totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | +| \_totalSupplyCheckpoints | struct ERC20VotesUpgradeable.Checkpoint[] | 456 | 0 | 32 | | -| __gap | uint256[47] | 457 | 0 | 1504 | +| **gap | uint256[47] | 457 | 0 | 1504 | | -| __gap | uint256[50] | 504 | 0 | 1600 | +| **gap | uint256[50] | 504 | 0 | 1600 | ╰-----------------------------------------------------+---------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------╯ - ## DelegateOwner ╭------------------+-------------+------+--------+-------+--------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===========================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| remoteChainId | uint64 | 251 | 0 | 8 | +| remoteChainId | uint64 | 251 | 0 | 8 | | -| admin | address | 251 | 8 | 20 | +| admin | address | 251 | 8 | 20 | | -| nextTxId | uint64 | 252 | 0 | 8 | +| nextTxId | uint64 | 252 | 0 | 8 | | -| remoteOwner | address | 252 | 8 | 20 | +| remoteOwner | address | 252 | 8 | 20 | | -| __gap | uint256[48] | 253 | 0 | 1536 | +| \_\_gap | uint256[48] | 253 | 0 | 1536 | ╰------------------+-------------+------+--------+-------+--------------------------------------------------╯ - ## TaikoL2 ╭------------------+-----------------------------+------+--------+-------+--------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=====================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| _blockhashes | mapping(uint256 => bytes32) | 251 | 0 | 32 | +| \_blockhashes | mapping(uint256 => bytes32) | 251 | 0 | 32 | | -| publicInputHash | bytes32 | 252 | 0 | 32 | +| publicInputHash | bytes32 | 252 | 0 | 32 | | -| parentGasExcess | uint64 | 253 | 0 | 8 | +| parentGasExcess | uint64 | 253 | 0 | 8 | | -| lastSyncedBlock | uint64 | 253 | 8 | 8 | +| lastSyncedBlock | uint64 | 253 | 8 | 8 | | -| parentTimestamp | uint64 | 253 | 16 | 8 | +| parentTimestamp | uint64 | 253 | 16 | 8 | | -| parentGasTarget | uint64 | 253 | 24 | 8 | +| parentGasTarget | uint64 | 253 | 24 | 8 | | -| l1ChainId | uint64 | 254 | 0 | 8 | +| l1ChainId | uint64 | 254 | 0 | 8 | | -| __gap | uint256[46] | 255 | 0 | 1472 | +| \_\_gap | uint256[46] | 255 | 0 | 1472 | ╰------------------+-----------------------------+------+--------+-------+--------------------------------------------╯ - ## HeklaTaikoL2 ╭------------------+-----------------------------+------+--------+-------+------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +===============================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| _blockhashes | mapping(uint256 => bytes32) | 251 | 0 | 32 | +| \_blockhashes | mapping(uint256 => bytes32) | 251 | 0 | 32 | | -| publicInputHash | bytes32 | 252 | 0 | 32 | +| publicInputHash | bytes32 | 252 | 0 | 32 | | -| parentGasExcess | uint64 | 253 | 0 | 8 | +| parentGasExcess | uint64 | 253 | 0 | 8 | | -| lastSyncedBlock | uint64 | 253 | 8 | 8 | +| lastSyncedBlock | uint64 | 253 | 8 | 8 | | -| parentTimestamp | uint64 | 253 | 16 | 8 | +| parentTimestamp | uint64 | 253 | 16 | 8 | | -| parentGasTarget | uint64 | 253 | 24 | 8 | +| parentGasTarget | uint64 | 253 | 24 | 8 | | -| l1ChainId | uint64 | 254 | 0 | 8 | +| l1ChainId | uint64 | 254 | 0 | 8 | | -| __gap | uint256[46] | 255 | 0 | 1472 | +| \_\_gap | uint256[46] | 255 | 0 | 1472 | ╰------------------+-----------------------------+------+--------+-------+------------------------------------------------------╯ - ## MainnetTaikoL2 ╭------------------+-----------------------------+------+--------+-------+------------------------------------------------------------╮ -| Name | Type | Slot | Offset | Bytes | +| Name | Type | Slot | Offset | Bytes | +=====================================================================================================================================+ -| _initialized | uint8 | 0 | 0 | 1 | +| \_initialized | uint8 | 0 | 0 | 1 | | -| _initializing | bool | 0 | 1 | 1 | +| \_initializing | bool | 0 | 1 | 1 | | -| __gap | uint256[50] | 1 | 0 | 1600 | +| **gap | uint256[50] | 1 | 0 | 1600 | | -| _owner | address | 51 | 0 | 20 | +| \_owner | address | 51 | 0 | 20 | | -| __gap | uint256[49] | 52 | 0 | 1568 | +| **gap | uint256[49] | 52 | 0 | 1568 | | -| _pendingOwner | address | 101 | 0 | 20 | +| \_pendingOwner | address | 101 | 0 | 20 | | -| __gap | uint256[49] | 102 | 0 | 1568 | +| **gap | uint256[49] | 102 | 0 | 1568 | | -| addressManager | address | 151 | 0 | 20 | +| addressManager | address | 151 | 0 | 20 | | -| __gap | uint256[49] | 152 | 0 | 1568 | +| **gap | uint256[49] | 152 | 0 | 1568 | | -| __reentry | uint8 | 201 | 0 | 1 | +| **reentry | uint8 | 201 | 0 | 1 | | -| __paused | uint8 | 201 | 1 | 1 | +| **paused | uint8 | 201 | 1 | 1 | | -| __lastUnpausedAt | uint64 | 201 | 2 | 8 | +| **lastUnpausedAt | uint64 | 201 | 2 | 8 | | -| __gap | uint256[49] | 202 | 0 | 1568 | +| **gap | uint256[49] | 202 | 0 | 1568 | | -| _blockhashes | mapping(uint256 => bytes32) | 251 | 0 | 32 | +| \_blockhashes | mapping(uint256 => bytes32) | 251 | 0 | 32 | | -| publicInputHash | bytes32 | 252 | 0 | 32 | +| publicInputHash | bytes32 | 252 | 0 | 32 | | -| parentGasExcess | uint64 | 253 | 0 | 8 | +| parentGasExcess | uint64 | 253 | 0 | 8 | | -| lastSyncedBlock | uint64 | 253 | 8 | 8 | +| lastSyncedBlock | uint64 | 253 | 8 | 8 | | -| parentTimestamp | uint64 | 253 | 16 | 8 | +| parentTimestamp | uint64 | 253 | 16 | 8 | | -| parentGasTarget | uint64 | 253 | 24 | 8 | +| parentGasTarget | uint64 | 253 | 24 | 8 | | -| l1ChainId | uint64 | 254 | 0 | 8 | +| l1ChainId | uint64 | 254 | 0 | 8 | | -| __gap | uint256[46] | 255 | 0 | 1472 | +| \_\_gap | uint256[46] | 255 | 0 | 1472 | ╰------------------+-----------------------------+------+--------+-------+------------------------------------------------------------╯ - - diff --git a/packages/taiko-client/.swaggo b/packages/taiko-client/.swaggo index 8cc34d878a4..e69de29bb2d 100644 --- a/packages/taiko-client/.swaggo +++ b/packages/taiko-client/.swaggo @@ -1,2 +0,0 @@ -replace common.Address string -replace encoding.TierFee uint64 \ No newline at end of file diff --git a/packages/taiko-client/bindings/encoding/input.go b/packages/taiko-client/bindings/encoding/input.go index 0aebf3113ee..b0d9fab8c8a 100644 --- a/packages/taiko-client/bindings/encoding/input.go +++ b/packages/taiko-client/bindings/encoding/input.go @@ -3,6 +3,7 @@ package encoding import ( "errors" "fmt" + "math/big" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/log" @@ -294,7 +295,10 @@ var ( {Name: "TaikoData.Transition", Type: transitionComponentsType}, {Name: "TaikoData.TierProof", Type: tierProofComponentsType}, } - proveBlocksInputArgs = abi.Arguments{ + stringType, _ = abi.NewType("string", "TAIKO_DIFFICULTY", nil) + uint64Type, _ = abi.NewType("uint64", "local.b.numBlocks", nil) + difficultyCalculationInputArgs = abi.Arguments{{Type: stringType}, {Type: uint64Type}} + proveBlocksInputArgs = abi.Arguments{ {Name: "TaikoData.BlockMetadata", Type: blockMetadataV2ComponentsType}, {Name: "TaikoData.Transition", Type: transitionComponentsType}, } @@ -430,6 +434,16 @@ func EncodeProveBlockInput( return b, nil } +// EncodeDifficultCalcutionParams performs the solidity `abi.encode` for the +// `block.difficulty` hash payload. +func EncodeDifficultyCalcutionParams(numBlocks uint64) ([]byte, error) { + b, err := difficultyCalculationInputArgs.Pack("TAIKO_DIFFICULTY", numBlocks) + if err != nil { + return nil, fmt.Errorf("failed to abi.encode `block.difficulty` hash payload, %w", err) + } + return b, nil +} + // EncodeProveBlocksInput performs the solidity `abi.encode` for the given TaikoL1.proveBlocks input. func EncodeProveBlocksInput( metas []metadata.TaikoBlockMetaData, @@ -493,3 +507,13 @@ func UnpackTxListBytes(txData []byte) ([]byte, error) { return inputs, nil } + +// EncodeBaseFeeConfig encodes the block.extraData field from the given base fee config. +func EncodeBaseFeeConfig(baseFeeConfig *bindings.LibSharedDataBaseFeeConfig) [32]byte { + var ( + bytes32Value [32]byte + uintValue = new(big.Int).SetUint64(uint64(baseFeeConfig.SharingPctg)) + ) + copy(bytes32Value[32-len(uintValue.Bytes()):], uintValue.Bytes()) + return bytes32Value +} diff --git a/packages/taiko-client/cmd/flags/driver.go b/packages/taiko-client/cmd/flags/driver.go index f068a5d075e..b308df53278 100644 --- a/packages/taiko-client/cmd/flags/driver.go +++ b/packages/taiko-client/cmd/flags/driver.go @@ -52,6 +52,33 @@ var ( Category: driverCategory, EnvVars: []string{"BLOB_SOCIAL_SCAN_ENDPOINT"}, } + // soft block server + SoftBlockServerPort = &cli.Uint64Flag{ + Name: "softBlock.port", + Usage: "HTTP port of the soft block server, 0 means disabled", + Category: driverCategory, + EnvVars: []string{"SOFT_BLOCK_SERVER_PORT"}, + } + SoftBlockServerJWTSecret = &cli.StringFlag{ + Name: "softBlock.jwtSecret", + Usage: "Path to a JWT secret to use for the soft block server", + Category: driverCategory, + EnvVars: []string{"SOFT_BLOCK_SERVER_JWT_SECRET"}, + } + SoftBlockServerCORSOrigins = &cli.StringFlag{ + Name: "softBlock.corsOrigins", + Usage: "CORS Origins settings for the soft block server", + Category: driverCategory, + Value: "*", + EnvVars: []string{"SOFT_BLOCK_SERVER_CORS_ORIGINS"}, + } + SoftBlockServerCheckSig = &cli.BoolFlag{ + Name: "softBlock.signatureCheck", + Usage: "If the soft block server will check the signature of the incoming transactions batches", + Category: driverCategory, + Value: false, + EnvVars: []string{"SOFT_BLOCK_SERVER_SIGNATURE_CHECK"}, + } ) // DriverFlags All driver flags. @@ -66,4 +93,8 @@ var DriverFlags = MergeFlags(CommonFlags, []cli.Flag{ MaxExponent, BlobServerEndpoint, SocialScanEndpoint, + SoftBlockServerPort, + SoftBlockServerJWTSecret, + SoftBlockServerCORSOrigins, + SoftBlockServerCheckSig, }) diff --git a/packages/taiko-client/docs/docs.go b/packages/taiko-client/docs/docs.go new file mode 100644 index 00000000000..ca9a73974e5 --- /dev/null +++ b/packages/taiko-client/docs/docs.go @@ -0,0 +1,378 @@ +// Package docs Code generated by swaggo/swag. DO NOT EDIT +package docs + +import "github.com/swaggo/swag" + +const docTemplate = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "name": "API Support", + "url": "https://community.taiko.xyz/", + "email": "info@taiko.xyz" + }, + "license": { + "name": "MIT", + "url": "https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md" + }, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/healthz": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "summary": "Get current server health status", + "operationId": "health-check", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/softBlocks": { + "post": { + "description": "Insert a batch of transactions into a soft block for preconfirmation. If the batch is the\nfirst for a block, a new soft block will be created. Otherwise, the transactions will\nbe appended to the existing soft block. The API will fail if:\n1) the block is not soft\n2) block-level parameters are invalid or do not match the current soft block’s parameters\n3) the batch ID is not exactly 1 greater than the previous one\n4) the last batch of the block indicates no further transactions are allowed", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "description": "soft block creation request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/softblocks.BuildSoftBlockRequestBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/softblocks.BuildSoftBlockResponseBody" + } + } + } + }, + "delete": { + "description": "Remove all soft blocks from the blockchain beyond the specified block height,\nensuring the latest block ID does not exceed the given height. This method will fail if\nthe block with an ID one greater than the specified height is not a soft block. If the\nspecified block height is greater than the latest soft block ID, the method will succeed\nwithout modifying the blockchain.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "description": "soft blocks removing request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/softblocks.RemoveSoftBlocksRequestBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/softblocks.RemoveSoftBlocksResponseBody" + } + } + } + } + } + }, + "definitions": { + "big.Int": { + "type": "object" + }, + "softblocks.BuildSoftBlockRequestBody": { + "type": "object", + "properties": { + "transactionBatch": { + "description": "@param transactionBatch TransactionBatch Transaction batch to be inserted into the soft block", + "allOf": [ + { + "$ref": "#/definitions/softblocks.TransactionBatch" + } + ] + } + } + }, + "softblocks.BuildSoftBlockResponseBody": { + "type": "object", + "properties": { + "blockHeader": { + "description": "@param blockHeader types.Header of the soft block", + "allOf": [ + { + "$ref": "#/definitions/types.Header" + } + ] + } + } + }, + "softblocks.RemoveSoftBlocksRequestBody": { + "type": "object", + "properties": { + "newLastBlockId": { + "description": "@param newLastBlockID uint64 New last block ID of the blockchain, it should\n@param not smaller than the canonical chain's highest block ID.", + "type": "integer" + } + } + }, + "softblocks.RemoveSoftBlocksResponseBody": { + "type": "object", + "properties": { + "headsRemoved": { + "description": "@param headsRemoved uint64 Number of soft heads removed", + "type": "integer" + }, + "lastBlockId": { + "description": "@param lastBlockID uint64 Current highest block ID of the blockchain (including soft blocks)", + "type": "integer" + }, + "lastProposedBlockID": { + "description": "@param lastProposedBlockID uint64 Highest block ID of the cnonical chain", + "type": "integer" + } + } + }, + "softblocks.SoftBlockParams": { + "type": "object", + "properties": { + "anchorBlockID": { + "description": "@param anchorBlockID uint64 ` + "`" + `_anchorBlockId` + "`" + ` parameter of the ` + "`" + `anchorV2` + "`" + ` transaction in soft block", + "type": "integer" + }, + "anchorStateRoot": { + "description": "@param anchorStateRoot string ` + "`" + `_anchorStateRoot` + "`" + ` parameter of the ` + "`" + `anchorV2` + "`" + ` transaction in soft block", + "type": "array", + "items": { + "type": "integer" + } + }, + "coinbase": { + "description": "@param coinbase string Coinbase of the soft block", + "type": "array", + "items": { + "type": "integer" + } + }, + "timestamp": { + "description": "@param timestamp uint64 Timestamp of the soft block", + "type": "integer" + } + } + }, + "softblocks.TransactionBatch": { + "type": "object", + "properties": { + "batchId": { + "description": "@param batchId uint64 ID of this transaction batch", + "type": "integer" + }, + "batchType": { + "description": "@param batchType TransactionBatchMarker Marker of the transaction batch,\n@param either ` + "`" + `end_of_block` + "`" + `, ` + "`" + `end_of_preconf` + "`" + ` or empty", + "allOf": [ + { + "$ref": "#/definitions/softblocks.TransactionBatchMarker" + } + ] + }, + "blockId": { + "description": "@param blockId uint64 Block ID of the soft block", + "type": "integer" + }, + "blockParams": { + "description": "@param blockParams SoftBlockParams Block parameters of the soft block", + "allOf": [ + { + "$ref": "#/definitions/softblocks.SoftBlockParams" + } + ] + }, + "signature": { + "description": "@param signature string Signature of this transaction batch", + "type": "string" + }, + "transactions": { + "description": "@param transactions string zlib compressed RLP encoded bytes of a transactions list", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "softblocks.TransactionBatchMarker": { + "type": "string", + "enum": [ + "", + "endOfBlock", + "endOfPreconf" + ], + "x-enum-varnames": [ + "BatchMarkerEmpty", + "BatchMarkerEOB", + "BatchMarkerEOP" + ] + }, + "types.Header": { + "type": "object", + "properties": { + "baseFeePerGas": { + "description": "BaseFee was added by EIP-1559 and is ignored in legacy headers.", + "allOf": [ + { + "$ref": "#/definitions/big.Int" + } + ] + }, + "blobGasUsed": { + "description": "BlobGasUsed was added by EIP-4844 and is ignored in legacy headers.", + "type": "integer" + }, + "difficulty": { + "$ref": "#/definitions/big.Int" + }, + "excessBlobGas": { + "description": "ExcessBlobGas was added by EIP-4844 and is ignored in legacy headers.", + "type": "integer" + }, + "extraData": { + "type": "array", + "items": { + "type": "integer" + } + }, + "gasLimit": { + "type": "integer" + }, + "gasUsed": { + "type": "integer" + }, + "logsBloom": { + "type": "array", + "items": { + "type": "integer" + } + }, + "miner": { + "type": "array", + "items": { + "type": "integer" + } + }, + "mixHash": { + "type": "array", + "items": { + "type": "integer" + } + }, + "nonce": { + "type": "array", + "items": { + "type": "integer" + } + }, + "number": { + "$ref": "#/definitions/big.Int" + }, + "parentBeaconBlockRoot": { + "description": "ParentBeaconRoot was added by EIP-4788 and is ignored in legacy headers.", + "type": "array", + "items": { + "type": "integer" + } + }, + "parentHash": { + "type": "array", + "items": { + "type": "integer" + } + }, + "receiptsRoot": { + "type": "array", + "items": { + "type": "integer" + } + }, + "requestsRoot": { + "description": "RequestsHash was added by EIP-7685 and is ignored in legacy headers.", + "type": "array", + "items": { + "type": "integer" + } + }, + "sha3Uncles": { + "type": "array", + "items": { + "type": "integer" + } + }, + "stateRoot": { + "type": "array", + "items": { + "type": "integer" + } + }, + "timestamp": { + "type": "integer" + }, + "transactionsRoot": { + "type": "array", + "items": { + "type": "integer" + } + }, + "withdrawalsRoot": { + "description": "WithdrawalsHash was added by EIP-4895 and is ignored in legacy headers.", + "type": "array", + "items": { + "type": "integer" + } + } + } + } + } +}` + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = &swag.Spec{ + Version: "1.0", + Host: "", + BasePath: "", + Schemes: []string{}, + Title: "Taiko Soft Block Server API", + Description: "", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", +} + +func init() { + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) +} diff --git a/packages/taiko-client/docs/index.html b/packages/taiko-client/docs/index.html new file mode 100644 index 00000000000..fd6da6d8abf --- /dev/null +++ b/packages/taiko-client/docs/index.html @@ -0,0 +1,29 @@ + + + + + + Taiko Preconfirmation Server API + + +
+ + + diff --git a/packages/taiko-client/docs/swagger.json b/packages/taiko-client/docs/swagger.json new file mode 100644 index 00000000000..2e72737ed95 --- /dev/null +++ b/packages/taiko-client/docs/swagger.json @@ -0,0 +1,335 @@ +{ + "swagger": "2.0", + "info": { + "title": "Taiko Soft Block Server API", + "termsOfService": "http://swagger.io/terms/", + "contact": { + "name": "API Support", + "url": "https://community.taiko.xyz/", + "email": "info@taiko.xyz" + }, + "license": { + "name": "MIT", + "url": "https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md" + }, + "version": "1.0" + }, + "paths": { + "/healthz": { + "get": { + "consumes": ["application/json"], + "produces": ["application/json"], + "summary": "Get current server health status", + "operationId": "health-check", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, + "/softBlocks": { + "post": { + "description": "Insert a batch of transactions into a soft block for preconfirmation. If the batch is the\nfirst for a block, a new soft block will be created. Otherwise, the transactions will\nbe appended to the existing soft block. The API will fail if:\n1) the block is not soft\n2) block-level parameters are invalid or do not match the current soft block’s parameters\n3) the batch ID is not exactly 1 greater than the previous one\n4) the last batch of the block indicates no further transactions are allowed", + "consumes": ["application/json"], + "produces": ["application/json"], + "parameters": [ + { + "description": "soft block creation request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/softblocks.BuildSoftBlockRequestBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/softblocks.BuildSoftBlockResponseBody" + } + } + } + }, + "delete": { + "description": "Remove all soft blocks from the blockchain beyond the specified block height,\nensuring the latest block ID does not exceed the given height. This method will fail if\nthe block with an ID one greater than the specified height is not a soft block. If the\nspecified block height is greater than the latest soft block ID, the method will succeed\nwithout modifying the blockchain.", + "consumes": ["application/json"], + "produces": ["application/json"], + "parameters": [ + { + "description": "soft blocks removing request body", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/softblocks.RemoveSoftBlocksRequestBody" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/softblocks.RemoveSoftBlocksResponseBody" + } + } + } + } + } + }, + "definitions": { + "big.Int": { + "type": "object" + }, + "softblocks.BuildSoftBlockRequestBody": { + "type": "object", + "properties": { + "transactionBatch": { + "description": "@param transactionBatch TransactionBatch Transaction batch to be inserted into the soft block", + "allOf": [ + { + "$ref": "#/definitions/softblocks.TransactionBatch" + } + ] + } + } + }, + "softblocks.BuildSoftBlockResponseBody": { + "type": "object", + "properties": { + "blockHeader": { + "description": "@param blockHeader types.Header of the soft block", + "allOf": [ + { + "$ref": "#/definitions/types.Header" + } + ] + } + } + }, + "softblocks.RemoveSoftBlocksRequestBody": { + "type": "object", + "properties": { + "newLastBlockId": { + "description": "@param newLastBlockID uint64 New last block ID of the blockchain, it should\n@param not smaller than the canonical chain's highest block ID.", + "type": "integer" + } + } + }, + "softblocks.RemoveSoftBlocksResponseBody": { + "type": "object", + "properties": { + "headsRemoved": { + "description": "@param headsRemoved uint64 Number of soft heads removed", + "type": "integer" + }, + "lastBlockId": { + "description": "@param lastBlockID uint64 Current highest block ID of the blockchain (including soft blocks)", + "type": "integer" + }, + "lastProposedBlockID": { + "description": "@param lastProposedBlockID uint64 Highest block ID of the cnonical chain", + "type": "integer" + } + } + }, + "softblocks.SoftBlockParams": { + "type": "object", + "properties": { + "anchorBlockID": { + "description": "@param anchorBlockID uint64 `_anchorBlockId` parameter of the `anchorV2` transaction in soft block", + "type": "integer" + }, + "anchorStateRoot": { + "description": "@param anchorStateRoot string `_anchorStateRoot` parameter of the `anchorV2` transaction in soft block", + "type": "array", + "items": { + "type": "integer" + } + }, + "coinbase": { + "description": "@param coinbase string Coinbase of the soft block", + "type": "array", + "items": { + "type": "integer" + } + }, + "timestamp": { + "description": "@param timestamp uint64 Timestamp of the soft block", + "type": "integer" + } + } + }, + "softblocks.TransactionBatch": { + "type": "object", + "properties": { + "batchId": { + "description": "@param batchId uint64 ID of this transaction batch", + "type": "integer" + }, + "batchType": { + "description": "@param batchType TransactionBatchMarker Marker of the transaction batch,\n@param either `end_of_block`, `end_of_preconf` or empty", + "allOf": [ + { + "$ref": "#/definitions/softblocks.TransactionBatchMarker" + } + ] + }, + "blockId": { + "description": "@param blockId uint64 Block ID of the soft block", + "type": "integer" + }, + "blockParams": { + "description": "@param blockParams SoftBlockParams Block parameters of the soft block", + "allOf": [ + { + "$ref": "#/definitions/softblocks.SoftBlockParams" + } + ] + }, + "signature": { + "description": "@param signature string Signature of this transaction batch", + "type": "string" + }, + "transactions": { + "description": "@param transactions string zlib compressed RLP encoded bytes of a transactions list", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "softblocks.TransactionBatchMarker": { + "type": "string", + "enum": ["", "endOfBlock", "endOfPreconf"], + "x-enum-varnames": [ + "BatchMarkerEmpty", + "BatchMarkerEOB", + "BatchMarkerEOP" + ] + }, + "types.Header": { + "type": "object", + "properties": { + "baseFeePerGas": { + "description": "BaseFee was added by EIP-1559 and is ignored in legacy headers.", + "allOf": [ + { + "$ref": "#/definitions/big.Int" + } + ] + }, + "blobGasUsed": { + "description": "BlobGasUsed was added by EIP-4844 and is ignored in legacy headers.", + "type": "integer" + }, + "difficulty": { + "$ref": "#/definitions/big.Int" + }, + "excessBlobGas": { + "description": "ExcessBlobGas was added by EIP-4844 and is ignored in legacy headers.", + "type": "integer" + }, + "extraData": { + "type": "array", + "items": { + "type": "integer" + } + }, + "gasLimit": { + "type": "integer" + }, + "gasUsed": { + "type": "integer" + }, + "logsBloom": { + "type": "array", + "items": { + "type": "integer" + } + }, + "miner": { + "type": "array", + "items": { + "type": "integer" + } + }, + "mixHash": { + "type": "array", + "items": { + "type": "integer" + } + }, + "nonce": { + "type": "array", + "items": { + "type": "integer" + } + }, + "number": { + "$ref": "#/definitions/big.Int" + }, + "parentBeaconBlockRoot": { + "description": "ParentBeaconRoot was added by EIP-4788 and is ignored in legacy headers.", + "type": "array", + "items": { + "type": "integer" + } + }, + "parentHash": { + "type": "array", + "items": { + "type": "integer" + } + }, + "receiptsRoot": { + "type": "array", + "items": { + "type": "integer" + } + }, + "requestsRoot": { + "description": "RequestsHash was added by EIP-7685 and is ignored in legacy headers.", + "type": "array", + "items": { + "type": "integer" + } + }, + "sha3Uncles": { + "type": "array", + "items": { + "type": "integer" + } + }, + "stateRoot": { + "type": "array", + "items": { + "type": "integer" + } + }, + "timestamp": { + "type": "integer" + }, + "transactionsRoot": { + "type": "array", + "items": { + "type": "integer" + } + }, + "withdrawalsRoot": { + "description": "WithdrawalsHash was added by EIP-4895 and is ignored in legacy headers.", + "type": "array", + "items": { + "type": "integer" + } + } + } + } + } +} diff --git a/packages/taiko-client/docs/swagger.yaml b/packages/taiko-client/docs/swagger.yaml new file mode 100644 index 00000000000..88bafda32e4 --- /dev/null +++ b/packages/taiko-client/docs/swagger.yaml @@ -0,0 +1,266 @@ +definitions: + big.Int: + type: object + softblocks.BuildSoftBlockRequestBody: + properties: + transactionBatch: + allOf: + - $ref: "#/definitions/softblocks.TransactionBatch" + description: + "@param transactionBatch TransactionBatch Transaction batch to + be inserted into the soft block" + type: object + softblocks.BuildSoftBlockResponseBody: + properties: + blockHeader: + allOf: + - $ref: "#/definitions/types.Header" + description: "@param blockHeader types.Header of the soft block" + type: object + softblocks.RemoveSoftBlocksRequestBody: + properties: + newLastBlockId: + description: |- + @param newLastBlockID uint64 New last block ID of the blockchain, it should + @param not smaller than the canonical chain's highest block ID. + type: integer + type: object + softblocks.RemoveSoftBlocksResponseBody: + properties: + headsRemoved: + description: "@param headsRemoved uint64 Number of soft heads removed" + type: integer + lastBlockId: + description: + "@param lastBlockID uint64 Current highest block ID of the blockchain + (including soft blocks)" + type: integer + lastProposedBlockID: + description: + "@param lastProposedBlockID uint64 Highest block ID of the cnonical + chain" + type: integer + type: object + softblocks.SoftBlockParams: + properties: + anchorBlockID: + description: + "@param anchorBlockID uint64 `_anchorBlockId` parameter of the + `anchorV2` transaction in soft block" + type: integer + anchorStateRoot: + description: + "@param anchorStateRoot string `_anchorStateRoot` parameter of + the `anchorV2` transaction in soft block" + items: + type: integer + type: array + coinbase: + description: "@param coinbase string Coinbase of the soft block" + items: + type: integer + type: array + timestamp: + description: "@param timestamp uint64 Timestamp of the soft block" + type: integer + type: object + softblocks.TransactionBatch: + properties: + batchId: + description: "@param batchId uint64 ID of this transaction batch" + type: integer + batchType: + allOf: + - $ref: "#/definitions/softblocks.TransactionBatchMarker" + description: |- + @param batchType TransactionBatchMarker Marker of the transaction batch, + @param either `end_of_block`, `end_of_preconf` or empty + blockId: + description: "@param blockId uint64 Block ID of the soft block" + type: integer + blockParams: + allOf: + - $ref: "#/definitions/softblocks.SoftBlockParams" + description: + "@param blockParams SoftBlockParams Block parameters of the soft + block" + signature: + description: "@param signature string Signature of this transaction batch" + type: string + transactions: + description: + "@param transactions string zlib compressed RLP encoded bytes + of a transactions list" + items: + type: integer + type: array + type: object + softblocks.TransactionBatchMarker: + enum: + - "" + - endOfBlock + - endOfPreconf + type: string + x-enum-varnames: + - BatchMarkerEmpty + - BatchMarkerEOB + - BatchMarkerEOP + types.Header: + properties: + baseFeePerGas: + allOf: + - $ref: "#/definitions/big.Int" + description: BaseFee was added by EIP-1559 and is ignored in legacy headers. + blobGasUsed: + description: BlobGasUsed was added by EIP-4844 and is ignored in legacy headers. + type: integer + difficulty: + $ref: "#/definitions/big.Int" + excessBlobGas: + description: + ExcessBlobGas was added by EIP-4844 and is ignored in legacy + headers. + type: integer + extraData: + items: + type: integer + type: array + gasLimit: + type: integer + gasUsed: + type: integer + logsBloom: + items: + type: integer + type: array + miner: + items: + type: integer + type: array + mixHash: + items: + type: integer + type: array + nonce: + items: + type: integer + type: array + number: + $ref: "#/definitions/big.Int" + parentBeaconBlockRoot: + description: + ParentBeaconRoot was added by EIP-4788 and is ignored in legacy + headers. + items: + type: integer + type: array + parentHash: + items: + type: integer + type: array + receiptsRoot: + items: + type: integer + type: array + requestsRoot: + description: RequestsHash was added by EIP-7685 and is ignored in legacy headers. + items: + type: integer + type: array + sha3Uncles: + items: + type: integer + type: array + stateRoot: + items: + type: integer + type: array + timestamp: + type: integer + transactionsRoot: + items: + type: integer + type: array + withdrawalsRoot: + description: + WithdrawalsHash was added by EIP-4895 and is ignored in legacy + headers. + items: + type: integer + type: array + type: object +info: + contact: + email: info@taiko.xyz + name: API Support + url: https://community.taiko.xyz/ + license: + name: MIT + url: https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md + termsOfService: http://swagger.io/terms/ + title: Taiko Soft Block Server API + version: "1.0" +paths: + /healthz: + get: + consumes: + - application/json + operationId: health-check + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + summary: Get current server health status + /softBlocks: + delete: + consumes: + - application/json + description: |- + Remove all soft blocks from the blockchain beyond the specified block height, + ensuring the latest block ID does not exceed the given height. This method will fail if + the block with an ID one greater than the specified height is not a soft block. If the + specified block height is greater than the latest soft block ID, the method will succeed + without modifying the blockchain. + parameters: + - description: soft blocks removing request body + in: body + name: body + required: true + schema: + $ref: "#/definitions/softblocks.RemoveSoftBlocksRequestBody" + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: "#/definitions/softblocks.RemoveSoftBlocksResponseBody" + post: + consumes: + - application/json + description: |- + Insert a batch of transactions into a soft block for preconfirmation. If the batch is the + first for a block, a new soft block will be created. Otherwise, the transactions will + be appended to the existing soft block. The API will fail if: + 1) the block is not soft + 2) block-level parameters are invalid or do not match the current soft block’s parameters + 3) the batch ID is not exactly 1 greater than the previous one + 4) the last batch of the block indicates no further transactions are allowed + parameters: + - description: soft block creation request body + in: body + name: body + required: true + schema: + $ref: "#/definitions/softblocks.BuildSoftBlockRequestBody" + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: "#/definitions/softblocks.BuildSoftBlockResponseBody" +swagger: "2.0" diff --git a/packages/taiko-client/driver/chain_syncer/blob/soft_block.go b/packages/taiko-client/driver/chain_syncer/blob/soft_block.go new file mode 100644 index 00000000000..dc1b62a491c --- /dev/null +++ b/packages/taiko-client/driver/chain_syncer/blob/soft_block.go @@ -0,0 +1,298 @@ +package blob + +import ( + "context" + "errors" + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/beacon/engine" + "github.com/ethereum/go-ethereum/common" + consensus "github.com/ethereum/go-ethereum/consensus/taiko" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" + + "github.com/taikoxyz/taiko-mono/packages/taiko-client/bindings/encoding" + softblocks "github.com/taikoxyz/taiko-mono/packages/taiko-client/driver/soft_blocks" + "github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/rpc" + "github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/utils" +) + +// InsertSoftBlockFromTransactionsBatch inserts a soft block into the L2 execution engine's blockchain +// from the given transactions batch. +func (s *Syncer) InsertSoftBlockFromTransactionsBatch( + ctx context.Context, + blockID uint64, + batchID uint64, + txListBytes []byte, + batchMarker softblocks.TransactionBatchMarker, + blockParams *softblocks.SoftBlockParams, +) (*types.Header, error) { + s.mutex.Lock() + defer s.mutex.Unlock() + + parent, err := s.rpc.L2.HeaderByNumber(ctx, new(big.Int).Sub(new(big.Int).SetUint64(blockID), common.Big1)) + if err != nil { + return nil, err + } + + if parent.Number.Uint64()+1 != blockID { + return nil, fmt.Errorf("parent block number (%d) is not equal to blockID - 1 (%d)", parent.Number.Uint64(), blockID) + } + + // Calculate the other block parameters + difficultyHashPaylaod, err := encoding.EncodeDifficultyCalcutionParams(blockID) + if err != nil { + return nil, fmt.Errorf("failed to encode `block.difficulty` calculation parameters: %w", err) + } + protocolConfigs, err := rpc.GetProtocolConfigs(s.rpc.TaikoL1, &bind.CallOpts{Context: ctx}) + if err != nil { + return nil, fmt.Errorf("failed to fetch protocol configs: %w", err) + } + + var ( + txList []*types.Transaction + fc = &engine.ForkchoiceStateV1{HeadBlockHash: parent.Hash()} + difficulty = crypto.Keccak256Hash(difficultyHashPaylaod) + extraData = encoding.EncodeBaseFeeConfig(&protocolConfigs.BaseFeeConfig) + ) + + if err := rlp.DecodeBytes(txListBytes, &txList); err != nil { + return nil, fmt.Errorf("failed to RLP decode txList bytes: %w", err) + } + + baseFee, err := s.rpc.CalculateBaseFee( + ctx, + parent, + new(big.Int).SetUint64(blockParams.AnchorBlockID), + true, + &protocolConfigs.BaseFeeConfig, + blockParams.Timestamp, + ) + if err != nil { + return nil, fmt.Errorf("failed to calculate base fee: %w", err) + } + + // Insert the anchor transaction at the head of the transactions list. + if batchID == 0 { + // Assemble a TaikoL2.anchorV2 transaction. + anchorTx, err := s.anchorConstructor.AssembleAnchorV2Tx( + ctx, + new(big.Int).SetUint64(blockParams.AnchorBlockID), + blockParams.AnchorStateRoot, + parent.GasUsed, + &protocolConfigs.BaseFeeConfig, + new(big.Int).SetUint64(blockID), + baseFee, + ) + if err != nil { + return nil, fmt.Errorf("failed to create TaikoL2.anchorV2 transaction: %w", err) + } + + txList = append([]*types.Transaction{anchorTx}, txList...) + } else { + prevSoftBlock, err := s.rpc.L2.BlockByNumber(ctx, new(big.Int).SetUint64(blockID)) + if err != nil { + return nil, fmt.Errorf("failed to fetch previous soft block (%d): %w", blockID, err) + } + + // Ensure the previous soft block is the current chain head. + blockNums, err := s.rpc.L2.BlockNumber(ctx) + if err != nil { + return nil, fmt.Errorf("failed to fetch the chain block number: %w", err) + } + + if prevSoftBlock.Number().Uint64() != blockNums { + return nil, fmt.Errorf( + "soft block (%d) to update is not the current chain head (%d)", + prevSoftBlock.Number().Uint64(), + blockNums, + ) + } + + // Check baseFee + if prevSoftBlock.BaseFee().Cmp(baseFee) != 0 { + return nil, fmt.Errorf( + "baseFee is not equal to the latest soft block's, expect: %s, actual: %s", + prevSoftBlock.BaseFee().String(), + baseFee.String(), + ) + } + + // Check the previous soft block status. + l1Origin, err := s.rpc.L2.L1OriginByID(ctx, prevSoftBlock.Number()) + if err != nil { + return nil, fmt.Errorf("failed to fetch L1 origin for block %d: %w", blockID, err) + } + if l1Origin.BatchID == nil { + return nil, fmt.Errorf("batch ID is nil for block %d", blockID) + } + if l1Origin.BatchID.Uint64()+1 != batchID { + return nil, fmt.Errorf("batch ID mismatch: expected %d, got %d", l1Origin.BatchID.Uint64()+1, batchID) + } + if l1Origin.EndOfBlock { + return nil, fmt.Errorf("soft block %d has already been marked as ended", blockID) + } + if l1Origin.EndOfPreconf { + return nil, fmt.Errorf("preconfirmation from %s has already been marked as ended", blockParams.Coinbase) + } + + txList = append(prevSoftBlock.Transactions(), txList...) + } + + if txListBytes, err = rlp.EncodeToBytes(txList); err != nil { + log.Error("Encode txList error", "blockID", blockID, "error", err) + return nil, err + } + + attributes := &engine.PayloadAttributes{ + Timestamp: blockParams.Timestamp, + Random: difficulty, + SuggestedFeeRecipient: blockParams.Coinbase, + Withdrawals: []*types.Withdrawal{}, + BlockMetadata: &engine.BlockMetadata{ + Beneficiary: blockParams.Coinbase, + GasLimit: uint64(protocolConfigs.BlockMaxGasLimit) + consensus.AnchorGasLimit, + Timestamp: blockParams.Timestamp, + TxList: txListBytes, + MixHash: difficulty, + ExtraData: extraData[:], + }, + BaseFeePerGas: baseFee, + L1Origin: &rawdb.L1Origin{ + BlockID: new(big.Int).SetUint64(blockID), + L2BlockHash: common.Hash{}, // Will be set by taiko-geth. + L1BlockHeight: nil, // No L1 block height for soft blocks. + L1BlockHash: common.Hash{}, // No L1 block hash for soft blocks. + BatchID: new(big.Int).SetUint64(batchID), + EndOfBlock: batchMarker == softblocks.BatchMarkerEOB, + EndOfPreconf: batchMarker == softblocks.BatchMarkerEOP, + Preconfer: blockParams.Coinbase, + }, + } + + log.Info( + "Soft block payloadAttributes", + "blockID", blockID, + "batchID", batchID, + "timestamp", attributes.Timestamp, + "random", attributes.Random, + "suggestedFeeRecipient", attributes.SuggestedFeeRecipient, + "withdrawals", len(attributes.Withdrawals), + "gasLimit", attributes.BlockMetadata.GasLimit, + "timestamp", attributes.BlockMetadata.Timestamp, + "mixHash", attributes.BlockMetadata.MixHash, + "baseFee", utils.WeiToGWei(attributes.BaseFeePerGas), + "extraData", common.Bytes2Hex(attributes.BlockMetadata.ExtraData), + "transactions", len(txList), + ) + + // Step 1, prepare a payload + fcRes, err := s.rpc.L2Engine.ForkchoiceUpdate(ctx, fc, attributes) + if err != nil { + return nil, fmt.Errorf("failed to update fork choice: %w", err) + } + if fcRes.PayloadStatus.Status != engine.VALID { + return nil, fmt.Errorf("unexpected ForkchoiceUpdate response status: %s", fcRes.PayloadStatus.Status) + } + if fcRes.PayloadID == nil { + return nil, errors.New("empty payload ID") + } + + // Step 2, get the payload + payload, err := s.rpc.L2Engine.GetPayload(ctx, fcRes.PayloadID) + if err != nil { + return nil, fmt.Errorf("failed to get payload: %w", err) + } + + log.Info( + "Soft block payload", + "blockID", blockID, + "batchID", batchID, + "baseFee", utils.WeiToGWei(payload.BaseFeePerGas), + "number", payload.Number, + "hash", payload.BlockHash, + "gasLimit", payload.GasLimit, + "gasUsed", payload.GasUsed, + "timestamp", payload.Timestamp, + "withdrawalsHash", payload.WithdrawalsHash, + ) + + // Step 3, execute the payload + execStatus, err := s.rpc.L2Engine.NewPayload(ctx, payload) + if err != nil { + return nil, fmt.Errorf("failed to create a new payload: %w", err) + } + if execStatus.Status != engine.VALID { + return nil, fmt.Errorf("unexpected NewPayload response status: %s", execStatus.Status) + } + + lastVerifiedBlockHash, err := s.rpc.GetLastVerifiedBlockHash(ctx) + if err != nil { + return nil, fmt.Errorf("failed to fetch last verified block hash: %w", err) + } + + canonicalHead, err := s.rpc.L2.HeadL1Origin(ctx) + if err != nil { + return nil, fmt.Errorf("failed to fetch canonical head: %w", err) + } + + // Step 4, update the fork choice + fc = &engine.ForkchoiceStateV1{ + HeadBlockHash: payload.BlockHash, + SafeBlockHash: canonicalHead.L2BlockHash, + FinalizedBlockHash: lastVerifiedBlockHash, + } + fcRes, err = s.rpc.L2Engine.ForkchoiceUpdate(ctx, fc, nil) + if err != nil { + return nil, err + } + if fcRes.PayloadStatus.Status != engine.VALID { + return nil, fmt.Errorf("unexpected ForkchoiceUpdate response status: %s", fcRes.PayloadStatus.Status) + } + + header, err := s.rpc.L2.HeaderByHash(ctx, payload.BlockHash) + if err != nil { + return nil, err + } + + log.Info( + "⏰ New soft L2 block inserted", + "blockID", blockID, + "batchID", batchID, + "hash", header.Hash(), + "transactions", len(payload.Transactions), + "baseFee", utils.WeiToGWei(header.BaseFee), + "withdrawals", len(payload.Withdrawals), + "endOfBlock", attributes.L1Origin.EndOfBlock, + "endOfPreconf", attributes.L1Origin.EndOfPreconf, + ) + + return header, nil +} + +// RemoveSoftBlocks removes soft blocks from the L2 execution engine's blockchain. +func (s *Syncer) RemoveSoftBlocks(ctx context.Context, newLastBlockID uint64) error { + s.mutex.Lock() + defer s.mutex.Unlock() + + newHead, err := s.rpc.L2.HeaderByNumber(ctx, new(big.Int).SetUint64(newLastBlockID)) + if err != nil { + return err + } + + fc := &engine.ForkchoiceStateV1{HeadBlockHash: newHead.Hash()} + fcRes, err := s.rpc.L2Engine.ForkchoiceUpdate(ctx, fc, nil) + if err != nil { + return err + } + if fcRes.PayloadStatus.Status != engine.VALID { + return fmt.Errorf("unexpected ForkchoiceUpdate response status: %s", fcRes.PayloadStatus.Status) + } + + return nil +} diff --git a/packages/taiko-client/driver/chain_syncer/blob/syncer.go b/packages/taiko-client/driver/chain_syncer/blob/syncer.go index ec9e07375dd..f50582643c9 100644 --- a/packages/taiko-client/driver/chain_syncer/blob/syncer.go +++ b/packages/taiko-client/driver/chain_syncer/blob/syncer.go @@ -6,6 +6,7 @@ import ( "fmt" "math/big" "net/url" + "sync" "time" "github.com/ethereum/go-ethereum" @@ -46,6 +47,7 @@ type Syncer struct { reorgDetectedFlag bool maxRetrieveExponent uint64 blobDatasource *rpc.BlobDataSource + mutex sync.Mutex } // NewSyncer creates a new syncer instance. @@ -92,6 +94,8 @@ func NewSyncer( // ProcessL1Blocks fetches all `TaikoL1.BlockProposed` events between given // L1 block heights, and then tries inserting them into L2 execution engine's blockchain. func (s *Syncer) ProcessL1Blocks(ctx context.Context) error { + s.mutex.Lock() + defer s.mutex.Unlock() for { if err := s.processL1Blocks(ctx); err != nil { return err @@ -426,7 +430,7 @@ func (s *Syncer) insertNewHead( fc := &engine.ForkchoiceStateV1{ HeadBlockHash: payload.BlockHash, - SafeBlockHash: lastVerifiedBlockHash, + SafeBlockHash: payload.BlockHash, FinalizedBlockHash: lastVerifiedBlockHash, } @@ -482,7 +486,7 @@ func (s *Syncer) createExecutionPayloads( "timestamp", attributes.BlockMetadata.Timestamp, "mixHash", attributes.BlockMetadata.MixHash, "baseFee", utils.WeiToGWei(attributes.BaseFeePerGas), - "extraData", string(attributes.BlockMetadata.ExtraData), + "extraData", common.Bytes2Hex(attributes.BlockMetadata.ExtraData), "l1OriginHeight", attributes.L1Origin.L1BlockHeight, "l1OriginHash", attributes.L1Origin.L1BlockHash, ) diff --git a/packages/taiko-client/driver/chain_syncer/chain_syncer.go b/packages/taiko-client/driver/chain_syncer/chain_syncer.go index 6e17215d73d..5402b5766f6 100644 --- a/packages/taiko-client/driver/chain_syncer/chain_syncer.go +++ b/packages/taiko-client/driver/chain_syncer/chain_syncer.go @@ -182,15 +182,14 @@ func (s *L2ChainSyncer) needNewBeaconSyncTriggered() (uint64, bool, error) { // For full sync mode, we will use the verified block head, // and for snap sync mode, we will use the latest block head. - var ( - blockID uint64 - err error - ) + var blockID uint64 switch s.syncMode { case downloader.SnapSync.String(): - if blockID, err = s.rpc.L2CheckPoint.BlockNumber(s.ctx); err != nil { + headL1Origin, err := s.rpc.L2CheckPoint.HeadL1Origin(s.ctx) + if err != nil { return 0, false, err } + blockID = headL1Origin.BlockID.Uint64() case downloader.FullSync.String(): stateVars, err := s.rpc.GetProtocolStateVariables(&bind.CallOpts{Context: s.ctx}) if err != nil { diff --git a/packages/taiko-client/driver/config.go b/packages/taiko-client/driver/config.go index 3eb3b95e236..e393128c33b 100644 --- a/packages/taiko-client/driver/config.go +++ b/packages/taiko-client/driver/config.go @@ -17,12 +17,16 @@ import ( // Config contains the configurations to initialize a Taiko driver. type Config struct { *rpc.ClientConfig - P2PSync bool - P2PSyncTimeout time.Duration - RetryInterval time.Duration - MaxExponent uint64 - BlobServerEndpoint *url.URL - SocialScanEndpoint *url.URL + P2PSync bool + P2PSyncTimeout time.Duration + RetryInterval time.Duration + MaxExponent uint64 + BlobServerEndpoint *url.URL + SocialScanEndpoint *url.URL + SoftBlockServerPort uint64 + SoftBlockServerJWTSecret []byte + SoftBlockServerCORSOrigins string + SoftBlockServerCheckSig bool } // NewConfigFromCliContext creates a new config instance from @@ -69,6 +73,15 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { return nil, errors.New("empty L1 beacon endpoint, blob server and Social Scan endpoint") } + var softBlockServerJWTSecret []byte + if c.String(flags.SoftBlockServerJWTSecret.Name) != "" { + if softBlockServerJWTSecret, err = jwt.ParseSecretFromFile( + c.String(flags.SoftBlockServerJWTSecret.Name), + ); err != nil { + return nil, fmt.Errorf("invalid JWT secret file: %w", err) + } + } + var timeout = c.Duration(flags.RPCTimeout.Name) return &Config{ ClientConfig: &rpc.ClientConfig{ @@ -82,11 +95,15 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { JwtSecret: string(jwtSecret), Timeout: timeout, }, - RetryInterval: c.Duration(flags.BackOffRetryInterval.Name), - P2PSync: p2pSync, - P2PSyncTimeout: c.Duration(flags.P2PSyncTimeout.Name), - MaxExponent: c.Uint64(flags.MaxExponent.Name), - BlobServerEndpoint: blobServerEndpoint, - SocialScanEndpoint: socialScanEndpoint, + RetryInterval: c.Duration(flags.BackOffRetryInterval.Name), + P2PSync: p2pSync, + P2PSyncTimeout: c.Duration(flags.P2PSyncTimeout.Name), + MaxExponent: c.Uint64(flags.MaxExponent.Name), + BlobServerEndpoint: blobServerEndpoint, + SocialScanEndpoint: socialScanEndpoint, + SoftBlockServerPort: c.Uint64(flags.SoftBlockServerPort.Name), + SoftBlockServerJWTSecret: softBlockServerJWTSecret, + SoftBlockServerCORSOrigins: c.String(flags.SoftBlockServerCORSOrigins.Name), + SoftBlockServerCheckSig: c.Bool(flags.SoftBlockServerCheckSig.Name), }, nil } diff --git a/packages/taiko-client/driver/driver.go b/packages/taiko-client/driver/driver.go index a5990139dcb..64993c77602 100644 --- a/packages/taiko-client/driver/driver.go +++ b/packages/taiko-client/driver/driver.go @@ -16,6 +16,7 @@ import ( "github.com/urfave/cli/v2" chainSyncer "github.com/taikoxyz/taiko-mono/packages/taiko-client/driver/chain_syncer" + softblocks "github.com/taikoxyz/taiko-mono/packages/taiko-client/driver/soft_blocks" "github.com/taikoxyz/taiko-mono/packages/taiko-client/driver/state" "github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/rpc" ) @@ -29,9 +30,10 @@ const ( // contract. type Driver struct { *Config - rpc *rpc.Client - l2ChainSyncer *chainSyncer.L2ChainSyncer - state *state.State + rpc *rpc.Client + l2ChainSyncer *chainSyncer.L2ChainSyncer + softblockServer *softblocks.SoftBlockAPIServer + state *state.State l1HeadCh chan *types.Header l1HeadSub event.Subscription @@ -88,6 +90,18 @@ func (d *Driver) InitFromConfig(ctx context.Context, cfg *Config) (err error) { d.l1HeadSub = d.state.SubL1HeadsFeed(d.l1HeadCh) + if d.SoftBlockServerPort > 0 { + if d.softblockServer, err = softblocks.New( + d.SoftBlockServerCORSOrigins, + d.SoftBlockServerJWTSecret, + d.l2ChainSyncer.BlobSyncer(), + d.rpc, + d.Config.SoftBlockServerCheckSig, + ); err != nil { + return err + } + } + return nil } @@ -97,6 +111,15 @@ func (d *Driver) Start() error { go d.reportProtocolStatus() go d.exchangeTransitionConfigLoop() + // Start the soft block server if it is enabled. + if d.softblockServer != nil { + go func() { + if err := d.softblockServer.Start(d.SoftBlockServerPort); err != nil { + log.Crit("Failed to start soft block server", "error", err) + } + }() + } + return nil } @@ -104,6 +127,12 @@ func (d *Driver) Start() error { func (d *Driver) Close(_ context.Context) { d.l1HeadSub.Unsubscribe() d.state.Close() + // Close the soft block server if it is enabled. + if d.softblockServer != nil { + if err := d.softblockServer.Shutdown(d.ctx); err != nil { + log.Error("Failed to shutdown soft block server", "error", err) + } + } d.wg.Wait() } diff --git a/packages/taiko-client/driver/driver_test.go b/packages/taiko-client/driver/driver_test.go index 88d3b5c5520..cbcac077581 100644 --- a/packages/taiko-client/driver/driver_test.go +++ b/packages/taiko-client/driver/driver_test.go @@ -1,18 +1,28 @@ package driver import ( + "bytes" + "compress/zlib" "context" + "fmt" "math/big" + "net/url" "os" "testing" "time" "github.com/ethereum-optimism/optimism/op-service/txmgr" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/go-resty/resty/v2" "github.com/stretchr/testify/suite" "github.com/taikoxyz/taiko-mono/packages/taiko-client/bindings/encoding" + softblocks "github.com/taikoxyz/taiko-mono/packages/taiko-client/driver/soft_blocks" "github.com/taikoxyz/taiko-mono/packages/taiko-client/internal/testutils" "github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/jwt" "github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/rpc" @@ -345,6 +355,350 @@ func (s *DriverTestSuite) InitProposer() { s.p = p } +func (s *DriverTestSuite) TestInsertSoftBlocks() { + var ( + port = uint64(testutils.RandomPort()) + err error + ) + s.d.softblockServer, err = softblocks.New("*", nil, s.d.ChainSyncer().BlobSyncer(), s.RPCClient, true) + s.Nil(err) + go func() { s.NotNil(s.d.softblockServer.Start(port)) }() + defer func() { s.Nil(s.d.softblockServer.Shutdown(s.d.ctx)) }() + + url, err := url.Parse(fmt.Sprintf("http://localhost:%v", port)) + s.Nil(err) + + l2Head1, err := s.d.rpc.L2.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + s.Nil(s.d.ChainSyncer().BlobSyncer().ProcessL1Blocks(context.Background())) + + // Propose a valid L2 block + s.ProposeAndInsertValidBlock(s.p, s.d.ChainSyncer().BlobSyncer()) + + l2Head2, err := s.d.rpc.L2.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + l1Head1, err := s.d.rpc.L1.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + s.Greater(l2Head2.Number.Uint64(), l2Head1.Number.Uint64()) + + res, err := resty.New().R().Get(url.String() + "/healthz") + s.Nil(err) + s.True(res.IsSuccess()) + + // Try to insert a soft block with batch ID 0 + s.True(s.insertSoftBlock(url, l1Head1, l2Head2.Number.Uint64()+1, 0, false, false).IsSuccess()) + l2Head3, err := s.d.rpc.L2.BlockByNumber(context.Background(), nil) + s.Nil(err) + + s.Equal(2, len(l2Head3.Transactions())) + + l1Origin, err := s.RPCClient.L2.L1OriginByID(context.Background(), new(big.Int).Add(l2Head2.Number, common.Big1)) + s.Nil(err) + s.Equal(l2Head3.Number().Uint64(), l1Origin.BlockID.Uint64()) + s.Equal(l2Head3.Hash(), l1Origin.L2BlockHash) + s.Equal(uint64(0), l1Origin.L1BlockHeight.Uint64()) + s.Equal(common.Hash{}, l1Origin.L1BlockHash) + s.Equal(false, l1Origin.EndOfBlock) + s.Equal(false, l1Origin.EndOfPreconf) + s.Equal(uint64(0), l1Origin.BatchID.Uint64()) + s.True(l1Origin.IsSoftBlock()) + + // Try to patch a soft block with batch ID 1 + s.True(s.insertSoftBlock(url, l1Head1, l2Head2.Number.Uint64()+1, 1, true, false).IsSuccess()) + l2Head4, err := s.d.rpc.L2.BlockByNumber(context.Background(), nil) + s.Nil(err) + s.Equal(3, len(l2Head4.Transactions())) + s.Equal(l2Head3.Number().Uint64(), l2Head4.Number().Uint64()) + s.NotEqual(l2Head3.Hash(), l2Head4.Hash()) + + l1Origin2, err := s.RPCClient.L2.L1OriginByID(context.Background(), new(big.Int).Add(l2Head2.Number, common.Big1)) + s.Nil(err) + s.Equal(l2Head4.Number().Uint64(), l1Origin2.BlockID.Uint64()) + s.Equal(l2Head4.Hash(), l1Origin2.L2BlockHash) + s.Equal(uint64(0), l1Origin2.L1BlockHeight.Uint64()) + s.Equal(common.Hash{}, l1Origin2.L1BlockHash) + s.Equal(true, l1Origin2.EndOfBlock) + s.Equal(false, l1Origin2.EndOfPreconf) + s.Equal(uint64(1), l1Origin2.BatchID.Uint64()) + s.True(l1Origin2.IsSoftBlock()) + + canonicalL1Origin, err := s.RPCClient.L2.HeadL1Origin(context.Background()) + s.Nil(err) + s.Equal(l2Head2.Number.Uint64(), canonicalL1Origin.BlockID.Uint64()) + + // Try to patch an ended soft block + s.False(s.insertSoftBlock(url, l1Head1, l2Head2.Number.Uint64()+1, 1, true, false).IsSuccess()) + + // Try to insert a new soft block with batch ID 0 + s.True(s.insertSoftBlock(url, l1Head1, l2Head2.Number.Uint64()+2, 0, false, false).IsSuccess()) + l2Head5, err := s.d.rpc.L2.BlockByNumber(context.Background(), nil) + s.Nil(err) + s.Equal(2, len(l2Head5.Transactions())) + + // Propose 3 valid L2 blocks + s.ProposeAndInsertEmptyBlocks(s.p, s.d.ChainSyncer().BlobSyncer()) + + l2Head6, err := s.d.rpc.L2.BlockByNumber(context.Background(), l2Head3.Number()) + s.Nil(err) + s.Equal(l2Head3.Number().Uint64(), l2Head6.Number().Uint64()) + s.Equal(1, len(l2Head6.Transactions())) + + l1Origin3, err := s.RPCClient.L2.L1OriginByID(context.Background(), l2Head6.Number()) + s.Nil(err) + s.Equal(l2Head3.Number().Uint64(), l1Origin3.BlockID.Uint64()) + s.Equal(l2Head6.Hash(), l1Origin3.L2BlockHash) + s.NotZero(l1Origin3.L1BlockHeight.Uint64()) + s.NotEmpty(l1Origin3.L1BlockHash) + s.Equal(false, l1Origin3.EndOfBlock) + s.Equal(false, l1Origin3.EndOfPreconf) + s.Nil(l1Origin3.BatchID) + s.False(l1Origin3.IsSoftBlock()) +} + +func (s *DriverTestSuite) TestInsertSoftBlocksAfterEOB() { + var ( + port = uint64(testutils.RandomPort()) + epochs = testutils.RandomHash().Big().Uint64()%10 + 5 + err error + ) + s.d.softblockServer, err = softblocks.New("*", nil, s.d.ChainSyncer().BlobSyncer(), s.RPCClient, true) + s.Nil(err) + go func() { s.NotNil(s.d.softblockServer.Start(port)) }() + defer func() { s.Nil(s.d.softblockServer.Shutdown(s.d.ctx)) }() + + url, err := url.Parse(fmt.Sprintf("http://localhost:%v", port)) + s.Nil(err) + + headL1Origin, err := s.RPCClient.L2.HeadL1Origin(context.Background()) + s.Nil(err) + + for range headL1Origin.BlockID.Uint64() + epochs + 1 { + s.ProposeAndInsertEmptyBlocks(s.p, s.d.ChainSyncer().BlobSyncer()) + } + + l1Head, err := s.d.rpc.L1.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + l2Head, err := s.d.rpc.L2.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + for i := range epochs { + s.True(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+1+i, 0, false, false).IsSuccess()) + s.True(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+1+i, 1, true, false).IsSuccess()) + s.False(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+1+i, 0, true, false).IsSuccess()) + } + s.True(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+1+epochs, 0, true, false).IsSuccess()) + s.False(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+1+epochs, 1, false, false).IsSuccess()) + s.True(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+2+epochs, 0, false, true).IsSuccess()) + s.False(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+2+epochs, 1, true, false).IsSuccess()) + + l2Head2, err := s.d.rpc.L2.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + s.Equal(l2Head.Number.Uint64()+2+epochs, l2Head2.Number.Uint64()) + + l1Origin, err := s.RPCClient.L2.L1OriginByID(context.Background(), l2Head2.Number) + s.Nil(err) + + s.Equal(l2Head2.Number.Uint64(), l1Origin.BlockID.Uint64()) + s.Equal(false, l1Origin.EndOfBlock) + s.Equal(true, l1Origin.EndOfPreconf) + s.True(l1Origin.IsSoftBlock()) + + headL1Origin, err = s.RPCClient.L2.HeadL1Origin(context.Background()) + s.Nil(err) + s.Equal(l2Head.Number.Uint64(), headL1Origin.BlockID.Uint64()) + s.False(headL1Origin.IsSoftBlock()) + + s.ProposeAndInsertEmptyBlocks(s.p, s.d.ChainSyncer().BlobSyncer()) + + l2Head3, err := s.d.rpc.L2.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + s.Less(l2Head3.Number.Uint64(), l2Head2.Number.Uint64()) + headL1Origin, err = s.RPCClient.L2.HeadL1Origin(context.Background()) + s.Nil(err) + s.Equal(l2Head3.Number.Uint64(), headL1Origin.BlockID.Uint64()) + s.False(headL1Origin.IsSoftBlock()) +} + +func (s *DriverTestSuite) TestInsertSoftBlocksAfterEOP() { + var ( + port = uint64(testutils.RandomPort()) + epochs = testutils.RandomHash().Big().Uint64() % 5 + err error + ) + s.d.softblockServer, err = softblocks.New("*", nil, s.d.ChainSyncer().BlobSyncer(), s.RPCClient, true) + s.Nil(err) + go func() { s.NotNil(s.d.softblockServer.Start(port)) }() + defer func() { s.Nil(s.d.softblockServer.Shutdown(s.d.ctx)) }() + + url, err := url.Parse(fmt.Sprintf("http://localhost:%v", port)) + s.Nil(err) + + headL1Origin, err := s.RPCClient.L2.HeadL1Origin(context.Background()) + s.Nil(err) + + for range headL1Origin.BlockID.Uint64() + epochs + 1 { + s.ProposeAndInsertEmptyBlocks(s.p, s.d.ChainSyncer().BlobSyncer()) + } + + l1Head, err := s.d.rpc.L1.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + l2Head, err := s.d.rpc.L2.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + for i := range epochs { + s.True(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+1, i, false, false).IsSuccess()) + + latestSafeBlock, err := s.RPCClient.L2.HeaderByNumber(context.Background(), big.NewInt(-4)) + s.Nil(err) + s.Equal(l2Head.Number.Uint64(), latestSafeBlock.Number.Uint64()) + + latestFinalizedBlock, err := s.RPCClient.L2.HeaderByNumber(context.Background(), big.NewInt(-3)) + s.Nil(err) + s.Equal(uint64(0), latestFinalizedBlock.Number.Uint64()) + } + s.True(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+1, epochs, false, true).IsSuccess()) + s.False(s.insertSoftBlock(url, l1Head, l2Head.Number.Uint64()+1, epochs+1, false, false).IsSuccess()) + + latestSafeBlock, err := s.RPCClient.L2.HeaderByNumber(context.Background(), big.NewInt(-4)) + s.Nil(err) + s.Equal(l2Head.Number.Uint64(), latestSafeBlock.Number.Uint64()) + + l2Head2, err := s.d.rpc.L2.HeaderByNumber(context.Background(), nil) + s.Nil(err) + + // Remove soft blocks + res, err := resty.New(). + R(). + SetBody(&softblocks.RemoveSoftBlocksRequestBody{ + NewLastBlockID: l2Head2.Number.Uint64() - 1, + }). + Delete(url.String() + "/softBlocks") + s.Nil(err) + s.True(res.IsSuccess()) + + l2Head3, err := s.d.rpc.L2.HeaderByNumber(context.Background(), nil) + s.Nil(err) + s.Equal(l2Head2.Number.Uint64()-1, l2Head3.Number.Uint64()) + + latestFinalizedBlock, err := s.RPCClient.L2.HeaderByNumber(context.Background(), big.NewInt(-3)) + s.Nil(err) + s.Equal(uint64(0), latestFinalizedBlock.Number.Uint64()) +} + func TestDriverTestSuite(t *testing.T) { suite.Run(t, new(DriverTestSuite)) } + +// insertSoftBlock inserts a soft block with the given parameters. +func (s *DriverTestSuite) insertSoftBlock( + url *url.URL, + anchoredL1Block *types.Header, + l2BlockID uint64, + batchID uint64, + endOfBlock bool, + endOfPreconf bool, +) *resty.Response { + preconferPrivKey, err := crypto.ToECDSA(common.FromHex(os.Getenv("L1_PROPOSER_PRIVATE_KEY"))) + s.Nil(err) + + preconferAddress := crypto.PubkeyToAddress(preconferPrivKey.PublicKey) + + nonce, err := s.RPCClient.L2.NonceAt(context.Background(), s.TestAddr, nil) + s.Nil(err) + + tx := types.NewTransaction( + nonce, + common.BytesToAddress(testutils.RandomBytes(32)), + common.Big0, + 100_000, + new(big.Int).SetUint64(uint64(10*params.GWei)), + []byte{}, + ) + signedTx, err := types.SignTx(tx, types.LatestSignerForChainID(s.RPCClient.L2.ChainID), s.TestAddrPrivKey) + s.Nil(err) + + // If the transaction is underpriced, we just ingore it. + err = s.RPCClient.L2.SendTransaction(context.Background(), signedTx) + if err != nil { + s.Equal("replacement transaction underpriced", err.Error()) + } + + b, err := encodeAndCompressTxList([]*types.Transaction{signedTx}) + s.Nil(err) + + var marker softblocks.TransactionBatchMarker + if endOfBlock { + marker = softblocks.BatchMarkerEOB + } else if endOfPreconf { + marker = softblocks.BatchMarkerEOP + } else { + marker = softblocks.BatchMarkerEmpty + } + + txBatch := &softblocks.TransactionBatch{ + BlockID: l2BlockID, + ID: batchID, + TransactionsList: b, + BatchMarker: marker, + Signature: "", + BlockParams: &softblocks.SoftBlockParams{ + AnchorBlockID: anchoredL1Block.Number.Uint64(), + AnchorStateRoot: anchoredL1Block.Root, + Timestamp: anchoredL1Block.Time + 12, + Coinbase: preconferAddress, + }, + } + + payload, err := rlp.EncodeToBytes(txBatch) + s.Nil(err) + s.NotEmpty(payload) + + sig, err := crypto.Sign(crypto.Keccak256(payload), preconferPrivKey) + s.Nil(err) + txBatch.Signature = common.Bytes2Hex(sig) + + // Try to propose a soft block with batch ID 0 + res, err := resty.New(). + R(). + SetBody(&softblocks.BuildSoftBlockRequestBody{ + TransactionBatch: txBatch, + }). + Post(url.String() + "/softBlocks") + s.Nil(err) + log.Info("Soft block response", "body", res.String()) + return res +} + +// compress compresses the given txList bytes using zlib. +func compress(txListBytes []byte) ([]byte, error) { + var b bytes.Buffer + w := zlib.NewWriter(&b) + defer w.Close() + + if _, err := w.Write(txListBytes); err != nil { + return nil, err + } + + if err := w.Flush(); err != nil { + return nil, err + } + + return b.Bytes(), nil +} + +// encodeAndCompressTxList encodes and compresses the given transactions list. +func encodeAndCompressTxList(txs types.Transactions) ([]byte, error) { + b, err := rlp.EncodeToBytes(txs) + if err != nil { + return nil, err + } + + return compress(b) +} diff --git a/packages/taiko-client/driver/soft_blocks/api.go b/packages/taiko-client/driver/soft_blocks/api.go new file mode 100644 index 00000000000..f5b687fb604 --- /dev/null +++ b/packages/taiko-client/driver/soft_blocks/api.go @@ -0,0 +1,304 @@ +package softblocks + +import ( + "errors" + "math/big" + "net/http" + + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" + "github.com/labstack/echo/v4" +) + +// TransactionBatchMarker represents the status of a soft block transactions group. +type TransactionBatchMarker string + +// BatchMarker valid values. +const ( + BatchMarkerEmpty TransactionBatchMarker = "" + BatchMarkerEOB TransactionBatchMarker = "endOfBlock" + BatchMarkerEOP TransactionBatchMarker = "endOfPreconf" +) + +// SoftBlockParams represents the parameters for building a soft block. +type SoftBlockParams struct { + // @param timestamp uint64 Timestamp of the soft block + Timestamp uint64 `json:"timestamp"` + // @param coinbase string Coinbase of the soft block + Coinbase common.Address `json:"coinbase"` + + // @param anchorBlockID uint64 `_anchorBlockId` parameter of the `anchorV2` transaction in soft block + AnchorBlockID uint64 `json:"anchorBlockID"` + // @param anchorStateRoot string `_anchorStateRoot` parameter of the `anchorV2` transaction in soft block + AnchorStateRoot common.Hash `json:"anchorStateRoot"` +} + +// TransactionBatch represents a soft block group. +type TransactionBatch struct { + // @param blockId uint64 Block ID of the soft block + BlockID uint64 `json:"blockId"` + // @param batchId uint64 ID of this transaction batch + ID uint64 `json:"batchId"` + // @param transactions string zlib compressed RLP encoded bytes of a transactions list + TransactionsList []byte `json:"transactions"` + // @param batchType TransactionBatchMarker Marker of the transaction batch, + // @param either `end_of_block`, `end_of_preconf` or empty + BatchMarker TransactionBatchMarker `json:"batchType"` + // @param signature string Signature of this transaction batch + Signature string `json:"signature" rlp:"-"` + // @param blockParams SoftBlockParams Block parameters of the soft block + BlockParams *SoftBlockParams `json:"blockParams"` +} + +// ValidateSignature validates the signature of the transaction batch. +func (b *TransactionBatch) ValidateSignature() (bool, error) { + payload, err := rlp.EncodeToBytes(b) + if err != nil { + return false, err + } + + pubKey, err := crypto.SigToPub(crypto.Keccak256(payload), common.FromHex(b.Signature)) + if err != nil { + return false, err + } + + return crypto.PubkeyToAddress(*pubKey).Hex() == b.BlockParams.Coinbase.Hex(), nil +} + +// BuildSoftBlockRequestBody represents a request body when handling +// soft blocks creation requests. +type BuildSoftBlockRequestBody struct { + // @param transactionBatch TransactionBatch Transaction batch to be inserted into the soft block + TransactionBatch *TransactionBatch `json:"transactionBatch"` +} + +// CreateOrUpdateBlocksFromBatchResponseBody represents a response body when handling soft +// blocks creation requests. +type BuildSoftBlockResponseBody struct { + // @param blockHeader types.Header of the soft block + BlockHeader *types.Header `json:"blockHeader"` +} + +// BuildSoftBlock handles a soft block creation request, +// if the soft block transactions batch in request are valid, it will insert or reorg the correspoinding the soft +// block to the backend L2 execution engine and return a success response. +// +// @Description Insert a batch of transactions into a soft block for preconfirmation. If the batch is the +// @Description first for a block, a new soft block will be created. Otherwise, the transactions will +// @Description be appended to the existing soft block. The API will fail if: +// @Description 1) the block is not soft +// @Description 2) block-level parameters are invalid or do not match the current soft block’s parameters +// @Description 3) the batch ID is not exactly 1 greater than the previous one +// @Description 4) the last batch of the block indicates no further transactions are allowed +// @Param body body BuildSoftBlockRequestBody true "soft block creation request body" +// @Accept json +// @Produce json +// @Success 200 {object} BuildSoftBlockResponseBody +// @Router /softBlocks [post] +func (s *SoftBlockAPIServer) BuildSoftBlock(c echo.Context) error { + // Parse the request body. + reqBody := new(BuildSoftBlockRequestBody) + if err := c.Bind(reqBody); err != nil { + return s.returnError(c, http.StatusUnprocessableEntity, err) + } + if reqBody.TransactionBatch == nil { + return s.returnError(c, http.StatusBadRequest, errors.New("transactionBatch is required")) + } + + log.Info( + "New soft block building request", + "blockID", reqBody.TransactionBatch.BlockID, + "batchID", reqBody.TransactionBatch.ID, + "batchMarker", reqBody.TransactionBatch.BatchMarker, + "transactionsListBytes", len(reqBody.TransactionBatch.TransactionsList), + "signature", reqBody.TransactionBatch.Signature, + "timestamp", reqBody.TransactionBatch.BlockParams.Timestamp, + "coinbase", reqBody.TransactionBatch.BlockParams.Coinbase, + "anchorBlockID", reqBody.TransactionBatch.BlockParams.AnchorBlockID, + "anchorStateRoot", reqBody.TransactionBatch.BlockParams.AnchorStateRoot, + ) + + // Request body validation. + if reqBody.TransactionBatch.BlockParams == nil { + return s.returnError(c, http.StatusBadRequest, errors.New("blockParams is required")) + } + if reqBody.TransactionBatch.BlockParams.AnchorBlockID == 0 { + return s.returnError(c, http.StatusBadRequest, errors.New("non-zero anchorBlockID is required")) + } + if reqBody.TransactionBatch.BlockParams.AnchorStateRoot == (common.Hash{}) { + return s.returnError(c, http.StatusBadRequest, errors.New("empty anchorStateRoot")) + } + if reqBody.TransactionBatch.BlockParams.Timestamp == 0 { + return s.returnError(c, http.StatusBadRequest, errors.New("non-zero timestamp is required")) + } + if reqBody.TransactionBatch.BlockParams.Coinbase == (common.Address{}) { + return s.returnError(c, http.StatusBadRequest, errors.New("empty coinbase")) + } + + // If the `--softBlock.signatureCheck` flag is enabled, validate the signature. + if s.checkSig { + ok, err := reqBody.TransactionBatch.ValidateSignature() + if err != nil { + return c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()}) + } + if !ok { + log.Warn( + "Invalid signature", + "signature", reqBody.TransactionBatch.Signature, + "coinbase", reqBody.TransactionBatch.BlockParams.Coinbase.Hex(), + ) + return s.returnError(c, http.StatusBadRequest, errors.New("invalid signature")) + } + } + + // Check if the L2 execution engine is syncing from L1. + progress, err := s.rpc.L2ExecutionEngineSyncProgress(c.Request().Context()) + if err != nil { + return c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()}) + } + if progress.IsSyncing() { + return s.returnError(c, http.StatusBadRequest, errors.New("L2 execution engine is syncing")) + } + + // Check if the softblock batch or the current preconf process is ended. + l1Origin, err := s.rpc.L2.L1OriginByID( + c.Request().Context(), + new(big.Int).SetUint64(reqBody.TransactionBatch.BlockID), + ) + if err != nil && err.Error() != ethereum.NotFound.Error() { + return s.returnError(c, http.StatusInternalServerError, err) + } + if l1Origin != nil { + if l1Origin.EndOfBlock { + return s.returnError(c, http.StatusBadRequest, errors.New("soft block has already been marked as ended")) + } + if l1Origin.EndOfPreconf { + return s.returnError( + c, + http.StatusBadRequest, + errors.New("preconfirmation has already been marked as ended"), + ) + } + } + + // Insert the soft block. + header, err := s.chainSyncer.InsertSoftBlockFromTransactionsBatch( + c.Request().Context(), + reqBody.TransactionBatch.BlockID, + reqBody.TransactionBatch.ID, + s.txListDecompressor.TryDecompress( + s.rpc.L2.ChainID, + new(big.Int).SetUint64(reqBody.TransactionBatch.BlockID), + reqBody.TransactionBatch.TransactionsList, + true, + ), + reqBody.TransactionBatch.BatchMarker, + reqBody.TransactionBatch.BlockParams, + ) + if err != nil { + return s.returnError(c, http.StatusInternalServerError, err) + } + + return c.JSON(http.StatusOK, BuildSoftBlockResponseBody{BlockHeader: header}) +} + +// RemoveSoftBlocksRequestBody represents a request body when resetting the backend +// L2 execution engine soft head. +type RemoveSoftBlocksRequestBody struct { + // @param newLastBlockID uint64 New last block ID of the blockchain, it should + // @param not smaller than the canonical chain's highest block ID. + NewLastBlockID uint64 `json:"newLastBlockId"` +} + +// RemoveSoftBlocksResponseBody represents a response body when resetting the backend +// L2 execution engine soft head. +type RemoveSoftBlocksResponseBody struct { + // @param lastBlockID uint64 Current highest block ID of the blockchain (including soft blocks) + LastBlockID uint64 `json:"lastBlockId"` + // @param lastProposedBlockID uint64 Highest block ID of the cnonical chain + LastProposedBlockID uint64 `json:"lastProposedBlockID"` + // @param headsRemoved uint64 Number of soft heads removed + HeadsRemoved uint64 `json:"headsRemoved"` +} + +// RemoveSoftBlocks removes the backend L2 execution engine soft head. +// +// @Description Remove all soft blocks from the blockchain beyond the specified block height, +// @Description ensuring the latest block ID does not exceed the given height. This method will fail if +// @Description the block with an ID one greater than the specified height is not a soft block. If the +// @Description specified block height is greater than the latest soft block ID, the method will succeed +// @Description without modifying the blockchain. +// @Param body body RemoveSoftBlocksRequestBody true "soft blocks removing request body" +// @Accept json +// @Produce json +// @Success 200 {object} RemoveSoftBlocksResponseBody +// @Router /softBlocks [delete] +func (s *SoftBlockAPIServer) RemoveSoftBlocks(c echo.Context) error { + // Parse the request body. + reqBody := new(RemoveSoftBlocksRequestBody) + if err := c.Bind(reqBody); err != nil { + return s.returnError(c, http.StatusUnprocessableEntity, err) + } + + // Request body validation. + canonicalHeadL1Origin, err := s.rpc.L2.HeadL1Origin(c.Request().Context()) + if err != nil { + return s.returnError(c, http.StatusInternalServerError, err) + } + + currentHead, err := s.rpc.L2.HeaderByNumber(c.Request().Context(), nil) + if err != nil { + return s.returnError(c, http.StatusInternalServerError, err) + } + + log.Info( + "New soft block removing request", + "newLastBlockId", reqBody.NewLastBlockID, + "canonicalHead", canonicalHeadL1Origin.BlockID.Uint64(), + "currentHead", currentHead.Number.Uint64(), + ) + + if reqBody.NewLastBlockID < canonicalHeadL1Origin.BlockID.Uint64() { + return s.returnError( + c, + http.StatusBadRequest, + errors.New("newLastBlockId must not be smaller than the canonical chain's highest block ID"), + ) + } + + if err := s.chainSyncer.RemoveSoftBlocks(c.Request().Context(), reqBody.NewLastBlockID); err != nil { + return s.returnError(c, http.StatusBadRequest, err) + } + + newHead, err := s.rpc.L2.HeaderByNumber(c.Request().Context(), nil) + if err != nil { + return s.returnError(c, http.StatusInternalServerError, err) + } + + return c.JSON(http.StatusOK, RemoveSoftBlocksResponseBody{ + LastBlockID: newHead.Number.Uint64(), + LastProposedBlockID: canonicalHeadL1Origin.BlockID.Uint64(), + HeadsRemoved: currentHead.Number.Uint64() - newHead.Number.Uint64(), + }) +} + +// HealthCheck is the endpoints for probes. +// +// @Summary Get current server health status +// @ID health-check +// @Accept json +// @Produce json +// @Success 200 {object} string +// @Router /healthz [get] +func (s *SoftBlockAPIServer) HealthCheck(c echo.Context) error { + return c.NoContent(http.StatusOK) +} + +// returnError is a helper function to return an error response. +func (s *SoftBlockAPIServer) returnError(c echo.Context, statusCode int, err error) error { + return c.JSON(statusCode, map[string]string{"error": err.Error()}) +} diff --git a/packages/taiko-client/driver/soft_blocks/server.go b/packages/taiko-client/driver/soft_blocks/server.go new file mode 100644 index 00000000000..e27cac912fd --- /dev/null +++ b/packages/taiko-client/driver/soft_blocks/server.go @@ -0,0 +1,130 @@ +package softblocks + +import ( + "context" + "fmt" + "os" + + "github.com/ethereum/go-ethereum/core/types" + echojwt "github.com/labstack/echo-jwt/v4" + "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" + + txListDecompressor "github.com/taikoxyz/taiko-mono/packages/taiko-client/driver/txlist_decompressor" + "github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/rpc" +) + +// softBlockChainSyncer is an interface for soft block chain syncer. +type softBlockChainSyncer interface { + InsertSoftBlockFromTransactionsBatch( + ctx context.Context, + blockID uint64, + batchID uint64, + txListBytes []byte, + batchMarker TransactionBatchMarker, + softBlockParams *SoftBlockParams, + ) (*types.Header, error) + RemoveSoftBlocks(ctx context.Context, newLastBlockID uint64) error +} + +// @title Taiko Soft Block Server API +// @version 1.0 +// @termsOfService http://swagger.io/terms/ + +// @contact.name API Support +// @contact.url https://community.taiko.xyz/ +// @contact.email info@taiko.xyz + +// @license.name MIT +// @license.url https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md +// SoftBlockAPIServer represents a soft blcok server instance. +type SoftBlockAPIServer struct { + echo *echo.Echo + chainSyncer softBlockChainSyncer + rpc *rpc.Client + txListDecompressor *txListDecompressor.TxListDecompressor + checkSig bool +} + +// New creates a new soft blcok server instance, and starts the server. +func New( + cors string, + jwtSecret []byte, + chainSyncer softBlockChainSyncer, + cli *rpc.Client, + checkSig bool, +) (*SoftBlockAPIServer, error) { + protocolConfigs, err := rpc.GetProtocolConfigs(cli.TaikoL1, nil) + if err != nil { + return nil, fmt.Errorf("failed to fetch protocol configs: %w", err) + } + + server := &SoftBlockAPIServer{ + echo: echo.New(), + chainSyncer: chainSyncer, + txListDecompressor: txListDecompressor.NewTxListDecompressor( + uint64(protocolConfigs.BlockMaxGasLimit), + rpc.BlockMaxTxListBytes, + cli.L2.ChainID, + ), + rpc: cli, + checkSig: checkSig, + } + + server.echo.HideBanner = true + server.configureMiddleware([]string{cors}) + server.configureRoutes() + if jwtSecret != nil { + server.echo.Use(echojwt.JWT(jwtSecret)) + } + + return server, nil +} + +// LogSkipper implements the `middleware.Skipper` interface. +func LogSkipper(c echo.Context) bool { + switch c.Request().URL.Path { + case "/healthz": + return true + default: + return true + } +} + +// configureMiddleware configures the server middlewares. +func (s *SoftBlockAPIServer) configureMiddleware(corsOrigins []string) { + s.echo.Use(middleware.RequestID()) + + s.echo.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{ + Skipper: LogSkipper, + Format: `{"time":"${time_rfc3339_nano}","level":"INFO","message":{"id":"${id}","remote_ip":"${remote_ip}",` + + `"host":"${host}","method":"${method}","uri":"${uri}","user_agent":"${user_agent}",` + + `"response_status":${status},"error":"${error}","latency":${latency},"latency_human":"${latency_human}",` + + `"bytes_in":${bytes_in},"bytes_out":${bytes_out}}}` + "\n", + Output: os.Stdout, + })) + + // Add CORS middleware + s.echo.Use(middleware.CORSWithConfig(middleware.CORSConfig{ + AllowOrigins: corsOrigins, + AllowCredentials: true, + })) +} + +// Start starts the HTTP server. +func (s *SoftBlockAPIServer) Start(port uint64) error { + return s.echo.Start(fmt.Sprintf(":%v", port)) +} + +// Shutdown shuts down the HTTP server. +func (s *SoftBlockAPIServer) Shutdown(ctx context.Context) error { + return s.echo.Shutdown(ctx) +} + +// configureRoutes contains all routes which will be used by prover server. +func (s *SoftBlockAPIServer) configureRoutes() { + s.echo.GET("/", s.HealthCheck) + s.echo.GET("/healthz", s.HealthCheck) + s.echo.POST("/softBlocks", s.BuildSoftBlock) + s.echo.DELETE("/softBlocks", s.RemoveSoftBlocks) +} diff --git a/packages/taiko-client/driver/soft_blocks/server_test.go b/packages/taiko-client/driver/soft_blocks/server_test.go new file mode 100644 index 00000000000..c1aa66d1777 --- /dev/null +++ b/packages/taiko-client/driver/soft_blocks/server_test.go @@ -0,0 +1,36 @@ +package softblocks + +import ( + "context" + "testing" + + "github.com/ethereum/go-ethereum/log" + "github.com/stretchr/testify/suite" + + "github.com/taikoxyz/taiko-mono/packages/taiko-client/internal/testutils" +) + +type SoftBlockAPIServerTestSuite struct { + testutils.ClientTestSuite + s *SoftBlockAPIServer +} + +func (s *SoftBlockAPIServerTestSuite) SetupTest() { + s.ClientTestSuite.SetupTest() + server, err := New("*", nil, nil, s.RPCClient, true) + s.Nil(err) + s.s = server + go func() { + s.NotPanics(func() { + log.Error("Start test soft block server", "error", s.s.Start(uint64(testutils.RandomPort()))) + }) + }() +} + +func (s *SoftBlockAPIServerTestSuite) TestShutdown() { + s.Nil(s.s.Shutdown(context.Background())) +} + +func TestSoftBlockAPIServerTestSuite(t *testing.T) { + suite.Run(t, new(SoftBlockAPIServerTestSuite)) +} diff --git a/packages/taiko-client/integration_test/hive_test.go b/packages/taiko-client/integration_test/hive_test.go index 24400119a7d..8e6a3a07cc0 100644 --- a/packages/taiko-client/integration_test/hive_test.go +++ b/packages/taiko-client/integration_test/hive_test.go @@ -80,6 +80,7 @@ func testBlobAPI(t *testing.T, pattern string, clients []string) { handler, err := hivesim.NewHiveFramework(&hivesim.HiveConfig{ BuildOutput: false, ContainerOutput: true, + DockerPull: false, BaseDir: os.Getenv("HIVE_DIR"), SimPattern: "taiko", SimTestPattern: pattern, diff --git a/packages/taiko-client/internal/docker/nodes/docker-compose.yml b/packages/taiko-client/internal/docker/nodes/docker-compose.yml index 944f857cad5..3da01faf1c4 100644 --- a/packages/taiko-client/internal/docker/nodes/docker-compose.yml +++ b/packages/taiko-client/internal/docker/nodes/docker-compose.yml @@ -16,7 +16,7 @@ services: l2_geth: container_name: l2_geth - image: us-docker.pkg.dev/evmchain/images/taiko-geth:taiko + image: us-docker.pkg.dev/evmchain/images/taiko-geth:softblock restart: unless-stopped pull_policy: always volumes: diff --git a/packages/taiko-client/pkg/rpc/methods.go b/packages/taiko-client/pkg/rpc/methods.go index 109d7f5f53d..0e27f3f3a5e 100644 --- a/packages/taiko-client/pkg/rpc/methods.go +++ b/packages/taiko-client/pkg/rpc/methods.go @@ -119,7 +119,7 @@ func (c *Client) WaitTillL2ExecutionEngineSynced(ctx context.Context) error { return err } - if progress.isSyncing() { + if progress.IsSyncing() { log.Info( "L2 execution engine is syncing", "currentBlockID", progress.CurrentBlockID, @@ -332,23 +332,50 @@ func (c *Client) GetPoolContent( ctxWithTimeout, cancel := CtxWithTimeoutOrDefault(ctx, defaultTimeout) defer cancel() - l1Head, err := c.L1.HeaderByNumber(ctx, nil) + // Get the latest L2 block header at first. + l2Head, err := c.L2.HeaderByNumber(ctx, nil) if err != nil { return nil, err } - l2Head, err := c.L2.HeaderByNumber(ctx, nil) + l1Origin, err := c.L2.L1OriginByID(ctx, l2Head.Number) + if err != nil && err.Error() != ethereum.NotFound.Error() { + return nil, err + } + + var ( + L1HeadNum *big.Int + L2HeadNum *big.Int + timestamp = uint64(time.Now().Unix()) + ) + + if l1Origin != nil && l1Origin.IsSoftBlock() && !l1Origin.EndOfPreconf && !l1Origin.EndOfBlock { + // Check if this is an unfinished soft block, if not, we will use the latest L1 / L2 block number from the L1Origin. + // Otherwise, we will use the L1 / L2 block number in L1Origin. + L1HeadNum = l1Origin.L1BlockHeight + L2HeadNum = new(big.Int).Sub(l1Origin.BlockID, common.Big1) + } + + l1Head, err := c.L1.HeaderByNumber(ctx, L1HeadNum) if err != nil { return nil, err } + if L2HeadNum != nil { + timestamp = l2Head.Time + l2Head, err = c.L2.HeaderByNumber(ctx, L2HeadNum) + if err != nil { + return nil, err + } + } + baseFee, err := c.CalculateBaseFee( ctx, l2Head, l1Head.Number, - chainConfig.IsOntake(new(big.Int).Add(l2Head.Number, common.Big1)), + true, &chainConfig.ProtocolConfigs.BaseFeeConfig, - uint64(time.Now().Unix()), + timestamp, ) if err != nil { return nil, err @@ -393,8 +420,8 @@ type L2SyncProgress struct { HighestBlockID *big.Int } -// isSyncing returns true if the L2 execution engine is syncing with L1. -func (p *L2SyncProgress) isSyncing() bool { +// IsSyncing returns true if the L2 execution engine is syncing with L1. +func (p *L2SyncProgress) IsSyncing() bool { if p.SyncProgress == nil { return false } diff --git a/packages/taiko-client/scripts/gen_swagger_json.sh b/packages/taiko-client/scripts/gen_swagger_json.sh index 59dce311dbd..6d3a297c984 100755 --- a/packages/taiko-client/scripts/gen_swagger_json.sh +++ b/packages/taiko-client/scripts/gen_swagger_json.sh @@ -1,3 +1,3 @@ #/bin/sh -swag init -g api.go -d prover/server --pd +swag init -g server.go -d driver/soft_blocks --pd