Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
067b327
op-node,op-proposer: move rollup bindings into op-node to avoid unnec…
protolambda Sep 9, 2022
c6fab69
chore: Upgrade foundry
maurelian Sep 9, 2022
6f69904
Merge branch 'develop' into m/upgrade-foundry
tynes Sep 10, 2022
93ea582
op-chain-ops: add more predeploys (#3384)
tynes Sep 10, 2022
6e5df3e
contracts-bedrock: migrate GovernanceToken (#3386)
tynes Sep 10, 2022
a28bfa5
op-bindings: ensure integrity of artifacts (#3387)
tynes Sep 10, 2022
cee753f
op-node: Add heartbeater (#3391)
mslipper Sep 10, 2022
e965517
op-node: config that disables itself should not init further (#3395)
protolambda Sep 10, 2022
545ed8d
op-node: Fix block numbe rin rollup config generation (#3399)
mslipper Sep 10, 2022
6162238
op-node: handle when engine changes safe head unexpectedly (#3397)
protolambda Sep 10, 2022
7fdc490
feat(ctb): make StandardBridge vars immutable
smartcontracts Sep 10, 2022
1fbf861
Merge pull request #3375 from ethereum-optimism/m/upgrade-foundry
tynes Sep 10, 2022
b5ebcdc
Merge pull request #3394 from ethereum-optimism/sc/ctb-bridge-immutable
smartcontracts Sep 10, 2022
63ef194
contracts-bedrock: delete hardhat genesis tasks
tynes Sep 10, 2022
3d228a0
feat(ctb): tweak XDM storage layout
smartcontracts Sep 10, 2022
e819c30
op-chain-ops: better error message
tynes Sep 10, 2022
7231a0c
Merge pull request #3400 from ethereum-optimism/sc/ctb-fix-xdm-slots
tynes Sep 10, 2022
e38c5f4
Safe head fix 2 (#3382)
protolambda Sep 10, 2022
90b7586
contracts-bedrock: regenerate storage layout
tynes Sep 10, 2022
14f6888
Merge pull request #3405 from ethereum-optimism/fix/error-message
tynes Sep 10, 2022
0d83d58
Merge branch 'develop' into feat/delete-hh-genesis
tynes Sep 10, 2022
d335e42
Merge branch 'develop' into rollup-client-move
mergify[bot] Sep 10, 2022
0418088
op-node: fix missing import (#3407)
protolambda Sep 10, 2022
2687c7c
Merge pull request #3406 from ethereum-optimism/fix/storage-layout
tynes Sep 10, 2022
0dcc1a5
Merge branch 'develop' into feat/delete-hh-genesis
tynes Sep 10, 2022
d61365a
Merge branch 'develop' into rollup-client-move
tynes Sep 10, 2022
b27d0fa
feat(sdk): Add wsteth to sdk for mainnet (#3374)
roninjin10 Sep 10, 2022
6948702
Merge pull request #3396 from ethereum-optimism/feat/delete-hh-genesis
tynes Sep 10, 2022
62b2ef9
Merge pull request #3367 from ethereum-optimism/rollup-client-move
tynes Sep 10, 2022
cf613a3
op-bindings: remove executable flag on files
tynes Sep 10, 2022
25b088f
op-node/batcher/proposer: Standardize goimports (#3403)
trianglesphere Sep 10, 2022
0d75421
Merge branch 'develop' into fix/remove-x
mslipper Sep 10, 2022
f012ada
contracts-bedrock: Fix deployment script (#3410)
mslipper Sep 10, 2022
7d6cca2
op-bindings: regenerate (#3412)
tynes Sep 10, 2022
cd6e3a7
Merge pull request #3408 from ethereum-optimism/fix/remove-x
tynes Sep 10, 2022
5bbeb7a
contracts-bedrock: Fix deployment (#3414)
mslipper Sep 10, 2022
8c5a7ca
contracts-bedrock: speed up storage snapshot
tynes Sep 10, 2022
0e6af08
feat(ctb): minor README update (#3368)
smartcontracts Sep 10, 2022
5b6bd79
op-node: Call FCU on new unsafe payload (#3418)
trianglesphere Sep 11, 2022
31099c9
op-node: pass L1 finalization for L2 finalization to kick in (#3419)
protolambda Sep 11, 2022
26a8b23
ci: Fix check-changed (#3420)
mslipper Sep 11, 2022
27aa017
contracts-bedrock: Make initialization serial, add logging (#3416)
mslipper Sep 11, 2022
636c54c
Merge pull request #3415 from ethereum-optimism/fix/speed-up-snapshot
tynes Sep 11, 2022
5ad549a
op-node: limit reorg depth with sanity check (#3422)
protolambda Sep 11, 2022
cbca9c8
op-node: emit l2_finalized block (#3423)
protolambda Sep 11, 2022
262f5fd
contracts-bedrock: Remove Goerli deployment, replace with alpha testnet
mslipper Sep 12, 2022
6bd1c85
indexer: scan eth/standard bridge for deposits (#3350)
tuxcanfly Sep 12, 2022
96111d9
Merge pull request #3424 from ethereum-optimism/feat/commit-artifacts
tynes Sep 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/afraid-jokes-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@eth-optimism/ci-builder': patch
'@eth-optimism/foundry': patch
---

Update foundry to fix a bug in coverage generation
5 changes: 5 additions & 0 deletions .changeset/brave-glasses-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/contracts-bedrock': minor
---

Removes initializer from StandardBridge in favor of immutables
5 changes: 5 additions & 0 deletions .changeset/gorgeous-waves-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/sdk': patch
---

Add wsteth support for DAI bridge to sdk
5 changes: 5 additions & 0 deletions .changeset/green-stingrays-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/contracts-bedrock': minor
---

Updates the storage layout for the CrossDomainMessenger base contract to reduce diff with the existing system.
5 changes: 5 additions & 0 deletions .changeset/serious-deers-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/contracts-bedrock': patch
---

Delete hardhat genesis tasks
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
fi
- run:
name: check go bindings
command: make && git diff --exit-code
command: make && git diff --exit-code -- ':!*_more.go'
working_directory: op-bindings

js-lint-test:
Expand Down
2 changes: 1 addition & 1 deletion indexer/db/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ CREATE TABLE IF NOT EXISTS withdrawals (
log_index INTEGER NOT NULL,
l1_block_hash VARCHAR REFERENCES l1_blocks(hash),
l2_block_hash VARCHAR NOT NULL REFERENCES l2_blocks(hash),
tx_hash VARCHAR NOT NULL,
tx_hash VARCHAR NOT NULL
)
`

Expand Down
37 changes: 22 additions & 15 deletions indexer/services/l1/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/ethereum-optimism/optimism/indexer/db"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand All @@ -25,59 +26,65 @@ type Bridge interface {
type implConfig struct {
name string
impl string
addr common.Address
addr string
}

var addrs map[string]common.Address
var defaultBridgeCfgs = map[uint64][]*implConfig{
// Devnet
900: {
{"Standard", "StandardBridge", predeploys.DevL1StandardBridge},
{"ETH", "ETHBridge", predeploys.DevL1StandardBridge},
},
}

var customBridgeCfgs = map[uint64][]*implConfig{
// Mainnet
1: {
{"BitBTC", "StandardBridge", common.HexToAddress("0xaBA2c5F108F7E820C049D5Af70B16ac266c8f128")},
{"DAI", "StandardBridge", common.HexToAddress("0x10E6593CDda8c58a1d0f14C5164B376352a55f2F")},
{"BitBTC", "StandardBridge", "0xaBA2c5F108F7E820C049D5Af70B16ac266c8f128"},
{"DAI", "StandardBridge", "0x10E6593CDda8c58a1d0f14C5164B376352a55f2F"},
},
// Kovan
42: {
{"BitBTC", "StandardBridge", common.HexToAddress("0x0b651A42F32069d62d5ECf4f2a7e5Bd3E9438746")},
{"USX", "StandardBridge", common.HexToAddress("0x40E862341b2416345F02c41Ac70df08525150dC7")},
{"DAI", "StandardBridge", common.HexToAddress("0xb415e822C4983ecD6B1c1596e8a5f976cf6CD9e3")},
{"BitBTC", "StandardBridge", "0x0b651A42F32069d62d5ECf4f2a7e5Bd3E9438746"},
{"USX", "StandardBridge", "0x40E862341b2416345F02c41Ac70df08525150dC7"},
{"DAI", "StandardBridge", "0xb415e822C4983ecD6B1c1596e8a5f976cf6CD9e3"},
},
}

func BridgesByChainID(chainID *big.Int, client bind.ContractBackend, ctx context.Context) (map[string]Bridge, error) {
allCfgs := []*implConfig{
{"Standard", "StandardBridge", addrs["L1StandardBridge"]},
{"ETH", "ETHBridge", addrs["L1StandardBridge"]},
}
allCfgs := make([]*implConfig, 0)
allCfgs = append(allCfgs, defaultBridgeCfgs[chainID.Uint64()]...)
allCfgs = append(allCfgs, customBridgeCfgs[chainID.Uint64()]...)

bridges := make(map[string]Bridge)
for _, bridge := range allCfgs {
switch bridge.impl {
case "StandardBridge":
l1StandardBridgeFilter, err := bindings.NewL1StandardBridgeFilterer(bridge.addr, client)
l1StandardBridgeAddress := common.HexToAddress(bridge.addr)
l1StandardBridgeFilter, err := bindings.NewL1StandardBridgeFilterer(l1StandardBridgeAddress, client)
if err != nil {
return nil, err
}

standardBridge := &StandardBridge{
name: bridge.name,
ctx: ctx,
address: bridge.addr,
address: l1StandardBridgeAddress,
client: client,
filterer: l1StandardBridgeFilter,
}
bridges[bridge.name] = standardBridge
case "ETHBridge":
l1EthBridgeFilter, err := bindings.NewL1StandardBridgeFilterer(bridge.addr, client)
l1StandardBridgeAddress := common.HexToAddress(bridge.addr)
l1EthBridgeFilter, err := bindings.NewL1StandardBridgeFilterer(l1StandardBridgeAddress, client)
if err != nil {
return nil, err
}

ethBridge := &EthBridge{
name: bridge.name,
ctx: ctx,
address: bridge.addr,
address: l1StandardBridgeAddress,
client: client,
filterer: l1EthBridgeFilter,
}
Expand Down
8 changes: 6 additions & 2 deletions indexer/services/l1/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ func NewService(cfg ServiceConfig) (*Service, error) {
return nil, fmt.Errorf("chain ID configured with %d but got %d", cfg.ChainID, chainID)
}

var bridges map[string]bridge.Bridge
bridges, err := bridge.BridgesByChainID(cfg.ChainID, cfg.L1Client, ctx)
if err != nil {
cancel()
return nil, err
}
logger.Info("Scanning bridges for deposits", "bridges", bridges)

confirmedHeaderSelector, err := NewConfirmedHeaderSelector(HeaderSelectorConfig{
Expand Down Expand Up @@ -278,7 +282,7 @@ func (s *Service) Update(newHeader *types.Header) error {
}

receives++
if receives == len(s.bridges) {
if receives == 2*len(s.bridges) {
break
}
}
Expand Down
9 changes: 6 additions & 3 deletions indexer/services/l2/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ type implConfig struct {
addr string
}

var defaultBridgeCfgs = []*implConfig{
{"Standard", "StandardBridge", L2StandardBridgeAddr},
var defaultBridgeCfgs = map[uint64][]*implConfig{
// Devnet
901: {
{"Standard", "StandardBridge", L2StandardBridgeAddr},
},
}

var customBridgeCfgs = map[uint64][]*implConfig{
Expand All @@ -48,7 +51,7 @@ var customBridgeCfgs = map[uint64][]*implConfig{

func BridgesByChainID(chainID *big.Int, client bind.ContractFilterer, ctx context.Context) (map[string]Bridge, error) {
allCfgs := make([]*implConfig, 0)
allCfgs = append(allCfgs, defaultBridgeCfgs...)
allCfgs = append(allCfgs, defaultBridgeCfgs[chainID.Uint64()]...)
allCfgs = append(allCfgs, customBridgeCfgs[chainID.Uint64()]...)

bridges := make(map[string]Bridge)
Expand Down
2 changes: 1 addition & 1 deletion indexer/services/l2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func (s *Service) Update(newHeader *types.Header) error {
}

receives++
if receives == len(s.bridges) {
if receives == 2*len(s.bridges) {
break
}
}
Expand Down
12 changes: 6 additions & 6 deletions op-batcher/batch_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ import (
"syscall"
"time"

"github.com/ethereum-optimism/optimism/op-node/sources"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"
oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"
"github.com/ethereum/go-ethereum/rpc"
hdwallet "github.com/miguelmota/go-ethereum-hdwallet"
"github.com/urfave/cli"

"github.com/ethereum-optimism/optimism/op-batcher/sequencer"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-proposer/rollupclient"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
Expand All @@ -34,8 +35,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
hdwallet "github.com/miguelmota/go-ethereum-hdwallet"
"github.com/urfave/cli"
"github.com/ethereum/go-ethereum/rpc"
)

const (
Expand Down Expand Up @@ -491,7 +491,7 @@ func dialEthClientWithTimeout(ctx context.Context, url string) (
// dialRollupClientWithTimeout attempts to dial the RPC provider using the provided
// URL. If the dial doesn't complete within defaultDialTimeout seconds, this
// method will return an error.
func dialRollupClientWithTimeout(ctx context.Context, url string) (*rollupclient.RollupClient, error) {
func dialRollupClientWithTimeout(ctx context.Context, url string) (*sources.RollupClient, error) {
ctxt, cancel := context.WithTimeout(ctx, defaultDialTimeout)
defer cancel()

Expand All @@ -500,7 +500,7 @@ func dialRollupClientWithTimeout(ctx context.Context, url string) (*rollupclient
return nil, err
}

return rollupclient.NewRollupClient(client), nil
return sources.NewRollupClient(client), nil
}

// parseAddress parses an ETH address from a hex string. This method will fail if
Expand Down
5 changes: 2 additions & 3 deletions op-batcher/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import (
"fmt"
"os"

oplog "github.com/ethereum-optimism/optimism/op-service/log"

"github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli"

batcher "github.com/ethereum-optimism/optimism/op-batcher"
"github.com/ethereum-optimism/optimism/op-batcher/flags"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum/go-ethereum/log"
)

var (
Expand Down
11 changes: 4 additions & 7 deletions op-batcher/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ package op_batcher
import (
"time"

oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"

opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"

oplog "github.com/ethereum-optimism/optimism/op-service/log"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"

"github.com/urfave/cli"

"github.com/ethereum-optimism/optimism/op-batcher/flags"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"
oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"
)

type Config struct {
Expand Down
3 changes: 2 additions & 1 deletion op-batcher/flags/flags.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package flags

import (
"github.com/urfave/cli"

opservice "github.com/ethereum-optimism/optimism/op-service"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"
oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"
"github.com/urfave/cli"
)

const envVarPrefix = "OP_BATCHER"
Expand Down
4 changes: 2 additions & 2 deletions op-batcher/sequencer/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"math/big"
"time"

"github.com/ethereum-optimism/optimism/op-proposer/rollupclient"
"github.com/ethereum-optimism/optimism/op-node/sources"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
Expand All @@ -22,7 +22,7 @@ type Config struct {
// API to hit for batch data
L2Client *ethclient.Client

RollupNode *rollupclient.RollupClient
RollupNode *sources.RollupClient

// Limit the size of txs
MinL1TxSize uint64
Expand Down
15 changes: 11 additions & 4 deletions op-bindings/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ bindings: l1block-bindings \
proxy-bindings \
proxy-admin-bindings \
erc20-bindings \
weth9-bindings
weth9-bindings \
deployer-whitelist-bindings

compile:
cd ../packages/contracts-bedrock/ && \
forge build -o ./tmp-artifacts
npx hardhat compile

l1-cross-domain-messenger-bindings: compile
./gen_bindings.sh contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger $(pkg)
Expand Down Expand Up @@ -72,14 +73,20 @@ proxy-admin-bindings: compile
./gen_bindings.sh contracts/universal/ProxyAdmin.sol:ProxyAdmin $(pkg)

erc20-bindings: compile
./gen_bindings.sh ERC20 $(pkg)
./gen_bindings.sh node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol:ERC20 $(pkg)

weth9-bindings: compile
./gen_bindings.sh contracts/vendor/WETH9.sol:WETH9 $(pkg)

deployer-whitelist-bindings: compile
./gen_bindings.sh contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist $(pkg)

l1-blocknumber-bindings: compile
./gen_bindings.sh contracts/legacy/L1BlockNumber.sol:L1BlockNumber $(pkg)

more:
go run ./gen/main.go \
-artifacts ../packages/contracts-bedrock/artifacts,../packages/contracts-governance/artifacts \
-artifacts ../packages/contracts-bedrock/artifacts \
-out ./bindings \
-contracts OptimismMintableERC20Factory,L2StandardBridge,L1BlockNumber,DeployerWhitelist,Proxy,OptimismPortal,L2ToL1MessagePasser,L2CrossDomainMessenger,GasPriceOracle,SequencerFeeVault,L1Block,LegacyERC20ETH,WETH9,GovernanceToken \
-package bindings
Expand Down
Loading