Commit b824f9bc authored by protolambda's avatar protolambda Committed by GitHub

op-chain-ops: remove L1 clique option (#12977)

parent d2df40a5
......@@ -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"`
......
......@@ -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"
)
......@@ -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
......@@ -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
}
......@@ -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,
......
......@@ -6,8 +6,6 @@
"maxSequencerDrift": 20,
"sequencerWindowSize": 100,
"channelTimeout": 30,
"l1UseClique": false,
"cliqueSignerAddress": "0x0000000000000000000000000000000000000000",
"customGasTokenAddress": "0x0000000000000000000000000000000000000000",
"p2pSequencerAddress": "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc",
"batchInboxAddress": "0x42000000000000000000000000000000000000ff",
......
......@@ -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
......
......@@ -20,7 +20,7 @@ const defaultHDPathPrefix = "m/44'/60'/0'/0/"
// 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",
// 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",
......@@ -36,7 +36,6 @@ var DefaultMnemonicConfig = &MnemonicConfig{
type MnemonicConfig struct {
Mnemonic string
CliqueSigner string
Deployer string
SysCfgOwner string
......@@ -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
......@@ -102,7 +97,6 @@ func (m *MnemonicConfig) Secrets() (*Secrets, error) {
return &Secrets{
Deployer: deployer,
SysCfgOwner: sysCfgOwner,
CliqueSigner: cliqueSigner,
Proposer: proposer,
Batcher: batcher,
SequencerP2P: sequencerP2P,
......@@ -116,7 +110,6 @@ 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
// rollup actors
......@@ -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),
......@@ -152,7 +144,6 @@ 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
// rollup actors
......@@ -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,
......
......@@ -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.
......
......@@ -15,8 +15,6 @@
"l2OutputOracleStartingBlockNumber": 0,
"l2OutputOracleProposer": "0x95014c45078354ff839f14192228108eac82e00a",
"l2OutputOracleChallenger": "0x8c20c40180751d93e939dddee3517ae0d1ebead2",
"cliqueSignerAddress": "0x0000000000000000000000000000000000000000",
"l1UseClique": false,
"l1BlockTime": 12,
"l1GenesisBlockTimestamp": "0x0",
"l1GenesisBlockNonce": "0x0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment