From 92d04afad905f26d1f36ca6fa7f74c2df3c371de Mon Sep 17 00:00:00 2001 From: cby3149 Date: Fri, 9 Aug 2024 11:52:51 -0700 Subject: [PATCH 1/6] Add Granite hardfork --- cmd/utils/flags.go | 7 + core/genesis_write.go | 4 + core/vm/contracts.go | 41 +++++ core/vm/contracts_test.go | 12 +- core/vm/evm.go | 2 + erigon-lib/chain/chain_config.go | 14 +- eth/backend.go | 1 + eth/ethconfig/config.go | 1 + eth/ethconfig/gen_config.go | 289 +++++++++++++++++++++++++++++-- go.mod | 13 +- go.sum | 23 ++- params/protocol_params.go | 2 + params/superchain.go | 4 + params/superchain_test.go | 6 + turbo/cli/default_flags.go | 1 + 15 files changed, 387 insertions(+), 33 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 9cc194f7071..4492fef7895 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -138,6 +138,10 @@ var ( Name: "override.fjord", Usage: "Manually specify the Optimism Fjord fork timestamp, overriding the bundled setting", } + OverrideOptimismGraniteFlag = flags.BigFlag{ + Name: "override.granite", + Usage: "Manually specify the Optimism Granite fork timestamp, overriding the bundled setting", + } // Ethash settings EthashCachesInMemoryFlag = cli.IntFlag{ Name: "ethash.cachesinmem", @@ -1971,6 +1975,9 @@ func SetEthConfig(ctx *cli.Context, nodeConfig *nodecfg.Config, cfg *ethconfig.C cfg.OverrideOptimismFjordTime = flags.GlobalBig(ctx, OverrideOptimismFjordFlag.Name) cfg.TxPool.OptimismFjordTime = cfg.OverrideOptimismFjordTime } + if ctx.IsSet(OverrideOptimismGraniteFlag.Name) { + cfg.OverrideOptimismGraniteTime = flags.GlobalBig(ctx, OverrideOptimismGraniteFlag.Name) + } if ctx.IsSet(InternalConsensusFlag.Name) && clparams.EmbeddedSupported(cfg.NetworkID) { cfg.InternalCL = ctx.Bool(InternalConsensusFlag.Name) } diff --git a/core/genesis_write.go b/core/genesis_write.go index b858fb58e1f..aac39a0df1a 100644 --- a/core/genesis_write.go +++ b/core/genesis_write.go @@ -63,6 +63,7 @@ type ChainOverrides struct { OverrideOptimismCanyonTime *big.Int OverrideOptimismEcotoneTime *big.Int OverrideOptimismFjordTime *big.Int + OverrideOptimismGraniteTime *big.Int } // CommitGenesisBlock writes or updates the genesis block in db. @@ -152,6 +153,9 @@ func WriteGenesisBlock(tx kv.RwTx, genesis *types.Genesis, overrides *ChainOverr if overrides.OverrideOptimismFjordTime != nil { config.FjordTime = overrides.OverrideOptimismFjordTime } + if overrides.OverrideOptimismGraniteTime != nil { + config.GraniteTime = overrides.OverrideOptimismGraniteTime + } } if (storedHash == libcommon.Hash{}) { diff --git a/core/vm/contracts.go b/core/vm/contracts.go index ce38a949ee5..6ae99544348 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -131,6 +131,22 @@ var PrecompiledContractsFjord = map[libcommon.Address]PrecompiledContract{ libcommon.BytesToAddress([]byte{0x01, 0x00}): &p256Verify{}, } +// PrecompiledContractsGranite contains the default set of pre-compiled Ethereum +// contracts used in the Granite release. +var PrecompiledContractsGranite = map[libcommon.Address]PrecompiledContract{ + libcommon.BytesToAddress([]byte{1}): &ecrecover{}, + libcommon.BytesToAddress([]byte{2}): &sha256hash{}, + libcommon.BytesToAddress([]byte{3}): &ripemd160hash{}, + libcommon.BytesToAddress([]byte{4}): &dataCopy{}, + libcommon.BytesToAddress([]byte{5}): &bigModExp{eip2565: true}, + libcommon.BytesToAddress([]byte{6}): &bn256AddIstanbul{}, + libcommon.BytesToAddress([]byte{7}): &bn256ScalarMulIstanbul{}, + libcommon.BytesToAddress([]byte{8}): &bn256PairingGranite{}, + libcommon.BytesToAddress([]byte{9}): &blake2F{}, + libcommon.BytesToAddress([]byte{0x0a}): &pointEvaluation{}, + libcommon.BytesToAddress([]byte{0x01, 0x00}): &p256Verify{}, +} + var PrecompiledContractsNapoli = map[libcommon.Address]PrecompiledContract{ libcommon.BytesToAddress([]byte{0x01}): &ecrecover{}, libcommon.BytesToAddress([]byte{0x02}): &sha256hash{}, @@ -167,6 +183,7 @@ var PrecompiledContractsPrague = map[libcommon.Address]PrecompiledContract{ } var ( + PrecompiledAddressesGranite []libcommon.Address PrecompiledAddressesFjord []libcommon.Address PrecompiledAddressesPrague []libcommon.Address PrecompiledAddressesNapoli []libcommon.Address @@ -196,6 +213,9 @@ func init() { for k := range PrecompiledContractsFjord { PrecompiledAddressesFjord = append(PrecompiledAddressesFjord, k) } + for k := range PrecompiledContractsGranite { + PrecompiledAddressesGranite = append(PrecompiledAddressesGranite, k) + } for k := range PrecompiledContractsNapoli { PrecompiledAddressesNapoli = append(PrecompiledAddressesNapoli, k) } @@ -207,6 +227,8 @@ func init() { // ActivePrecompiles returns the precompiles enabled with the current configuration. func ActivePrecompiles(rules *chain.Rules) []libcommon.Address { switch { + case rules.IsOptimismGranite: + return PrecompiledAddressesGranite case rules.IsOptimismFjord: return PrecompiledAddressesFjord case rules.IsPrague: @@ -595,6 +617,9 @@ var ( // errBadPairingInput is returned if the bn256 pairing input is invalid. errBadPairingInput = errors.New("bad elliptic curve pairing size") + + // errBadPairingInputSize is returned if the bn256 pairing input size is invalid. + errBadPairingInputSize = errors.New("bad elliptic curve pairing input size") ) // runBn256Pairing implements the Bn256Pairing precompile, referenced by both @@ -628,6 +653,22 @@ func runBn256Pairing(input []byte) ([]byte, error) { return false32Byte, nil } +// bn256PairingGranite implements a pairing pre-compile for the bn256 curve +// conforming to Granite consensus rules. +type bn256PairingGranite struct{} + +// RequiredGas returns the gas required to execute the pre-compiled contract. +func (c *bn256PairingGranite) RequiredGas(input []byte) uint64 { + return new(bn256PairingIstanbul).RequiredGas(input) +} + +func (c *bn256PairingGranite) Run(input []byte) ([]byte, error) { + if len(input) > int(params.Bn256PairingMaxInputSizeGranite) { + return nil, errBadPairingInputSize + } + return runBn256Pairing(input) +} + // bn256PairingIstanbul implements a pairing pre-compile for the bn256 curve // conforming to Istanbul consensus rules. type bn256PairingIstanbul struct{} diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index a20e92ac903..46c729cea4a 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -27,6 +27,7 @@ import ( libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon/common" + "github.com/ledgerwatch/erigon/params" ) // precompiledTest defines the input/output pairs for precompiled contract tests. @@ -56,7 +57,7 @@ var allPrecompiles = map[libcommon.Address]PrecompiledContract{ libcommon.BytesToAddress([]byte{0xf5}): &bigModExp{eip2565: true}, libcommon.BytesToAddress([]byte{6}): &bn256AddIstanbul{}, libcommon.BytesToAddress([]byte{7}): &bn256ScalarMulIstanbul{}, - libcommon.BytesToAddress([]byte{8}): &bn256PairingIstanbul{}, + libcommon.BytesToAddress([]byte{8}): &bn256PairingGranite{}, libcommon.BytesToAddress([]byte{9}): &blake2F{}, libcommon.BytesToAddress([]byte{10}): &bls12381G1Add{}, libcommon.BytesToAddress([]byte{11}): &bls12381G1Mul{}, @@ -279,6 +280,15 @@ func TestPrecompileBlake2FMalformedInput(t *testing.T) { } } +func TestPrecompileBn256PairingTooLargeInput(t *testing.T) { + big := make([]byte, params.Bn256PairingMaxInputSizeGranite+1) + testPrecompiledFailure("08", precompiledFailureTest{ + Input: common.Bytes2Hex(big), + ExpectedError: "bad elliptic curve pairing input size", + Name: "bn256Pairing_input_too_big", + }, t) +} + func TestPrecompiledEcrecover(t *testing.T) { testJson("ecRecover", "01", t) } func testJson(name, addr string, t *testing.T) { diff --git a/core/vm/evm.go b/core/vm/evm.go index efb48b76145..909b275316f 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -37,6 +37,8 @@ var emptyCodeHash = crypto.Keccak256Hash(nil) func (evm *EVM) precompile(addr libcommon.Address) (PrecompiledContract, bool) { var precompiles map[libcommon.Address]PrecompiledContract switch { + case evm.chainRules.IsOptimismGranite: + precompiles = PrecompiledContractsGranite case evm.chainRules.IsOptimismFjord: precompiles = PrecompiledContractsFjord case evm.chainRules.IsPrague: diff --git a/erigon-lib/chain/chain_config.go b/erigon-lib/chain/chain_config.go index 443ba1f54e5..3ba33cfb446 100644 --- a/erigon-lib/chain/chain_config.go +++ b/erigon-lib/chain/chain_config.go @@ -75,6 +75,7 @@ type Config struct { // Delta: the Delta upgrade does not affect the execution-layer, and is thus not configurable in the chain config. EcotoneTime *big.Int `json:"ecotoneTime,omitempty"` // Ecotone switch time (nil = no fork, 0 = already on optimism ecotone) FjordTime *big.Int `json:"fjordTime,omitempty"` // Fjord switch time (nil = no fork, 0 = already on optimism fjord) + GraniteTime *big.Int `json:"graniteTime,omitempty"` // Granite switch time (nil = no fork, 0 = already on Optimism Granite) // Optional EIP-4844 parameters MinBlobGasPrice *uint64 `json:"minBlobGasPrice,omitempty"` @@ -125,7 +126,7 @@ type BorConfig interface { func (c *Config) String() string { engine := c.getEngine() - return fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Prague: %v, Osaka: %v, BedrockBlock: %v, RegolithTime: %v, CanyonTime: %v, EcotoneTime: %v, FjordTime: %v, Engine: %v , NoPruneContracts: %v}", + return fmt.Sprintf("{ChainID: %v, Homestead: %v, DAO: %v, Tangerine Whistle: %v, Spurious Dragon: %v, Byzantium: %v, Constantinople: %v, Petersburg: %v, Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Gray Glacier: %v, Terminal Total Difficulty: %v, Merge Netsplit: %v, Shanghai: %v, Cancun: %v, Prague: %v, Osaka: %v, BedrockBlock: %v, RegolithTime: %v, CanyonTime: %v, EcotoneTime: %v, FjordTime: %v, GraniteTime: %v, Engine: %v , NoPruneContracts: %v}", c.ChainID, c.HomesteadBlock, c.DAOForkBlock, @@ -151,6 +152,7 @@ func (c *Config) String() string { c.CanyonTime, c.EcotoneTime, c.FjordTime, + c.GraniteTime, engine, c.NoPruneContracts, ) @@ -293,6 +295,10 @@ func (c *Config) IsFjord(time uint64) bool { return isForked(c.FjordTime, time) } +func (c *Config) IsGranite(time uint64) bool { + return isForked(c.GraniteTime, time) +} + // IsOptimism returns whether the node is an optimism node or not. func (c *Config) IsOptimism() bool { return c.Optimism != nil @@ -319,6 +325,10 @@ func (c *Config) IsOptimismFjord(time uint64) bool { return c.IsOptimism() && c.IsFjord(time) } +func (c *Config) IsOptimismGranite(time uint64) bool { + return c.IsOptimism() && c.IsGranite(time) +} + // IsOptimismPreBedrock returns true iff this is an optimism node & bedrock is not yet active func (c *Config) IsOptimismPreBedrock(num uint64) bool { return c.IsOptimism() && !c.IsBedrock(num) @@ -612,6 +622,7 @@ type Rules struct { IsAura bool IsOptimismBedrock, IsOptimismRegolith bool IsOptimismCanyon, IsOptimismFjord bool + IsOptimismGranite bool } // Rules ensures c's ChainID is not nil and returns a new Rules instance @@ -642,6 +653,7 @@ func (c *Config) Rules(num uint64, time uint64) *Rules { IsOptimismRegolith: c.IsOptimismRegolith(time), IsOptimismCanyon: c.IsOptimismCanyon(time), IsOptimismFjord: c.IsOptimismFjord(time), + IsOptimismGranite: c.IsOptimismGranite(time), } } diff --git a/eth/backend.go b/eth/backend.go index afad9d872c2..96ae0dd7967 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -312,6 +312,7 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger OverrideOptimismCanyonTime: config.OverrideOptimismCanyonTime, OverrideOptimismEcotoneTime: config.OverrideOptimismEcotoneTime, OverrideOptimismFjordTime: config.OverrideOptimismFjordTime, + OverrideOptimismGraniteTime: config.OverrideOptimismGraniteTime, OverridePragueTime: config.OverridePragueTime, } chainConfig, genesis, genesisErr = core.WriteGenesisBlock(tx, genesisSpec, overrides, tmpdir, logger) diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 7f342177ebb..970df630cc7 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -260,6 +260,7 @@ type Config struct { OverrideOptimismCanyonTime *big.Int `toml:",omitempty"` OverrideOptimismEcotoneTime *big.Int `toml:",omitempty"` OverrideOptimismFjordTime *big.Int `toml:",omitempty"` + OverrideOptimismGraniteTime *big.Int `toml:",omitempty"` // Embedded Silkworm support SilkwormExecution bool diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index f5432c115b4..95a670e5597 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -3,15 +3,20 @@ package ethconfig import ( + "math/big" "time" "github.com/c2h5oh/datasize" "github.com/ledgerwatch/erigon-lib/chain" - libcommon "github.com/ledgerwatch/erigon-lib/common" + "github.com/ledgerwatch/erigon-lib/common" + "github.com/ledgerwatch/erigon-lib/common/datadir" + "github.com/ledgerwatch/erigon-lib/downloader/downloadercfg" + "github.com/ledgerwatch/erigon-lib/txpool/txpoolcfg" + "github.com/ledgerwatch/erigon/cl/beacon/beacon_router_configuration" + "github.com/ledgerwatch/erigon/cl/clparams" "github.com/ledgerwatch/erigon/consensus/ethash/ethashcfg" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/eth/gasprice/gaspricecfg" - "github.com/ledgerwatch/erigon/ethdb/prune" "github.com/ledgerwatch/erigon/params" ) @@ -19,30 +24,71 @@ import ( // MarshalTOML marshals as TOML. func (c Config) MarshalTOML() (interface{}, error) { type Config struct { + Sync Sync Genesis *types.Genesis `toml:",omitempty"` NetworkID uint64 EthDiscoveryURLs []string Prune prune.Mode BatchSize datasize.ByteSize ImportMode bool - BadBlockHash libcommon.Hash + BadBlockHash common.Hash Snapshot BlocksFreezing - BlockDownloaderWindow int + Downloader *downloadercfg.Cfg + BeaconRouter beacon_router_configuration.RouterConfiguration + CaplinConfig clparams.CaplinConfig + Dirs datadir.Dirs ExternalSnapshotDownloaderAddr string - Whitelist map[uint64]libcommon.Hash `toml:"-"` + Whitelist map[uint64]common.Hash `toml:"-"` Miner params.MiningConfig Ethash ethashcfg.Config Clique params.ConsensusSnapshotConfig Aura chain.AuRaConfig - TxPool DeprecatedTxPoolConfig + DeprecatedTxPool DeprecatedTxPoolConfig + TxPool txpoolcfg.Config GPO gaspricecfg.Config RPCGasCap uint64 `toml:",omitempty"` RPCTxFeeCap float64 `toml:",omitempty"` StateStream bool - BodyDownloadTimeoutSeconds int - SyncLoopThrottle time.Duration + HistoryV3 bool + HeimdallURL string + WithoutHeimdall bool + WithHeimdallMilestones bool + WithHeimdallWaypointRecording bool + PolygonSync bool + Ethstats string + InternalCL bool + LightClientDiscoveryAddr string + LightClientDiscoveryPort uint64 + LightClientDiscoveryTCPPort uint64 + SentinelAddr string + SentinelPort uint64 + ForcePartialCommit bool + OverrideCancunTime *big.Int `toml:",omitempty"` + OverrideShanghaiTime *big.Int `toml:",omitempty"` + OverridePragueTime *big.Int `toml:",omitempty"` + OverrideOptimismCanyonTime *big.Int `toml:",omitempty"` + OverrideOptimismEcotoneTime *big.Int `toml:",omitempty"` + OverrideOptimismFjordTime *big.Int `toml:",omitempty"` + OverrideOptimismGraniteTime *big.Int `toml:",omitempty"` + SilkwormExecution bool + SilkwormRpcDaemon bool + SilkwormSentry bool + SilkwormVerbosity string + SilkwormNumContexts uint32 + SilkwormRpcLogEnabled bool + SilkwormRpcLogDirPath string + SilkwormRpcLogMaxFileSize uint16 + SilkwormRpcLogMaxFiles uint16 + SilkwormRpcLogDumpResponse bool + SilkwormRpcNumWorkers uint32 + SilkwormRpcJsonCompatibility bool + DisableTxPoolGossip bool + RollupSequencerHTTP string + RollupHistoricalRPC string + RollupHistoricalRPCTimeout time.Duration } var enc Config + enc.Sync = c.Sync enc.Genesis = c.Genesis enc.NetworkID = c.NetworkID enc.EthDiscoveryURLs = c.EthDiscoveryURLs @@ -51,50 +97,135 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.ImportMode = c.ImportMode enc.BadBlockHash = c.BadBlockHash enc.Snapshot = c.Snapshot + enc.Downloader = c.Downloader + enc.BeaconRouter = c.BeaconRouter + enc.CaplinConfig = c.CaplinConfig + enc.Dirs = c.Dirs enc.ExternalSnapshotDownloaderAddr = c.ExternalSnapshotDownloaderAddr enc.Whitelist = c.Whitelist enc.Miner = c.Miner enc.Ethash = c.Ethash enc.Clique = c.Clique enc.Aura = c.Aura - enc.TxPool = c.DeprecatedTxPool + enc.DeprecatedTxPool = c.DeprecatedTxPool + enc.TxPool = c.TxPool enc.GPO = c.GPO enc.RPCGasCap = c.RPCGasCap enc.RPCTxFeeCap = c.RPCTxFeeCap enc.StateStream = c.StateStream + enc.HistoryV3 = c.HistoryV3 + enc.HeimdallURL = c.HeimdallURL + enc.WithoutHeimdall = c.WithoutHeimdall + enc.WithHeimdallMilestones = c.WithHeimdallMilestones + enc.WithHeimdallWaypointRecording = c.WithHeimdallWaypointRecording + enc.PolygonSync = c.PolygonSync + enc.Ethstats = c.Ethstats + enc.InternalCL = c.InternalCL + enc.LightClientDiscoveryAddr = c.LightClientDiscoveryAddr + enc.LightClientDiscoveryPort = c.LightClientDiscoveryPort + enc.LightClientDiscoveryTCPPort = c.LightClientDiscoveryTCPPort + enc.SentinelAddr = c.SentinelAddr + enc.SentinelPort = c.SentinelPort + enc.ForcePartialCommit = c.ForcePartialCommit + enc.OverrideCancunTime = c.OverrideCancunTime + enc.OverrideShanghaiTime = c.OverrideShanghaiTime + enc.OverridePragueTime = c.OverridePragueTime + enc.OverrideOptimismCanyonTime = c.OverrideOptimismCanyonTime + enc.OverrideOptimismEcotoneTime = c.OverrideOptimismEcotoneTime + enc.OverrideOptimismFjordTime = c.OverrideOptimismFjordTime + enc.OverrideOptimismGraniteTime = c.OverrideOptimismGraniteTime + enc.SilkwormExecution = c.SilkwormExecution + enc.SilkwormRpcDaemon = c.SilkwormRpcDaemon + enc.SilkwormSentry = c.SilkwormSentry + enc.SilkwormVerbosity = c.SilkwormVerbosity + enc.SilkwormNumContexts = c.SilkwormNumContexts + enc.SilkwormRpcLogEnabled = c.SilkwormRpcLogEnabled + enc.SilkwormRpcLogDirPath = c.SilkwormRpcLogDirPath + enc.SilkwormRpcLogMaxFileSize = c.SilkwormRpcLogMaxFileSize + enc.SilkwormRpcLogMaxFiles = c.SilkwormRpcLogMaxFiles + enc.SilkwormRpcLogDumpResponse = c.SilkwormRpcLogDumpResponse + enc.SilkwormRpcNumWorkers = c.SilkwormRpcNumWorkers + enc.SilkwormRpcJsonCompatibility = c.SilkwormRpcJsonCompatibility + enc.DisableTxPoolGossip = c.DisableTxPoolGossip + enc.RollupSequencerHTTP = c.RollupSequencerHTTP + enc.RollupHistoricalRPC = c.RollupHistoricalRPC + enc.RollupHistoricalRPCTimeout = c.RollupHistoricalRPCTimeout return &enc, nil } // UnmarshalTOML unmarshals from TOML. func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { type Config struct { + Sync *Sync Genesis *types.Genesis `toml:",omitempty"` NetworkID *uint64 EthDiscoveryURLs []string Prune *prune.Mode BatchSize *datasize.ByteSize ImportMode *bool - BadBlockHash *libcommon.Hash + BadBlockHash *common.Hash Snapshot *BlocksFreezing - BlockDownloaderWindow *int + Downloader *downloadercfg.Cfg + BeaconRouter *beacon_router_configuration.RouterConfiguration + CaplinConfig *clparams.CaplinConfig + Dirs *datadir.Dirs ExternalSnapshotDownloaderAddr *string - Whitelist map[uint64]libcommon.Hash `toml:"-"` + Whitelist map[uint64]common.Hash `toml:"-"` Miner *params.MiningConfig Ethash *ethashcfg.Config Clique *params.ConsensusSnapshotConfig Aura *chain.AuRaConfig - TxPool *DeprecatedTxPoolConfig + DeprecatedTxPool *DeprecatedTxPoolConfig + TxPool *txpoolcfg.Config GPO *gaspricecfg.Config RPCGasCap *uint64 `toml:",omitempty"` RPCTxFeeCap *float64 `toml:",omitempty"` StateStream *bool - BodyDownloadTimeoutSeconds *int - SyncLoopThrottle *time.Duration + HistoryV3 *bool + HeimdallURL *string + WithoutHeimdall *bool + WithHeimdallMilestones *bool + WithHeimdallWaypointRecording *bool + PolygonSync *bool + Ethstats *string + InternalCL *bool + LightClientDiscoveryAddr *string + LightClientDiscoveryPort *uint64 + LightClientDiscoveryTCPPort *uint64 + SentinelAddr *string + SentinelPort *uint64 + ForcePartialCommit *bool + OverrideCancunTime *big.Int `toml:",omitempty"` + OverrideShanghaiTime *big.Int `toml:",omitempty"` + OverridePragueTime *big.Int `toml:",omitempty"` + OverrideOptimismCanyonTime *big.Int `toml:",omitempty"` + OverrideOptimismEcotoneTime *big.Int `toml:",omitempty"` + OverrideOptimismFjordTime *big.Int `toml:",omitempty"` + OverrideOptimismGraniteTime *big.Int `toml:",omitempty"` + SilkwormExecution *bool + SilkwormRpcDaemon *bool + SilkwormSentry *bool + SilkwormVerbosity *string + SilkwormNumContexts *uint32 + SilkwormRpcLogEnabled *bool + SilkwormRpcLogDirPath *string + SilkwormRpcLogMaxFileSize *uint16 + SilkwormRpcLogMaxFiles *uint16 + SilkwormRpcLogDumpResponse *bool + SilkwormRpcNumWorkers *uint32 + SilkwormRpcJsonCompatibility *bool + DisableTxPoolGossip *bool + RollupSequencerHTTP *string + RollupHistoricalRPC *string + RollupHistoricalRPCTimeout *time.Duration } var dec Config if err := unmarshal(&dec); err != nil { return err } + if dec.Sync != nil { + c.Sync = *dec.Sync + } if dec.Genesis != nil { c.Genesis = dec.Genesis } @@ -119,6 +250,18 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.Snapshot != nil { c.Snapshot = *dec.Snapshot } + if dec.Downloader != nil { + c.Downloader = dec.Downloader + } + if dec.BeaconRouter != nil { + c.BeaconRouter = *dec.BeaconRouter + } + if dec.CaplinConfig != nil { + c.CaplinConfig = *dec.CaplinConfig + } + if dec.Dirs != nil { + c.Dirs = *dec.Dirs + } if dec.ExternalSnapshotDownloaderAddr != nil { c.ExternalSnapshotDownloaderAddr = *dec.ExternalSnapshotDownloaderAddr } @@ -137,8 +280,11 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.Aura != nil { c.Aura = *dec.Aura } + if dec.DeprecatedTxPool != nil { + c.DeprecatedTxPool = *dec.DeprecatedTxPool + } if dec.TxPool != nil { - c.DeprecatedTxPool = *dec.TxPool + c.TxPool = *dec.TxPool } if dec.GPO != nil { c.GPO = *dec.GPO @@ -152,5 +298,116 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.StateStream != nil { c.StateStream = *dec.StateStream } + if dec.HistoryV3 != nil { + c.HistoryV3 = *dec.HistoryV3 + } + if dec.HeimdallURL != nil { + c.HeimdallURL = *dec.HeimdallURL + } + if dec.WithoutHeimdall != nil { + c.WithoutHeimdall = *dec.WithoutHeimdall + } + if dec.WithHeimdallMilestones != nil { + c.WithHeimdallMilestones = *dec.WithHeimdallMilestones + } + if dec.WithHeimdallWaypointRecording != nil { + c.WithHeimdallWaypointRecording = *dec.WithHeimdallWaypointRecording + } + if dec.PolygonSync != nil { + c.PolygonSync = *dec.PolygonSync + } + if dec.Ethstats != nil { + c.Ethstats = *dec.Ethstats + } + if dec.InternalCL != nil { + c.InternalCL = *dec.InternalCL + } + if dec.LightClientDiscoveryAddr != nil { + c.LightClientDiscoveryAddr = *dec.LightClientDiscoveryAddr + } + if dec.LightClientDiscoveryPort != nil { + c.LightClientDiscoveryPort = *dec.LightClientDiscoveryPort + } + if dec.LightClientDiscoveryTCPPort != nil { + c.LightClientDiscoveryTCPPort = *dec.LightClientDiscoveryTCPPort + } + if dec.SentinelAddr != nil { + c.SentinelAddr = *dec.SentinelAddr + } + if dec.SentinelPort != nil { + c.SentinelPort = *dec.SentinelPort + } + if dec.ForcePartialCommit != nil { + c.ForcePartialCommit = *dec.ForcePartialCommit + } + if dec.OverrideCancunTime != nil { + c.OverrideCancunTime = dec.OverrideCancunTime + } + if dec.OverrideShanghaiTime != nil { + c.OverrideShanghaiTime = dec.OverrideShanghaiTime + } + if dec.OverridePragueTime != nil { + c.OverridePragueTime = dec.OverridePragueTime + } + if dec.OverrideOptimismCanyonTime != nil { + c.OverrideOptimismCanyonTime = dec.OverrideOptimismCanyonTime + } + if dec.OverrideOptimismEcotoneTime != nil { + c.OverrideOptimismEcotoneTime = dec.OverrideOptimismEcotoneTime + } + if dec.OverrideOptimismFjordTime != nil { + c.OverrideOptimismFjordTime = dec.OverrideOptimismFjordTime + } + if dec.OverrideOptimismGraniteTime != nil { + c.OverrideOptimismGraniteTime = dec.OverrideOptimismGraniteTime + } + if dec.SilkwormExecution != nil { + c.SilkwormExecution = *dec.SilkwormExecution + } + if dec.SilkwormRpcDaemon != nil { + c.SilkwormRpcDaemon = *dec.SilkwormRpcDaemon + } + if dec.SilkwormSentry != nil { + c.SilkwormSentry = *dec.SilkwormSentry + } + if dec.SilkwormVerbosity != nil { + c.SilkwormVerbosity = *dec.SilkwormVerbosity + } + if dec.SilkwormNumContexts != nil { + c.SilkwormNumContexts = *dec.SilkwormNumContexts + } + if dec.SilkwormRpcLogEnabled != nil { + c.SilkwormRpcLogEnabled = *dec.SilkwormRpcLogEnabled + } + if dec.SilkwormRpcLogDirPath != nil { + c.SilkwormRpcLogDirPath = *dec.SilkwormRpcLogDirPath + } + if dec.SilkwormRpcLogMaxFileSize != nil { + c.SilkwormRpcLogMaxFileSize = *dec.SilkwormRpcLogMaxFileSize + } + if dec.SilkwormRpcLogMaxFiles != nil { + c.SilkwormRpcLogMaxFiles = *dec.SilkwormRpcLogMaxFiles + } + if dec.SilkwormRpcLogDumpResponse != nil { + c.SilkwormRpcLogDumpResponse = *dec.SilkwormRpcLogDumpResponse + } + if dec.SilkwormRpcNumWorkers != nil { + c.SilkwormRpcNumWorkers = *dec.SilkwormRpcNumWorkers + } + if dec.SilkwormRpcJsonCompatibility != nil { + c.SilkwormRpcJsonCompatibility = *dec.SilkwormRpcJsonCompatibility + } + if dec.DisableTxPoolGossip != nil { + c.DisableTxPoolGossip = *dec.DisableTxPoolGossip + } + if dec.RollupSequencerHTTP != nil { + c.RollupSequencerHTTP = *dec.RollupSequencerHTTP + } + if dec.RollupHistoricalRPC != nil { + c.RollupHistoricalRPC = *dec.RollupHistoricalRPC + } + if dec.RollupHistoricalRPCTimeout != nil { + c.RollupHistoricalRPCTimeout = *dec.RollupHistoricalRPCTimeout + } return nil } diff --git a/go.mod b/go.mod index ba991657a11..d58e25a6c4e 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/consensys/gnark-crypto v0.12.1 github.com/crate-crypto/go-ipa v0.0.0-20221111143132-9aa5d42120bc github.com/crate-crypto/go-kzg-4844 v0.7.0 - github.com/davecgh/go-spew v1.1.1 + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/deckarep/golang-set v1.8.0 github.com/deckarep/golang-set/v2 v2.3.1 github.com/docker/docker v26.1.0+incompatible @@ -93,11 +93,11 @@ require ( github.com/xsleonard/go-merkle v1.1.0 go.uber.org/mock v0.4.0 go.uber.org/zap v1.27.0 - golang.org/x/crypto v0.22.0 + golang.org/x/crypto v0.23.0 golang.org/x/exp v0.0.0-20231226003508-02704c960a9b golang.org/x/net v0.24.0 golang.org/x/sync v0.7.0 - golang.org/x/sys v0.19.0 + golang.org/x/sys v0.20.0 golang.org/x/time v0.5.0 google.golang.org/grpc v1.63.2 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 @@ -119,6 +119,7 @@ require ( ) require ( + github.com/BurntSushi/toml v1.4.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/agnivade/levenshtein v1.1.1 // indirect @@ -241,7 +242,7 @@ require ( github.com/pion/turn/v2 v2.0.8 // indirect github.com/pion/udp v0.1.4 // indirect github.com/pion/webrtc/v3 v3.1.42 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -275,7 +276,7 @@ require ( go.uber.org/fx v1.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/tools v0.20.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect @@ -297,4 +298,4 @@ replace github.com/anacrolix/torrent => github.com/erigontech/torrent v1.54.2-al replace github.com/ledgerwatch/erigon-lib => ./erigon-lib -replace github.com/ethereum-optimism/superchain-registry/superchain => github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240709155336-a98d1dc97fa3 +replace github.com/ethereum-optimism/superchain-registry/superchain => github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240729164030-32ce35a5f917 diff --git a/go.sum b/go.sum index 6aaed6efcd1..36faf87bf87 100644 --- a/go.sum +++ b/go.sum @@ -52,6 +52,8 @@ git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGy github.com/99designs/gqlgen v0.17.40 h1:/l8JcEVQ93wqIfmH9VS1jsAkwm6eAF1NwQn3N+SDqBY= github.com/99designs/gqlgen v0.17.40/go.mod h1:b62q1USk82GYIVjC60h02YguAZLqYZtvWml8KkhJps4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Giulio2002/bls v0.0.0-20240315151443-652e18a3d188 h1:X+7WswmEBD7DVOlAIXQiU4hok5pPcXFM7JgULHHdD/4= github.com/Giulio2002/bls v0.0.0-20240315151443-652e18a3d188/go.mod h1:nCQrFU6/QsJtLS+SBLWRn9UG2nds1f3hQKfWHCrtUqw= @@ -169,8 +171,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bits-and-blooms/bitset v1.12.0 h1:U/q1fAF7xXRhFCrhROzIfffYnu+dlS38vCZtmFVPHmA= github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240709155336-a98d1dc97fa3 h1:rl/ml7j466rE57UfkZvaqbeKwYugdyN2osYQabXlbxo= -github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240709155336-a98d1dc97fa3/go.mod h1:7xh2awFQqsiZxFrHKTgEd+InVfDRrkKVUIuK8SAFHp0= +github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240729164030-32ce35a5f917 h1:mthXgUm6xwHHWULlzFR5goG9Dox28CqThSAX6kv4vKQ= +github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240729164030-32ce35a5f917/go.mod h1:zy9f3TNPS7pwW4msMitF83fp0Wf452tZ6+Fg6d4JyXM= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo= github.com/bradfitz/iter v0.0.0-20190303215204-33e6a9893b0c/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo= @@ -225,8 +227,9 @@ github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBS github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= @@ -740,8 +743,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -993,8 +997,8 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1201,8 +1205,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1223,8 +1227,9 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/params/protocol_params.go b/params/protocol_params.go index 048f9c6a971..60ceaad3174 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -159,6 +159,8 @@ const ( Bn256PairingPerPointGasByzantium uint64 = 80000 // Byzantium per-point price for an elliptic curve pairing check Bn256PairingPerPointGasIstanbul uint64 = 34000 // Per-point price for an elliptic curve pairing check + Bn256PairingMaxInputSizeGranite uint64 = 112687 // Maximum input size for an elliptic curve pairing check + Bls12381G1AddGas uint64 = 500 // Price for BLS12-381 elliptic curve G1 point addition Bls12381G1MulGas uint64 = 12000 // Price for BLS12-381 elliptic curve G1 point scalar multiplication Bls12381G2AddGas uint64 = 800 // Price for BLS12-381 elliptic curve G2 point addition diff --git a/params/superchain.go b/params/superchain.go index d5b8c2d895d..d513a1af771 100644 --- a/params/superchain.go +++ b/params/superchain.go @@ -124,6 +124,7 @@ func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config CanyonTime: nil, EcotoneTime: nil, FjordTime: nil, + GraniteTime: nil, TerminalTotalDifficulty: common.Big0, TerminalTotalDifficultyPassed: true, Ethash: nil, @@ -146,6 +147,9 @@ func LoadSuperChainConfig(opStackChainCfg *superchain.ChainConfig) *chain.Config if opStackChainCfg.FjordTime != nil { out.FjordTime = new(big.Int).SetUint64(*opStackChainCfg.FjordTime) } + if opStackChainCfg.GraniteTime != nil { + out.GraniteTime = new(big.Int).SetUint64(*opStackChainCfg.GraniteTime) + } // note: no actual parameters are being loaded, yet. // Future superchain upgrades are loaded from the superchain chConfig and applied to the geth ChainConfig here. diff --git a/params/superchain_test.go b/params/superchain_test.go index e4ee0266773..f7944987f26 100644 --- a/params/superchain_test.go +++ b/params/superchain_test.go @@ -17,6 +17,7 @@ type hardforkConfig struct { CanyonTime *big.Int EcotoneTime *big.Int FjordTime *big.Int + GraniteTime *big.Int EIP1559Elasticity uint64 EIP1559Denominator uint64 EIP1559DenominatorCanyon uint64 @@ -31,6 +32,7 @@ var bobaSepoliaCfg = hardforkConfig{ CanyonTime: big.NewInt(1705600788), EcotoneTime: big.NewInt(1709078400), FjordTime: big.NewInt(1722297600), + GraniteTime: nil, EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: 250, @@ -45,6 +47,7 @@ var bobaMainnetCfg = hardforkConfig{ CanyonTime: big.NewInt(1713302879), EcotoneTime: big.NewInt(1713302880), FjordTime: nil, + GraniteTime: nil, EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: 250, @@ -59,6 +62,7 @@ var bobaBnbTestnetCfg = hardforkConfig{ CanyonTime: big.NewInt(1718920167), EcotoneTime: big.NewInt(1718920168), FjordTime: big.NewInt(1722297600), + GraniteTime: nil, EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: 250, @@ -73,6 +77,7 @@ var opSepoliaCfg = hardforkConfig{ CanyonTime: big.NewInt(1699981200), EcotoneTime: big.NewInt(1708534800), FjordTime: big.NewInt(1716998400), + GraniteTime: nil, EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: 250, @@ -87,6 +92,7 @@ var opMainnetCfg = hardforkConfig{ CanyonTime: big.NewInt(1704992401), EcotoneTime: big.NewInt(1710374401), FjordTime: big.NewInt(1720627201), + GraniteTime: nil, EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: 250, diff --git a/turbo/cli/default_flags.go b/turbo/cli/default_flags.go index 47723db0266..e3da18ffdc8 100644 --- a/turbo/cli/default_flags.go +++ b/turbo/cli/default_flags.go @@ -166,6 +166,7 @@ var DefaultFlags = []cli.Flag{ &utils.OverrideOptimismCanyonFlag, &utils.OverrideOptimismEcotoneFlag, &utils.OverrideOptimismFjordFlag, + &utils.OverrideOptimismGraniteFlag, &utils.RollupSequencerHTTPFlag, &utils.RollupHistoricalRPCFlag, &utils.RollupHistoricalRPCTimeoutFlag, From 8717283664f3ff6e971dba9f1f7fc46b5e1fd00e Mon Sep 17 00:00:00 2001 From: cby3149 Date: Fri, 9 Aug 2024 11:57:47 -0700 Subject: [PATCH 2/6] Add warn message --- eth/backend.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eth/backend.go b/eth/backend.go index 96ae0dd7967..11df70bdeb4 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -338,6 +338,12 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger if chainConfig.EcotoneTime == nil { log.Warn("Optimism EcotoneTime has not been set") } + if chainConfig.FjordTime == nil { + log.Warn("Optimism FjordTime has not been set") + } + if chainConfig.GraniteTime == nil { + log.Warn("Optimism GraniteTime has not been set") + } } setBorDefaultMinerGasPrice(chainConfig, config, logger) From cbd014ccf8227baf2610c36707cef8efdce08c4c Mon Sep 17 00:00:00 2001 From: cby3149 Date: Fri, 9 Aug 2024 13:08:47 -0700 Subject: [PATCH 3/6] Update ext-test template --- tests/erigon-ext-test/go.mod.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/erigon-ext-test/go.mod.template b/tests/erigon-ext-test/go.mod.template index 5e56bf3d761..a08fc664a1e 100644 --- a/tests/erigon-ext-test/go.mod.template +++ b/tests/erigon-ext-test/go.mod.template @@ -4,8 +4,8 @@ go 1.20 require github.com/ledgerwatch/erigon devel -replace github.com/ledgerwatch/erigon => github.com/bobanetwork/v3-erigon $COMMIT_SHA +replace github.com/ledgerwatch/erigon => github.com/bobanetwork/op-erigon $COMMIT_SHA -replace github.com/ledgerwatch/erigon-lib => github.com/bobanetwork/v3-erigon/erigon-lib $COMMIT_SHA +replace github.com/ledgerwatch/erigon-lib => github.com/bobanetwork/op-erigon/erigon-lib $COMMIT_SHA require github.com/ethereum/go-ethereum v1.13.3 From d3b65663ddafec6d058ea0050b724e52857b2afd Mon Sep 17 00:00:00 2001 From: cby3149 Date: Fri, 9 Aug 2024 13:46:35 -0700 Subject: [PATCH 4/6] Update superchain-registry/superchain hash --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d58e25a6c4e..c526e2f8600 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf github.com/edsrzf/mmap-go v1.1.0 github.com/emicklei/dot v1.6.1 - github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240315155522-09647974da0d + github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240726164940-d2a098074a5d github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c github.com/gballet/go-verkle v0.0.0-20221121182333-31427a1f2d35 github.com/gfx-labs/sse v0.0.0-20231226060816-f747e26a9baa From bc9e8b71079d81e8c86d1740421c9dccdbfdd1e8 Mon Sep 17 00:00:00 2001 From: cby3149 Date: Mon, 19 Aug 2024 16:31:48 -0700 Subject: [PATCH 5/6] Update superchain-registry repo --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c526e2f8600..46c34148a85 100644 --- a/go.mod +++ b/go.mod @@ -298,4 +298,4 @@ replace github.com/anacrolix/torrent => github.com/erigontech/torrent v1.54.2-al replace github.com/ledgerwatch/erigon-lib => ./erigon-lib -replace github.com/ethereum-optimism/superchain-registry/superchain => github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240729164030-32ce35a5f917 +replace github.com/ethereum-optimism/superchain-registry/superchain => github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240819154617-8df002c150f0 diff --git a/go.sum b/go.sum index 36faf87bf87..0dc392a66ee 100644 --- a/go.sum +++ b/go.sum @@ -171,8 +171,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bits-and-blooms/bitset v1.12.0 h1:U/q1fAF7xXRhFCrhROzIfffYnu+dlS38vCZtmFVPHmA= github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240729164030-32ce35a5f917 h1:mthXgUm6xwHHWULlzFR5goG9Dox28CqThSAX6kv4vKQ= -github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240729164030-32ce35a5f917/go.mod h1:zy9f3TNPS7pwW4msMitF83fp0Wf452tZ6+Fg6d4JyXM= +github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240819154617-8df002c150f0 h1:x0hI6E4LkcoNWK6izCSTPSEgwO4RirDf9eDN2M6K2Do= +github.com/bobanetwork/superchain-registry/superchain v0.0.0-20240819154617-8df002c150f0/go.mod h1:zy9f3TNPS7pwW4msMitF83fp0Wf452tZ6+Fg6d4JyXM= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo= github.com/bradfitz/iter v0.0.0-20190303215204-33e6a9893b0c/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo= From 8db3d4f3c73863d6bbba7f8c9a07d8cee3f63a8e Mon Sep 17 00:00:00 2001 From: cby3149 Date: Tue, 20 Aug 2024 12:34:41 -0700 Subject: [PATCH 6/6] Fix lint --- params/superchain_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/params/superchain_test.go b/params/superchain_test.go index 39a8b7854da..c9db3d63c8a 100644 --- a/params/superchain_test.go +++ b/params/superchain_test.go @@ -47,7 +47,7 @@ var bobaMainnetCfg = hardforkConfig{ CanyonTime: big.NewInt(1713302879), EcotoneTime: big.NewInt(1713302880), FjordTime: big.NewInt(1725951600), - GraniteTime: nil, + GraniteTime: nil, EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: 250,