Skip to content

Commit

Permalink
Merge branch 'optimism' into seb/geth-v1.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianst committed Feb 24, 2025
2 parents cb34678 + 7017b54 commit 1fb8462
Show file tree
Hide file tree
Showing 22 changed files with 99 additions and 18 deletions.
7 changes: 3 additions & 4 deletions .circleci/ci-docker-tag-op-geth-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ fi
echo "Tagging $SOURCE_IMAGE_TAG with '$IMAGE_TAG'"
gcloud container images add-tag -q "$SOURCE_IMAGE_TAG" "$TARGET_IMAGE_TAG"

# Do not tag with latest if the release is a release candidate.
if [[ "$IMAGE_TAG" == *"rc"* ]]; then
echo "Not tagging with 'latest' because the release is a release candidate."
# Only tag finalized releases with 'latest'
if ! [[ "$IMAGE_TAG" =~ ^v1\.[0-9]+\.[0-9]+$ ]]; then
echo "Not tagging with 'latest' because the release is not finalized."
exit 0
fi

echo "Tagging $SOURCE_IMAGE_TAG with 'latest'"
gcloud container images add-tag -q "$SOURCE_IMAGE_TAG" "$TARGET_IMAGE_TAG_LATEST"

4 changes: 4 additions & 0 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
core.ProcessConsolidationQueue(&requests, evm)
}

if chainConfig.IsIsthmus(vmContext.Time) {
requests = [][]byte{}
}

// Commit block
root, err := statedb.Commit(vmContext.BlockNumber.Uint64(), chainConfig.IsEIP158(vmContext.BlockNumber), chainConfig.IsCancun(vmContext.BlockNumber, vmContext.Time))
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ func makeFullNode(ctx *cli.Context) *node.Node {
cfg.Eth.OverrideOptimismIsthmus = &v
}

if ctx.IsSet(utils.OverrideOptimismJovian.Name) {
v := ctx.Uint64(utils.OverrideOptimismJovian.Name)
cfg.Eth.OverrideOptimismJovian = &v
}

