Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 6 deletions op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,12 +854,6 @@ func (d *L1DependenciesConfig) CheckAddresses(dependencyContext DependencyContex
// The genesis generation may log warnings, do a best-effort support attempt,
// or ignore these attributes completely.
type LegacyDeployConfig struct {
// CliqueSignerAddress represents the signer address for the clique consensus engine.
// It is used in the multi-process devnet to sign blocks.
CliqueSignerAddress common.Address `json:"cliqueSignerAddress"`
// L1UseClique represents whether or not to use the clique consensus engine.
L1UseClique bool `json:"l1UseClique"`

// DeploymentWaitConfirmations is the number of confirmations to wait during
// deployment. This is DEPRECATED and should be removed in a future PR.
DeploymentWaitConfirmations int `json:"deploymentWaitConfirmations"`
Expand Down
30 changes: 8 additions & 22 deletions op-chain-ops/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/ethereum/go-ethereum/consensus/misc/eip1559"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/params"
)

Expand Down Expand Up @@ -141,25 +140,12 @@ func NewL1Genesis(config *DeployConfig) (*core.Genesis, error) {
LondonBlock: big.NewInt(0),
ArrowGlacierBlock: big.NewInt(0),
GrayGlacierBlock: big.NewInt(0),
ShanghaiTime: nil,
CancunTime: nil,
}

extraData := make([]byte, 0)
if config.L1UseClique {
// warning: clique has an overly strict block header timestamp check against the system wallclock,
// causing blocks to get scheduled as "future block" and not get mined instantly when produced.
chainConfig.Clique = &params.CliqueConfig{
Period: config.L1BlockTime,
Epoch: 30000,
}
extraData = append(append(make([]byte, 32), config.CliqueSignerAddress[:]...), make([]byte, crypto.SignatureLength)...)
} else {
chainConfig.MergeNetsplitBlock = big.NewInt(0)
chainConfig.TerminalTotalDifficulty = big.NewInt(0)
chainConfig.TerminalTotalDifficultyPassed = true
chainConfig.ShanghaiTime = u64ptr(0)
chainConfig.CancunTime = u64ptr(0)
ShanghaiTime: u64ptr(0),
CancunTime: u64ptr(0),
// To enable post-Merge consensus at genesis
MergeNetsplitBlock: big.NewInt(0),
TerminalTotalDifficulty: big.NewInt(0),
TerminalTotalDifficultyPassed: true,
}

gasLimit := config.L1GenesisBlockGasLimit
Expand All @@ -178,7 +164,7 @@ func NewL1Genesis(config *DeployConfig) (*core.Genesis, error) {
if timestamp == 0 {
timestamp = hexutil.Uint64(time.Now().Unix())
}
if !config.L1UseClique && config.L1CancunTimeOffset != nil {
if config.L1CancunTimeOffset != nil {
cancunTime := uint64(timestamp) + uint64(*config.L1CancunTimeOffset)
chainConfig.CancunTime = &cancunTime
}
Expand All @@ -187,7 +173,7 @@ func NewL1Genesis(config *DeployConfig) (*core.Genesis, error) {
Config: &chainConfig,
Nonce: uint64(config.L1GenesisBlockNonce),
Timestamp: uint64(timestamp),
ExtraData: extraData,
ExtraData: make([]byte, 0),
GasLimit: uint64(gasLimit),
Difficulty: difficulty.ToInt(),
Mixhash: config.L1GenesisBlockMixHash,
Expand Down
2 changes: 0 additions & 2 deletions op-chain-ops/genesis/testdata/test-deploy-config-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"maxSequencerDrift": 20,
"sequencerWindowSize": 100,
"channelTimeout": 30,
"l1UseClique": false,
"cliqueSignerAddress": "0x0000000000000000000000000000000000000000",
"customGasTokenAddress": "0x0000000000000000000000000000000000000000",
"p2pSequencerAddress": "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"batchInboxAddress": "0x42000000000000000000000000000000000000ff",
Expand Down
3 changes: 0 additions & 3 deletions op-e2e/config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ func initAllocType(root string, allocType AllocType) {
panic(err)
}

// Do not use clique in the in memory tests. Otherwise block building
// would be much more complex.
dc.L1UseClique = false
// Set the L1 genesis block timestamp to now
dc.L1GenesisBlockTimestamp = hexutil.Uint64(time.Now().Unix())
dc.FundDevAccounts = true
Expand Down
26 changes: 8 additions & 18 deletions op-e2e/e2eutils/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const defaultHDPathPrefix = "m/44'/60'/0'/0/"
// If these values are changed, it is subject to breaking tests. They
// must be in sync with the values in the DeployConfig used to create the system.
var DefaultMnemonicConfig = &MnemonicConfig{
Mnemonic: "test test test test test test test test test test test junk",
CliqueSigner: "m/44'/60'/0'/0/0",
Mnemonic: "test test test test test test test test test test test junk",
// Note: "m/44'/60'/0'/0/0" is a legacy mnemonic path, used for the L1 clique signer.
Proposer: "m/44'/60'/0'/0/1",
Batcher: "m/44'/60'/0'/0/2",
Deployer: "m/44'/60'/0'/0/3",
Expand All @@ -36,9 +36,8 @@ var DefaultMnemonicConfig = &MnemonicConfig{
type MnemonicConfig struct {
Mnemonic string

CliqueSigner string
Deployer string
SysCfgOwner string
Deployer string
SysCfgOwner string

// rollup actors
Proposer string
Expand Down Expand Up @@ -66,10 +65,6 @@ func (m *MnemonicConfig) Secrets() (*Secrets, error) {
if err != nil {
return nil, err
}
cliqueSigner, err := wallet.PrivateKey(account(m.CliqueSigner))
if err != nil {
return nil, err
}
sysCfgOwner, err := wallet.PrivateKey(account(m.SysCfgOwner))
if err != nil {
return nil, err
Expand Down Expand Up @@ -102,7 +97,6 @@ func (m *MnemonicConfig) Secrets() (*Secrets, error) {
return &Secrets{
Deployer: deployer,
SysCfgOwner: sysCfgOwner,
CliqueSigner: cliqueSigner,
Proposer: proposer,
Batcher: batcher,
SequencerP2P: sequencerP2P,
Expand All @@ -115,9 +109,8 @@ func (m *MnemonicConfig) Secrets() (*Secrets, error) {

// Secrets bundles secp256k1 private keys for all common rollup actors for testing purposes.
type Secrets struct {
Deployer *ecdsa.PrivateKey
CliqueSigner *ecdsa.PrivateKey
SysCfgOwner *ecdsa.PrivateKey
Deployer *ecdsa.PrivateKey
SysCfgOwner *ecdsa.PrivateKey

// rollup actors
Proposer *ecdsa.PrivateKey
Expand All @@ -138,7 +131,6 @@ type Secrets struct {
func (s *Secrets) Addresses() *Addresses {
return &Addresses{
Deployer: crypto.PubkeyToAddress(s.Deployer.PublicKey),
CliqueSigner: crypto.PubkeyToAddress(s.CliqueSigner.PublicKey),
SysCfgOwner: crypto.PubkeyToAddress(s.SysCfgOwner.PublicKey),
Proposer: crypto.PubkeyToAddress(s.Proposer.PublicKey),
Batcher: crypto.PubkeyToAddress(s.Batcher.PublicKey),
Expand All @@ -151,9 +143,8 @@ func (s *Secrets) Addresses() *Addresses {

// Addresses bundles the addresses for all common rollup addresses for testing purposes.
type Addresses struct {
Deployer common.Address
CliqueSigner common.Address
SysCfgOwner common.Address
Deployer common.Address
SysCfgOwner common.Address

// rollup actors
Proposer common.Address
Expand All @@ -169,7 +160,6 @@ type Addresses struct {
func (a *Addresses) All() []common.Address {
return []common.Address{
a.Deployer,
a.CliqueSigner,
a.SysCfgOwner,
a.Proposer,
a.Batcher,
Expand Down
2 changes: 1 addition & 1 deletion op-wheel/cheat/cheat.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (ch *Cheater) RunAndClose(fn HeadFn) error {

// Geth stores the TD for each block separately from the block itself. We must update this
// manually, otherwise Geth thinks we haven't reached TTD yet and tries to build a block
// using Clique consensus, which causes a panic.
// using pre-merge consensus, which causes a panic.
rawdb.WriteTd(batch, blockHash, preID.Number, ch.Blockchain.GetTd(preID.Hash, preID.Number))

// Need to copy over receipts since they are keyed by block hash.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
"l2OutputOracleStartingBlockNumber": 0,
"l2OutputOracleProposer": "0x95014c45078354ff839f14192228108eac82e00a",
"l2OutputOracleChallenger": "0x8c20c40180751d93e939dddee3517ae0d1ebead2",
"cliqueSignerAddress": "0x0000000000000000000000000000000000000000",
"l1UseClique": false,
"l1BlockTime": 12,
"l1GenesisBlockTimestamp": "0x0",
"l1GenesisBlockNonce": "0x0",
Expand Down