Skip to content

Commit

Permalink
Merge pull request #84 from ethereum-optimism/aj/update-dependencies
Browse files Browse the repository at this point in the history
Update optimism and op-geth dependencies
  • Loading branch information
ajsutton authored Jul 1, 2023
2 parents 8ed8b25 + d9e05e1 commit 91ab5cf
Show file tree
Hide file tree
Showing 27 changed files with 363 additions and 657 deletions.
2 changes: 1 addition & 1 deletion cmd/hivechain/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func writeChain(chain *core.BlockChain, filename string, start uint64, modifyBlo
return err
}
defer out.Close()
return exportN(chain, out, start, chain.CurrentBlock().NumberU64(), modifyBlock)
return exportN(chain, out, start, chain.CurrentBlock().Number.Uint64(), modifyBlock)
}

// instaSeal wraps a consensus engine with instant block sealing. When a block is produced
Expand Down
4 changes: 2 additions & 2 deletions go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.18
go 1.19

use (
.
Expand All @@ -22,6 +22,6 @@ use (
// ./simulators/smoke/network
)

replace github.com/ethereum/go-ethereum v1.11.2 => github.com/ethereum-optimism/op-geth v1.11.2-de8c5df46
replace github.com/ethereum/go-ethereum v1.11.6 => github.com/ethereum-optimism/op-geth v1.101106.0

replace github.com/ethereum/hive/optimism v0.0.0 => github.com/ethereum-optimism/hive/optimism v0.0.0-20230307104024-b5f7380456ce
210 changes: 66 additions & 144 deletions go.work.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions internal/libdocker/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (b *Builder) BuildImage(ctx context.Context, name string, fsys fs.FS) error
Context: ctx,
Name: name,
InputStream: pipeR,
OutputStream: ioutil.Discard,
OutputStream: os.Stdout,
NoCache: nocache,
Pull: b.config.PullEnabled,
}
Expand Down Expand Up @@ -230,7 +230,7 @@ func (b *Builder) buildImage(ctx context.Context, contextDir, dockerFile, branch
Context: ctx,
Name: imageTag,
ContextDir: context,
OutputStream: ioutil.Discard,
OutputStream: os.Stdout,
Dockerfile: dockerFile,
NoCache: nocache,
Pull: b.config.PullEnabled,
Expand Down
100 changes: 54 additions & 46 deletions optimism/devnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,20 @@ func (d *Devnet) AddOpNode(eth1Index int, l2EngIndex int, sequencer bool, opts .
seqStr = "true"
}
defaultSettings := HiveUnpackParams{
opnf.L1NodeAddr.EnvVar: eth1Node.WsRpcEndpoint(),
opnf.L2EngineAddr.EnvVar: l2Engine.EngineEndpoint(),
opnf.RollupConfig.EnvVar: "/rollup_config.json",
opnf.RPCListenAddr.EnvVar: "0.0.0.0",
opnf.RPCListenPort.EnvVar: fmt.Sprintf("%d", RollupRPCPort),
opnf.L1TrustRPC.EnvVar: "false",
opnf.L2EngineJWTSecret.EnvVar: DefaultJWTPath,
opnf.LogLevelFlag.EnvVar: "debug",
opnf.SequencerEnabledFlag.EnvVar: seqStr,
opnf.SequencerL1Confs.EnvVar: "0",
opnf.VerifierL1Confs.EnvVar: "0",
opnf.P2PPrivPath.EnvVar: DefaultP2PPrivPath,
opnf.AdvertiseTCPPort.EnvVar: strconv.Itoa(OpnodeP2PPort),
opnf.ListenTCPPort.EnvVar: strconv.Itoa(OpnodeP2PPort),
opnf.L1NodeAddr.EnvVars[0]: eth1Node.WsRpcEndpoint(),
opnf.L2EngineAddr.EnvVars[0]: l2Engine.EngineEndpoint(),
opnf.RollupConfig.EnvVars[0]: "/rollup_config.json",
opnf.RPCListenAddr.EnvVars[0]: "0.0.0.0",
opnf.RPCListenPort.EnvVars[0]: fmt.Sprintf("%d", RollupRPCPort),
opnf.L1TrustRPC.EnvVars[0]: "false",
opnf.L2EngineJWTSecret.EnvVars[0]: DefaultJWTPath,
"OP_NODE_LOG_LEVEL": "debug",
opnf.SequencerEnabledFlag.EnvVars[0]: seqStr,
opnf.SequencerL1Confs.EnvVars[0]: "0",
opnf.VerifierL1Confs.EnvVars[0]: "0",
opnf.P2PPrivPath.EnvVars[0]: DefaultP2PPrivPath,
opnf.AdvertiseTCPPort.EnvVars[0]: strconv.Itoa(OpnodeP2PPort),
opnf.ListenTCPPort.EnvVars[0]: strconv.Itoa(OpnodeP2PPort),
}
input := []hivesim.StartOption{defaultSettings.Params()}

Expand All @@ -216,7 +216,7 @@ func (d *Devnet) AddOpNode(eth1Index int, l2EngIndex int, sequencer bool, opts .
input = append(input, StringFile(DefaultP2PPrivPath, hex.EncodeToString(EncodePrivKey(p2pKey))))
if sequencer {
input = append(input,
HiveUnpackParams{opnf.SequencerP2PKeyFlag.EnvVar: strings.Replace(EncodePrivKey(d.Secrets.SequencerP2P).String(), "0x", "", 1)}.Params(),
HiveUnpackParams{opnf.SequencerP2PKeyFlag.EnvVars[0]: strings.Replace(EncodePrivKey(d.Secrets.SequencerP2P).String(), "0x", "", 1)}.Params(),
)
}

Expand Down Expand Up @@ -252,17 +252,17 @@ func (d *Devnet) AddOpProposer(eth1Index int, l2EngIndex int, opNodeIndex int, o
opNode := d.GetOpNode(opNodeIndex)

defaultSettings := HiveUnpackParams{
oppf.L1EthRpcFlag.EnvVar: eth1Node.WsRpcEndpoint(),
oppf.RollupRpcFlag.EnvVar: opNode.HttpRpcEndpoint(),
oppf.L2OOAddressFlag.EnvVar: d.Deployments.L2OutputOracleProxy.String(),
oppf.PollIntervalFlag.EnvVar: "10s",
oppf.NumConfirmationsFlag.EnvVar: "1",
oppf.SafeAbortNonceTooLowCountFlag.EnvVar: "3",
oppf.ResubmissionTimeoutFlag.EnvVar: "30s",
oppf.MnemonicFlag.EnvVar: d.MnemonicCfg.Mnemonic,
oppf.L2OutputHDPathFlag.EnvVar: d.MnemonicCfg.Proposer,
oppf.AllowNonFinalizedFlag.EnvVar: "true",
"OP_PROPOSER_LOG_LEVEL": "debug",
oppf.L1EthRpcFlag.EnvVars[0]: eth1Node.WsRpcEndpoint(),
oppf.RollupRpcFlag.EnvVars[0]: opNode.HttpRpcEndpoint(),
oppf.L2OOAddressFlag.EnvVars[0]: d.Deployments.L2OutputOracleProxy.String(),
oppf.PollIntervalFlag.EnvVars[0]: "10s",
"OP_PROPOSER_NUM_CONFIRMATIONS": "1",
"OP_PROPOSER_SAFE_ABORT_NONCE_TOO_LOW_COUNT": "3",
"OP_PROPOSER_RESUBMISSION_TIMEOUT": "30s",
"OP_PROPOSER_MNEMONIC": d.MnemonicCfg.Mnemonic,
oppf.L2OutputHDPathFlag.EnvVars[0]: d.MnemonicCfg.Proposer,
oppf.AllowNonFinalizedFlag.EnvVars[0]: "true",
"OP_PROPOSER_LOG_LEVEL": "debug",
}
input := []hivesim.StartOption{defaultSettings.Params()}
input = append(input, opts...)
Expand Down Expand Up @@ -290,19 +290,19 @@ func (d *Devnet) AddOpBatcher(eth1Index int, l2EngIndex int, opNodeIndex int, op
l2Engine := d.GetOpL2Engine(l2EngIndex)

defaultSettings := HiveUnpackParams{
opbf.L1EthRpcFlag.EnvVar: eth1Node.WsRpcEndpoint(),
opbf.L2EthRpcFlag.EnvVar: l2Engine.WsRpcEndpoint(),
opbf.RollupRpcFlag.EnvVar: opNode.HttpRpcEndpoint(),
opbf.TargetL1TxSizeBytesFlag.EnvVar: "624",
opbf.MaxL1TxSizeBytesFlag.EnvVar: "120000",
opbf.SubSafetyMarginFlag.EnvVar: "4",
opbf.PollIntervalFlag.EnvVar: "1s",
opbf.NumConfirmationsFlag.EnvVar: "1",
opbf.SafeAbortNonceTooLowCountFlag.EnvVar: "3",
opbf.ResubmissionTimeoutFlag.EnvVar: "30s",
opbf.MnemonicFlag.EnvVar: d.MnemonicCfg.Mnemonic,
opbf.SequencerHDPathFlag.EnvVar: d.MnemonicCfg.Batcher,
"OP_BATCHER_LOG_LEVEL": "debug",
opbf.L1EthRpcFlag.EnvVars[0]: eth1Node.WsRpcEndpoint(),
opbf.L2EthRpcFlag.EnvVars[0]: l2Engine.WsRpcEndpoint(),
opbf.RollupRpcFlag.EnvVars[0]: opNode.HttpRpcEndpoint(),
"OP_BATCHER_TARGET_L1_TX_SIZE_BYTES": "624",
opbf.MaxL1TxSizeBytesFlag.EnvVars[0]: "120000",
opbf.SubSafetyMarginFlag.EnvVars[0]: "4",
opbf.PollIntervalFlag.EnvVars[0]: "1s",
"OP_BATCHER_NUM_CONFIRMATIONS": "1",
"OP_BATCHER_SAFE_ABORT_NONCE_TOO_LOW_COUNT": "3",
"OP_BATCHER_RESUBMISSION_TIMEOUT": "30s",
"OP_BATCHER_MNEMONIC": d.MnemonicCfg.Mnemonic,
opbf.SequencerHDPathFlag.EnvVars[0]: d.MnemonicCfg.Batcher,
"OP_BATCHER_LOG_LEVEL": "debug",
}
input := []hivesim.StartOption{defaultSettings.Params()}
input = append(input, opts...)
Expand Down Expand Up @@ -377,7 +377,7 @@ func (d *Devnet) RunScript(name string, command ...string) *hivesim.ExecInfo {
return execInfo
}

func (d *Devnet) InitChain(maxSeqDrift uint64, seqWindowSize uint64, chanTimeout uint64, additionalAlloc core.GenesisAlloc, forkName string) {
func (d *Devnet) InitChain(maxSeqDrift uint64, seqWindowSize uint64, chanTimeout uint64, additionalAlloc core.GenesisAlloc, l1BlockTime uint64, forkName string) {
d.mu.Lock()
defer d.mu.Unlock()
d.T.Log("creating hardhat deploy config")
Expand Down Expand Up @@ -414,7 +414,7 @@ func (d *Devnet) InitChain(maxSeqDrift uint64, seqWindowSize uint64, chanTimeout
L2OutputOracleProposer: d.Addresses.Proposer,
L2OutputOracleChallenger: common.Address{}, // tbd

L1BlockTime: 15,
L1BlockTime: l1BlockTime,
L1GenesisBlockNonce: 0,
CliqueSignerAddress: d.Addresses.CliqueSigner,
L1GenesisBlockTimestamp: hexutil.Uint64(time.Now().Unix()),
Expand All @@ -428,16 +428,24 @@ func (d *Devnet) InitChain(maxSeqDrift uint64, seqWindowSize uint64, chanTimeout
L1GenesisBlockBaseFeePerGas: uint642big(1000_000_000), // 1 gwei

L2GenesisBlockNonce: 0,
L2GenesisBlockGasLimit: 15_000_000,
L2GenesisBlockGasLimit: 30_000_000,
L2GenesisBlockDifficulty: uint642big(0),
L2GenesisBlockMixHash: common.Hash{},
L2GenesisBlockNumber: 0,
L2GenesisBlockGasUsed: 0,
L2GenesisBlockParentHash: common.Hash{},
L2GenesisBlockBaseFeePerGas: uint642big(1000_000_000),

GasPriceOracleOverhead: 2100,
GasPriceOracleScalar: 1000_000,
GasPriceOracleOverhead: 2100,
GasPriceOracleScalar: 1000_000,

BaseFeeVaultMinimumWithdrawalAmount: uint642big(1000_000_000), // 1 gwei
L1FeeVaultMinimumWithdrawalAmount: uint642big(1000_000_000), // 1 gwei
SequencerFeeVaultMinimumWithdrawalAmount: uint642big(1000_000_000), // 1 gwei
BaseFeeVaultWithdrawalNetwork: uint8(1), // L2 withdrawal network
L1FeeVaultWithdrawalNetwork: uint8(1), // L2 withdrawal network
SequencerFeeVaultWithdrawalNetwork: uint8(1), // L2 withdrawal network

DeploymentWaitConfirmations: 1,

EIP1559Elasticity: 10,
Expand All @@ -460,7 +468,7 @@ func (d *Devnet) InitChain(maxSeqDrift uint64, seqWindowSize uint64, chanTimeout
d.L1Cfg = l1Genesis

l1Block := l1Genesis.ToBlock()
l2Genesis, err := genesis.BuildL2DeveloperGenesis(config, l1Block)
l2Genesis, err := genesis.BuildL2Genesis(config, l1Block)
if err != nil {
d.T.Fatalf("failed to create l2 genesis: %v", err)
}
Expand Down Expand Up @@ -527,7 +535,7 @@ type SequencerDevnetParams struct {
}

func StartSequencerDevnet(ctx context.Context, d *Devnet, params *SequencerDevnetParams) error {
d.InitChain(params.MaxSeqDrift, params.SeqWindowSize, params.ChanTimeout, params.AdditionalGenesisAllocs, params.Fork)
d.InitChain(params.MaxSeqDrift, params.SeqWindowSize, params.ChanTimeout, params.AdditionalGenesisAllocs, 6, params.Fork)
d.AddEth1()
d.WaitUpEth1(0, time.Second*10)
d.AddOpL2()
Expand Down
37 changes: 17 additions & 20 deletions optimism/go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/ethereum/hive/optimism

go 1.18
go 1.19

replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-20221205191237-0678a130d790
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v1.101106.0

require (
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
github.com/ethereum-optimism/optimism v0.2.1-0.20230306233858-759c0b297c3d
github.com/ethereum/go-ethereum v1.11.2
github.com/ethereum-optimism/optimism v1.0.10-0.20230701001510-49a44472369e
github.com/ethereum/go-ethereum v1.11.6
github.com/ethereum/hive v0.0.0-20220727121216-02ad57aaf9c1
github.com/stretchr/testify v1.8.1
golang.org/x/sync v0.1.0
Expand Down Expand Up @@ -39,7 +39,6 @@ require (
github.com/docker/go-units v0.5.0 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fjl/memsize v0.0.1 // indirect
github.com/flynn/noise v1.0.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
Expand All @@ -50,11 +49,12 @@ require (
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/google/uuid v1.3.0 // indirect
Expand All @@ -64,13 +64,11 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.0 // indirect
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect
github.com/huin/goupnp v1.1.0 // indirect
github.com/ipfs/go-cid v0.3.2 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
Expand All @@ -85,7 +83,7 @@ require (
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.25.1 // indirect
github.com/libp2p/go-libp2p-asn-util v0.2.0 // indirect
github.com/libp2p/go-libp2p-pubsub v0.9.0 // indirect
github.com/libp2p/go-libp2p-pubsub v0.9.3 // indirect
github.com/libp2p/go-libp2p-testing v0.12.0 // indirect
github.com/libp2p/go-mplex v0.7.0 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
Expand Down Expand Up @@ -118,15 +116,13 @@ require (
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onsi/ginkgo/v2 v2.8.1 // indirect
github.com/opencontainers/runtime-spec v1.0.2 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/tsdb v0.10.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-18 v0.2.0 // indirect
github.com/quic-go/qtls-go1-19 v0.2.0 // indirect
Expand All @@ -145,8 +141,7 @@ require (
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.5.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/urfave/cli v1.22.10 // indirect
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/urfave/cli/v2 v2.25.7 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
Expand All @@ -156,13 +151,15 @@ require (
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
Expand Down
Loading

0 comments on commit 91ab5cf

Please sign in to comment.