Skip to content

Commit

Permalink
Merge branch 'main' into impv_AddressManager
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Oct 25, 2024
2 parents 7afce44 + ae0a9da commit 5c56266
Show file tree
Hide file tree
Showing 19 changed files with 228 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"packages/relayer": "0.12.0",
"packages/snaefell-ui": "1.1.0",
"packages/supplementary-contracts": "1.0.0",
"packages/taiko-client": "0.39.1",
"packages/taiko-client": "0.39.2",
"packages/taikoon-ui": "1.3.0",
"packages/ui-lib": "1.0.0"
}
8 changes: 1 addition & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,7 @@ require (
sigs.k8s.io/yaml v1.3.0 // indirect
)

exclude (
github.com/ethereum/go-ethereum v1.14.5
github.com/ethereum/go-ethereum v1.14.6
github.com/ethereum/go-ethereum v1.14.7
)

replace github.com/ethereum/go-ethereum v1.14.11 => github.com/taikoxyz/taiko-geth v1.8.1-0.20241003040603-5c84a2082747
replace github.com/ethereum/go-ethereum v1.14.11 => github.com/taikoxyz/taiko-geth v1.11.1

replace github.com/ethereum-optimism/optimism v1.7.4 => github.com/taikoxyz/optimism v0.0.0-20241003061504-cdf8af288f39

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,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.8.1-0.20241003040603-5c84a2082747 h1:QRB8VHGmlRgm7ze/4Fzuce08Ypbq5Mr5q/piTfsck1A=
github.com/taikoxyz/taiko-geth v1.8.1-0.20241003040603-5c84a2082747/go.mod h1:+l/fr42Mma+xBnhefL/+z11/hcmJ2egl+ScIVPjhc7E=
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/testcontainers/testcontainers-go v0.30.0 h1:jmn/XS22q4YRrcMwWg0pAwlClzs/abopbsBzrepyc4E=
github.com/testcontainers/testcontainers-go v0.30.0/go.mod h1:K+kHNGiM5zjklKjgTtcrEetF3uhWbMUyqAQoyoh8Pf0=
github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e h1:cR8/SYRgyQCt5cNCMniB/ZScMkhI9nk8U5C7SbISXjo=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ import { LinkCard, CardGrid } from "@astrojs/starlight/components";
description="API3 offers over 200 first-party, OEV-enabled price feeds on Taiko Mainnet and Testnet, providing reliable and decentralized data through the API3 Market."
href="https://market.api3.org/taiko"
/>
<LinkCard
title="Pyth Network"
description="Pyth Network is the largest first-party Oracle network, delivering real-time data across a vast number of chains. Pyth introduces an innovative low-latency pull oracle design, where users can pull price updates on-chain when needed, enabling everyone in the blockchain environment to access that data point most efficiently. Pyth network updates the prices every 400ms, making Pyth the fastest on-chain oracle."
href="https://docs.pyth.network/price-feeds/use-real-time-data/evm"
/>
</CardGrid>

## Node Providers
Expand Down
2 changes: 1 addition & 1 deletion packages/eventindexer/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# ],

output:
format: colored-line-number
formats: colored-line-number