if ctx.IsSet(utils.OverrideOptimismInterop.Name) {
v := ctx.Uint64(utils.OverrideOptimismInterop.Name)
cfg.Eth.OverrideOptimismInterop = &v
Expand Down
3 changes: 2 additions & 1 deletion cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ var (
utils.OverrideOptimismFjord,
utils.OverrideOptimismGranite,
utils.OverrideOptimismHolocene,
utils.OverrideOptimismInterop,
utils.OverrideOptimismIsthmus,
utils.OverrideOptimismJovian,
utils.OverrideOptimismInterop,
utils.EnablePersonal, // deprecated
utils.TxPoolLocalsFlag,
utils.TxPoolNoLocalsFlag,
Expand Down
11 changes: 8 additions & 3 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,19 @@ var (
Usage: "Manually specify the Optimism Granite fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideOptimismHolocene = &cli.Uint64Flag{
Name: "override.holocene",
Usage: "Manually specify the Optimism Holocene fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideOptimismIsthmus = &cli.Uint64Flag{
Name: "override.isthmus",
Usage: "Manually specify the Optimism Isthmus fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideOptimismHolocene = &cli.Uint64Flag{
Name: "override.holocene",
Usage: "Manually specify the Optimism Holocene fork timestamp, overriding the bundled setting",
OverrideOptimismJovian = &cli.Uint64Flag{
Name: "override.jovian",
Usage: "Manually specify the Optimism Jovian fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideOptimismInterop = &cli.Uint64Flag{
Expand Down
5 changes: 5 additions & 0 deletions core/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ func (b *BlockGen) collectRequests(readonly bool) (requests [][]byte) {
// EIP-7251
ProcessConsolidationQueue(&requests, evm)
}

if b.cm.config.IsIsthmus(b.header.Time) {
requests = [][]byte{}
}

return requests
}

Expand Down
4 changes: 4 additions & 0 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ type ChainOverrides struct {
OverrideOptimismGranite *uint64
OverrideOptimismHolocene *uint64
OverrideOptimismIsthmus *uint64
OverrideOptimismJovian *uint64
OverrideOptimismInterop *uint64
ApplySuperchainUpgrades bool
}
Expand Down Expand Up @@ -367,6 +368,9 @@ func (o *ChainOverrides) apply(cfg *params.ChainConfig) error {
cfg.IsthmusTime = o.OverrideOptimismIsthmus
cfg.PragueTime = o.OverrideOptimismIsthmus
}
if o.OverrideOptimismJovian != nil {
cfg.JovianTime = o.OverrideOptimismJovian
}
if o.OverrideOptimismInterop != nil {
cfg.InteropTime = o.OverrideOptimismInterop
}
Expand Down
1 change: 1 addition & 0 deletions core/rlp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ func TestBlockRlpEncodeDecode(t *testing.T) {
config := *params.OptimismTestConfig
config.ShanghaiTime = &zeroTime
config.IsthmusTime = &zeroTime
config.CancunTime = &zeroTime
require.True(t, config.IsOptimismIsthmus(zeroTime))

block := getBlock(&config, 10, 2, 50)
Expand Down
4 changes: 4 additions & 0 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
ProcessConsolidationQueue(&requests, evm)
}

if p.config.IsIsthmus(block.Time()) {
requests = [][]byte{}
}

// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
p.chain.engine.Finalize(p.chain, header, tracingStateDB, block.Body())

Expand Down
3 changes: 3 additions & 0 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
if config.OverrideOptimismIsthmus != nil {
overrides.OverrideOptimismIsthmus = config.OverrideOptimismIsthmus
}
if config.OverrideOptimismJovian != nil {
overrides.OverrideOptimismJovian = config.OverrideOptimismJovian
}
if config.OverrideOptimismInterop != nil {
overrides.OverrideOptimismInterop = config.OverrideOptimismInterop
}
Expand Down
6 changes: 4 additions & 2 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@ type Config struct {

OverrideOptimismHolocene *uint64 `toml:",omitempty"`

OverrideOptimismInterop *uint64 `toml:",omitempty"`

OverrideOptimismIsthmus *uint64 `toml:",omitempty"`

OverrideOptimismJovian *uint64 `toml:",omitempty"`

OverrideOptimismInterop *uint64 `toml:",omitempty"`

// ApplySuperchainUpgrades requests the node to load chain-configuration from the superchain-registry.
ApplySuperchainUpgrades bool `toml:",omitempty"`

Expand Down
18 changes: 12 additions & 6 deletions eth/ethconfig/gen_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions fork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ def:
globs:
- "eth/downloader/downloader.go"
- "eth/downloader/receiptreference.go"
- title: PathDB diff-layers limit
description: |
Prevent the write-buffer to grow too large, to keep the journal optional,
and not restart on top of unavailable state.
globs:
- "triedb/pathdb/buffer.go"
- title: Discv5 node discovery
description: Fix discv5 option to allow discv5 to be an active source for node-discovery.
globs:
Expand Down
5 changes: 5 additions & 0 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ func (miner *Miner) generateWork(params *generateParams, witness bool) *newPaylo
// EIP-7251 consolidations
core.ProcessConsolidationQueue(&requests, work.evm)
}

if miner.chainConfig.IsIsthmus(work.header.Time) {
requests = [][]byte{}
}

if requests != nil {
reqHash := types.CalcRequestsHash(requests)
work.header.RequestsHash = &reqHash
Expand Down
3 changes: 3 additions & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ func (n *Node) startRPC() error {
if slices.Contains(n.config.HTTPModules, "miner") {
authModules = append(authModules, "miner")
}
if slices.Contains(n.config.HTTPModules, "debug") {
authModules = append(authModules, "debug")
}

// Enable auth via HTTP
server := n.httpAuth
Expand Down
8 changes: 8 additions & 0 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ var V5OPBootnodes = []string{
"enode://acf4507a211ba7c1e52cdf4eef62cdc3c32e7c9c47998954f7ba024026f9a6b2150cd3f0b734d9c78e507ab70d59ba61dfe5c45e1078c7ad0775fb251d7735a2@3.220.145.177:30301",
"enode://8a5a5006159bf079d06a04e5eceab2a1ce6e0f721875b2a9c96905336219dbe14203d38f70f3754686a6324f786c2f9852d8c0dd3adac2d080f4db35efc678c5@3.231.11.52:30301",
"enode://cdadbe835308ad3557f9a1de8db411da1a260a98f8421d62da90e71da66e55e98aaa8e90aa7ce01b408a54e4bd2253d701218081ded3dbe5efbbc7b41d7cef79@54.198.153.150:30301",
// Uniswap Labs
"enode://b1a743328188dba3b2ed8c06abbb2688fabe64a3251e43bd77d4e5265bbd5cf03eca8ace4cde8ddb0c49c409b90bf941ebf556094638c6203edd6baa5ef0091b@3.134.214.169:30303",
"enode://ea9eaaf695facbe53090beb7a5b0411a81459bbf6e6caac151e587ee77120a1b07f3b9f3a9550f797d73d69840a643b775fd1e40344dea11e7660b6a483fe80e@52.14.30.39:30303",
"enode://77b6b1e72984d5d50e00ae934ffea982902226fe92fa50da42334c2750d8e405b55a5baabeb988c88125368142a64eda5096d0d4522d3b6eef75d166c7d303a9@3.148.100.173:30303",
}

var V5OPTestnetBootnodes = []string{
Expand All @@ -91,6 +95,10 @@ var V5OPTestnetBootnodes = []string{
// Base
"enode://548f715f3fc388a7c917ba644a2f16270f1ede48a5d88a4d14ea287cc916068363f3092e39936f1a3e7885198bef0e5af951f1d7b1041ce8ba4010917777e71f@18.210.176.114:30301",
"enode://6f10052847a966a725c9f4adf6716f9141155b99a0fb487fea3f51498f4c2a2cb8d534e680ee678f9447db85b93ff7c74562762c3714783a7233ac448603b25f@107.21.251.55:30301",
// Uniswap Labs
"enode://9e138a8ec4291c4f2fe5851aaee44fc73ae67da87fb26b75e3b94183c7ffc15b2795afc816b0aa084151b95b3a3553f1cd0d1e9dd134dcf059a84d4e0b429afc@3.146.117.118:30303",
"enode://34d87d649e5c58a17a43c1d59900a2020bd82d5b12ea39467c3366bee2946aaa9c759c77ede61089624691291fb2129eeb2a47687b50e2463188c78e1f738cf2@52.15.54.8:30303",
"enode://c2405194166fe2c0e6c61ee469745fed1a6802f51c8fc39e1c78c21c9a6a15a7c55304f09ee37e430da9a1ce8117ca085263c6b0f474f6946811e398347611ef@3.146.213.65:30303",
}

const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@"
Expand Down
15 changes: 15 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ type ChainConfig struct {
GraniteTime *uint64 `json:"graniteTime,omitempty"` // Granite switch time (nil = no fork, 0 = already on Optimism Granite)
HoloceneTime *uint64 `json:"holoceneTime,omitempty"` // Holocene switch time (nil = no fork, 0 = already on Optimism Holocene)
IsthmusTime *uint64 `json:"isthmusTime,omitempty"` // Isthmus switch time (nil = no fork, 0 = already on Optimism Isthmus)
JovianTime *uint64 `json:"jovianTime,omitempty"` // Jovian switch time (nil = no fork, 0 = already on Optimism Jovian)

InteropTime *uint64 `json:"interopTime,omitempty"` // Interop switch time (nil = no fork, 0 = already on optimism interop)

Expand Down Expand Up @@ -549,6 +550,9 @@ func (c *ChainConfig) Description() string {
if c.IsthmusTime != nil {
banner += fmt.Sprintf(" - Isthmus: @%-10v\n", *c.IsthmusTime)
}
if c.JovianTime != nil {
banner += fmt.Sprintf(" - Jovian: @%-10v\n", *c.JovianTime)
}
if c.InteropTime != nil {
banner += fmt.Sprintf(" - Interop: @%-10v\n", *c.InteropTime)
}
Expand Down Expand Up @@ -726,6 +730,10 @@ func (c *ChainConfig) IsIsthmus(time uint64) bool {
return isTimestampForked(c.IsthmusTime, time)
}

func (c *ChainConfig) IsJovian(time uint64) bool {
return isTimestampForked(c.JovianTime, time)
}

func (c *ChainConfig) IsInterop(time uint64) bool {
return isTimestampForked(c.InteropTime, time)
}
Expand Down Expand Up @@ -768,6 +776,10 @@ func (c *ChainConfig) IsOptimismIsthmus(time uint64) bool {
return c.IsOptimism() && c.IsIsthmus(time)
}

func (c *ChainConfig) IsOptimismJovian(time uint64) bool {
return c.IsOptimism() && c.IsJovian(time)
}

// IsOptimismPreBedrock returns true iff this is an optimism node & bedrock is not yet active
func (c *ChainConfig) IsOptimismPreBedrock(num *big.Int) bool {
return c.IsOptimism() && !c.IsBedrock(num)
Expand Down Expand Up @@ -1007,6 +1019,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
if isForkTimestampIncompatible(c.IsthmusTime, newcfg.IsthmusTime, headTimestamp, genesisTimestamp) {
return newTimestampCompatError("Isthmus fork timestamp", c.IsthmusTime, newcfg.IsthmusTime)
}
if isForkTimestampIncompatible(c.JovianTime, newcfg.JovianTime, headTimestamp, genesisTimestamp) {
return newTimestampCompatError("Jovian fork timestamp", c.JovianTime, newcfg.JovianTime)
}
if isForkTimestampIncompatible(c.InteropTime, newcfg.InteropTime, headTimestamp, genesisTimestamp) {
return newTimestampCompatError("Interop fork timestamp", c.InteropTime, newcfg.InteropTime)
}
Expand Down
1 change: 1 addition & 0 deletions params/superchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func LoadOPStackChainConfig(chConfig *superchain.ChainConfig) (*ChainConfig, err
GraniteTime: hardforks.GraniteTime,
HoloceneTime: hardforks.HoloceneTime,
IsthmusTime: hardforks.IsthmusTime,
JovianTime: hardforks.JovianTime,
TerminalTotalDifficulty: common.Big0,
Ethash: nil,
Clique: nil,
Expand Down
2 changes: 1 addition & 1 deletion superchain-registry-commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
644fd6b0a440760c02b64ce9d9610f2ac31e66a5
68ebaf81202ee7e21638232c54404074a49a63f6
Binary file modified superchain/superchain-configs.zip
Binary file not shown.
1 change: 1 addition & 0 deletions superchain/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type HardforkConfig struct {
GraniteTime *uint64 `toml:"granite_time"`
HoloceneTime *uint64 `toml:"holocene_time"`
IsthmusTime *uint64 `toml:"isthmus_time"`
JovianTime *uint64 `toml:"jovian_time"`
}

type OptimismConfig struct {
Expand Down
5 changes: 4 additions & 1 deletion triedb/pathdb/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ func (b *buffer) empty() bool {
// full returns an indicator if the size of accumulated content exceeds the
// configured threshold.
func (b *buffer) full() bool {
return b.size() > b.limit
// Limit not just by data size, but also the number of layers:
// if we allow the write-buffer to become larger,
// the journal becomes critical to not roll back to an unavailable state.
return b.size() > b.limit || b.layers >= uint64(maxDiffLayers)
}

// size returns the approximate memory size of the held content.
Expand Down

0 comments on commit 1fb8462

Please sign in to comment.