linters:
enable:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ contract RollupAddressCache is AddressCache {
return (true, 0x06a9Ab27c7e2255df1815E6CC0168d7755Feb19a);
}
if (_name == LibStrings.B_TIER_ROUTER) {
return (true, 0x6E997f1F22C40ba37F633B08f3b07E10Ed43155a);
return (true, 0x2cD242BfD58E6D1810323D07b065413095c7AFd0);
}
if (_name == LibStrings.B_TIER_SGX) {
return (true, 0xb0f3186FC1963f774f52ff455DC86aEdD0b31F81);
Expand All @@ -52,7 +52,7 @@ contract RollupAddressCache is AddressCache {
return (true, address(0));
}
if (_name == LibStrings.B_CHAIN_WATCHDOG) {
return (true, address(0));
return (true, 0xE3D777143Ea25A6E031d1e921F396750885f43aC);
}
return (false, address(0));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
pragma solidity ^0.8.24;

import "src/layer1/tiers/ITierRouter.sol";
import "src/layer1/tiers/TierProviderV2.sol";

/// @title MainnetTierRouter
/// @dev Labeled in AddressResolver as "tier_router"
/// @custom:security-contact security@taiko.xyz
contract MainnetTierRouter is ITierRouter {
contract MainnetTierRouter is ITierRouter, TierProviderV2 {
/// @inheritdoc ITierRouter
function getProvider(uint256) external pure returns (address) {
return 0x4cffe56C947E26D07C14020499776DB3e9AE3a23; // TierProviderV2
function getProvider(uint256) external view returns (address) {
return address(this);
}
}
12 changes: 5 additions & 7 deletions packages/protocol/deployments/mainnet-contract-logs-L1.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@

- ens: `v721.based.taiko.eth`
- proxy: `0x0b470dd3A0e1C41228856Fb319649E7c08f419Aa`
- impl: `0x6e88046ff7Af8ef14ECa80e06C734bf59851896a`
- impl: `0xD961e3Ef2D7DF58cDc67BFd9055255430E5e3fEc`
- owner: `admin.taiko.eth`
- logs:
- deployed on May 1, 2024 @commit`56dddf2b6`
- upgraded from `0xEC04849E7722Fd69797a155796Db75aC8F94f692` to `0x41A7BDD153a5AfFb10Ed1AD3D6a4e5ad001495FA` @commit`b90b932` @tx`0x416560cd96dc75ccffebe889e8d1ab3e08b33f814dc4a2bf7c6f9555071d1f6f`
- upgraded from `0x41A7BDD153a5AfFb10Ed1AD3D6a4e5ad001495FA` to `0x2dfef0339009Ce10786fc118C883BB97af3163eD` @commit`fa481c1` @tx`0x02ed558762eae5f0a930ba4a1047a02d4a793ea48890268c32df04e882f138ff`
- upgraded from `0x2dfef0339009Ce10786fc118C883BB97af3163eD` to `0x55B5df6B53466446221180498BfD1C59e54732c4` @commit`d907359` @tx`0xdb5e926c96d112ce1389da77a927fba6c7d04a711839b9e14777530ebcf83914`
- upgraded from `0x55B5df6B53466446221180498BfD1C59e54732c4` to `0x6e88046ff7Af8ef14ECa80e06C734bf59851896a` @commit`bb2abc5` @tx`0x7d584f0a645cad61e634f64ffaf7e1bbfb92749878eb25b39ce0e5cf698897c7`
- upgraded from `0x55B5df6B53466446221180498BfD1C59e54732c4` to `0xD961e3Ef2D7DF58cDc67BFd9055255430E5e3fEc` @commit`bb2abc5` @tx`0x7d584f0a645cad61e634f64ffaf7e1bbfb92749878eb25b39ce0e5cf698897c7`

#### erc1155_vault

Expand Down Expand Up @@ -228,13 +228,11 @@
- Upgrade to `0xBA1d90BCfA74163bFE09e8eF609b346507D83231` @commit`bb2abc5` @tx`0x7d584f0a645cad61e634f64ffaf7e1bbfb92749878eb25b39ce0e5cf698897c7`
- Upgrade to `0xf0E6d34937701622cA887a75c150cC23d4FFDf2F` @commit`b4f8547` @tx`0x8778064404816273804d74c97b051f3865bc03062cfa4b0e9567f4556ad31981`

#### tier_provider
#### tier_router

- impl: `0x3a1A900680BaADb889202faf12915F7E47B71ddd`
- impl: `0x2cD242BfD58E6D1810323D07b065413095c7AFd0`
- logs:
- deployed on May 1, 2024 @commit`56dddf2b6`
- deployed on May 15, 2024 @commit`cd5144255`
- deployed on Jul 2, 2024 @commit`d2b00ce`
- deployed on Oct 24, 2024 @commit`7334b1d`

#### tier_sgx

Expand Down
12 changes: 1 addition & 11 deletions packages/protocol/deployments/mainnet-contract-logs-L2.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
- set erc1155_vault@1 to `0xaf145913EA4a56BE22E120ED9C24589659881702` @tx`0x4a16a8a7d02f696b753208bbf8e7e3501d6b70b9a764fa2b4e115add46c13cb3`
- changed owner to `0xCa5b76Cc7A38b86Db11E5aE5B1fc9740c3bA3DE8` @tx`0xf68861171c602e3e75ca69e950957fcb908c7949c6df9a9ea3026c238ebb1e9c`
- register `taiko_token` to `0xA9d23408b9bA935c230493c40C73824Df71A0975` @tx`0xc77434f4e37959cdc0eac125303b78dd192d8727173373cc7a6158ca7d829dad`
- register `bridged_erc20` to `0x98161D67f762A9E589E502348579FA38B1Ac47A8` @tx``
- register `bridged_erc20` to `0x98161D67f762A9E589E502348579FA38B1Ac47A8` @tx`0xf377885a94467d520bd765a186d3c3524099fe28e936d05656d0da2509628e65`

#### bridge

Expand Down Expand Up @@ -116,16 +116,6 @@
- todo:
- change owner to DelegateOwner

#### delegate_owner

- proxy: `0x5995941Df88F30Ac140515AA39832db963E2f863`
- impl: `0x1f0511cDae2fbfD93563469dA02b82dEd320C8Bd`
- admin: `0x3c181965C5cFAE61a9010A283e5e0C1445649810` // owned by Daniel W
- remoteOwner: `0x3c181965C5cFAE61a9010A283e5e0C1445649810` // owned by Daniel W
- todo:
- test various use cases
- transfer remote owner to `admin.taiko.eth`

## Rollup Specific

#### rollup_address_manager (ram)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract SendMessageToDelegateOwner is Script {
address public delegateOwnerImpl = 0x1f0511cDae2fbfD93563469dA02b82dEd320C8Bd;
address public multicall3 = 0xcA11bde05977b3631167028862bE2a173976CA11;
address public l1Bridge = 0xd60247c6848B7Ca29eDdF63AA924E53dB6Ddd8EC;
address public testAccount1 = 0x3c181965C5cFAE61a9010A283e5e0C1445649810; // owned by Daniel W
address public testAccount1 = vm.envAddress("TEST_ACCOUNT1");

modifier broadcast() {
vm.startBroadcast();
Expand All @@ -23,8 +23,7 @@ contract SendMessageToDelegateOwner is Script {
Multicall3.Call3[] memory calls = new Multicall3.Call3[](2);
calls[0].target = delegateOwner;
calls[0].allowFailure = false;
calls[0].callData =
abi.encodeCall(DelegateOwner.setAdmin, (0x4757D97449acA795510b9f3152C6a9019A3545c3));
calls[0].callData = abi.encodeCall(DelegateOwner.setAdmin, (testAccount1));

calls[1].target = delegateOwner;
calls[1].allowFailure = false;
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/script/layer2/DeployDelegateOwner.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "src/layer2/DelegateOwner.sol";
// forge script --rpc-url https://rpc.mainnet.taiko.xyz script/DeployDelegateOwner.s.sol
contract DeployDelegateOwner is DeployCapability {
address public l2Sam = 0x1670000000000000000000000000000000000006;
address public testAccount2 = 0x3c181965C5cFAE61a9010A283e5e0C1445649810; // owned by Daniel W
address public testAccount2 = vm.envAddress("TEST_ACCOUNT2");

address public l1Owner = testAccount2;
address public l2Admin = testAccount2;
Expand Down
8 changes: 3 additions & 5 deletions packages/relayer/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# ],

output:
format: colored-line-number
formats: colored-line-number

linters:
enable:
Expand All @@ -34,6 +34,8 @@ linters-settings:
min-complexity: 75

issues:
exclude-dirs:
- contracts/*
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
Expand All @@ -42,7 +44,3 @@ issues:
- path: /
linters:
- typecheck

run:
skip-dirs:
- contracts/*
19 changes: 19 additions & 0 deletions packages/relayer/pkg/mock/mock_tx_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package mock

import (
"context"
"math/big"

"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/rpc"
)

type TxManager struct {
Expand Down Expand Up @@ -34,3 +36,20 @@ func (t *TxManager) Close() {
func (t *TxManager) IsClosed() bool {
return false
}

func (t *TxManager) SendAsync(ctx context.Context, candidate txmgr.TxCandidate, ch chan txmgr.SendResponse) {
panic("unimplemented")
}

func (t *TxManager) SuggestGasPriceCaps(ctx context.Context) (
tipCap *big.Int,
baseFee *big.Int,
blobBaseFee *big.Int,
err error,
) {
panic("unimplemented")
}

func (t *TxManager) API() rpc.API {
panic("unimplemented")
}
8 changes: 8 additions & 0 deletions packages/taiko-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.39.2](https://github.com/taikoxyz/taiko-mono/compare/taiko-client-v0.39.1...taiko-client-v0.39.2) (2024-10-24)


### Bug Fixes

* **protocol:** fix issue in mainnet deployment script ([#18283](https://github.com/taikoxyz/taiko-mono/issues/18283)) ([5c371a1](https://github.com/taikoxyz/taiko-mono/commit/5c371a181af444999f611e03774ec096ffbd1226))
* **taiko-client:** fix path parsing in `/eth/v1/config/spec` ([#18295](https://github.com/taikoxyz/taiko-mono/issues/18295)) ([6633c80](https://github.com/taikoxyz/taiko-mono/commit/6633c80fbcabb6f06ce5467501da4207bc84be84))

## [0.39.1](https://github.com/taikoxyz/taiko-mono/compare/taiko-client-v0.39.0...taiko-client-v0.39.1) (2024-10-22)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
l1_node:
container_name: l1_node
image: ghcr.io/foundry-rs/foundry:nightly
image: ghcr.io/foundry-rs/foundry:nightly-2044faec64f99a21f0e5f0094458a973612d0712
restart: unless-stopped
platform: linux/amd64
pull_policy: always
Expand Down
44 changes: 44 additions & 0 deletions packages/taiko-client/internal/testutils/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,50 @@ func SignatureFromRSV(r, s string, v byte) []byte {
return append(append(hexutil.MustDecode(r), hexutil.MustDecode(s)...), v)
}

func AssembleTestTx(
client *rpc.EthClient,
priv *ecdsa.PrivateKey,
nonce uint64,
to *common.Address,
value *big.Int,
data []byte,
) (*types.Transaction, error) {
head, err := client.HeaderByNumber(context.Background(), nil)
if err != nil {
return nil, err
}

auth, err := bind.NewKeyedTransactorWithChainID(priv, client.ChainID)
if err != nil {
return nil, err
}

gasTipCap, err := client.SuggestGasTipCap(context.Background())
if err != nil {
return nil, err
}

tx, err := auth.Signer(auth.From, types.NewTx(&types.DynamicFeeTx{
To: to,
Nonce: nonce,
Value: value,
GasTipCap: gasTipCap,
GasFeeCap: new(big.Int).Add(
gasTipCap,
new(big.Int).Mul(head.BaseFee, big.NewInt(2)),
),
Gas: 2100_000,
Data: data,
}))
if err != nil {
return nil, err
}
if err = client.SendTransaction(context.Background(), tx); err != nil {
return nil, err
}
return tx, nil
}

// SendDynamicFeeTx sends a dynamic transaction, used for tests.
func SendDynamicFeeTx(
client *rpc.EthClient,
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "taiko-client",
"version": "0.39.1",
"version": "0.39.2",
"private": true
}
18 changes: 17 additions & 1 deletion packages/taiko-client/pkg/rpc/beaconclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/ethereum/go-ethereum/log"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v5/api/client"
"github.com/prysmaticlabs/prysm/v5/api/client/beacon"
"github.com/prysmaticlabs/prysm/v5/api/server/structs"
Expand All @@ -18,6 +19,7 @@ var (
// Request urls.
sidecarsRequestURL = "/eth/v1/beacon/blob_sidecars/%d"
genesisRequestURL = "/eth/v1/beacon/genesis"
getConfigSpecPath = "/eth/v1/config/spec"
)

type ConfigSpec struct {
Expand Down Expand Up @@ -67,7 +69,7 @@ func NewBeaconClient(endpoint string, timeout time.Duration) (*BeaconClient, err
log.Info("L1 genesis time", "time", genesisTime)

// Get the seconds per slot.
spec, err := cli.GetConfigSpec(ctx)
spec, err := getConfigSpec(ctx, cli)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -111,3 +113,17 @@ func (c *BeaconClient) timeToSlot(timestamp uint64) (uint64, error) {
}
return (timestamp - c.genesisTime) / c.secondsPerSlot, nil
}

// getConfigSpec retrieve the current configs of the network used by the beacon node.
func getConfigSpec(ctx context.Context, c *beacon.Client) (*structs.GetSpecResponse, error) {
body, err := c.Get(ctx, c.BaseURL().Path+getConfigSpecPath)
if err != nil {
return nil, errors.Wrap(err, "error requesting configSpecPath")
}
fsr := &structs.GetSpecResponse{}
err = json.Unmarshal(body, fsr)
if err != nil {
return nil, err
}
return fsr, nil
}
Loading

0 comments on commit 5c56266

Please sign in to comment.