Skip to content

Commit 3ba7ac0

Browse files
committed
Add Karst
1 parent 24648da commit 3ba7ac0

File tree

12 files changed

+47
-1
lines changed

12 files changed

+47
-1
lines changed

cmd/geth/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ func makeFullNode(ctx *cli.Context) *node.Node {
275275
cfg.Eth.OverrideOptimismJovian = &v
276276
}
277277

278+
if ctx.IsSet(utils.OverrideOptimismKarst.Name) {
279+
v := ctx.Uint64(utils.OverrideOptimismKarst.Name)
280+
cfg.Eth.OverrideOptimismKarst = &v
281+
}
282+
278283
if ctx.IsSet(utils.OverrideOptimismInterop.Name) {
279284
v := ctx.Uint64(utils.OverrideOptimismInterop.Name)
280285
cfg.Eth.OverrideOptimismInterop = &v

cmd/geth/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ var (
7575
utils.OverrideOptimismHolocene,
7676
utils.OverrideOptimismIsthmus,
7777
utils.OverrideOptimismJovian,
78+
utils.OverrideOptimismKarst,
7879
utils.OverrideOptimismInterop,
7980
utils.EnablePersonal, // deprecated
8081
utils.TxPoolLocalsFlag,

cmd/utils/flags.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ var (
312312
Usage: "Manually specify the Optimism Jovian fork timestamp, overriding the bundled setting",
313313
Category: flags.EthCategory,
314314
}
315+
OverrideOptimismKarst = &cli.Uint64Flag{
316+
Name: "override.karst",
317+
Usage: "Manually specify the Optimism Karst fork timestamp, overriding the bundled setting",
318+
Category: flags.EthCategory,
319+
}
315320
OverrideOptimismInterop = &cli.Uint64Flag{
316321
Name: "override.interop",
317322
Usage: "Manually specify the Optimsim Interop feature-set fork timestamp, overriding the bundled setting",

core/genesis.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ type ChainOverrides struct {
303303
OverrideOptimismHolocene *uint64
304304
OverrideOptimismIsthmus *uint64
305305
OverrideOptimismJovian *uint64
306+
OverrideOptimismKarst *uint64
306307
OverrideOptimismInterop *uint64
307308
ApplySuperchainUpgrades bool
308309
}
@@ -381,6 +382,9 @@ func (o *ChainOverrides) apply(cfg *params.ChainConfig) error {
381382
if o.OverrideOptimismJovian != nil {
382383
cfg.JovianTime = o.OverrideOptimismJovian
383384
}
385+
if o.OverrideOptimismKarst != nil {
386+
cfg.KarstTime = o.OverrideOptimismKarst
387+
}
384388
if o.OverrideOptimismInterop != nil {
385389
cfg.InteropTime = o.OverrideOptimismInterop
386390
}

eth/backend.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
309309
if config.OverrideOptimismJovian != nil {
310310
overrides.OverrideOptimismJovian = config.OverrideOptimismJovian
311311
}
312+
if config.OverrideOptimismKarst != nil {
313+
overrides.OverrideOptimismJovian = config.OverrideOptimismKarst
314+
}
312315
if config.OverrideOptimismInterop != nil {
313316
overrides.OverrideOptimismInterop = config.OverrideOptimismInterop
314317
}

eth/ethconfig/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ type Config struct {
205205

206206
OverrideOptimismJovian *uint64 `toml:",omitempty"`
207207

208+
OverrideOptimismKarst *uint64 `toml:",omitempty"`
209+
208210
OverrideOptimismInterop *uint64 `toml:",omitempty"`
209211

210212
// ApplySuperchainUpgrades requests the node to load chain-configuration from the superchain-registry.

eth/ethconfig/gen_config.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

miner/payload_building_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ func TestDAFilters(t *testing.T) {
229229
func holoceneConfig() *params.ChainConfig {
230230
config := *params.OptimismTestConfig
231231
config.IsthmusTime = nil
232+
config.KarstTime = nil
232233
config.JovianTime = nil
233234
config.PragueTime = nil
234235
config.OsakaTime = nil

params/config.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ var (
395395
conf.GraniteTime = &zero
396396
conf.HoloceneTime = &zero
397397
conf.IsthmusTime = &zero
398-
conf.JovianTime = nil
398+
conf.JovianTime = &zero
399+
conf.KarstTime = nil
399400
conf.InteropTime = nil
400401
conf.Optimism = &OptimismConfig{EIP1559Elasticity: 6, EIP1559Denominator: 50, EIP1559DenominatorCanyon: uint64ptr(250)}
401402
return &conf
@@ -514,6 +515,7 @@ type ChainConfig struct {
514515
HoloceneTime *uint64 `json:"holoceneTime,omitempty"` // Holocene switch time (nil = no fork, 0 = already on Optimism Holocene)
515516
IsthmusTime *uint64 `json:"isthmusTime,omitempty"` // Isthmus switch time (nil = no fork, 0 = already on Optimism Isthmus)
516517
JovianTime *uint64 `json:"jovianTime,omitempty"` // Jovian switch time (nil = no fork, 0 = already on Optimism Jovian)
518+
KarstTime *uint64 `json:"karstTime,omitempty"` // Karst switch time (nil = no fork, 0 = already on Optimism Karst)
517519

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

@@ -1018,6 +1020,10 @@ func (c *ChainConfig) IsJovian(time uint64) bool {
10181020
return isTimestampForked(c.JovianTime, time)
10191021
}
10201022

1023+
func (c *ChainConfig) IsKarst(time uint64) bool {
1024+
return isTimestampForked(c.KarstTime, time)
1025+
}
1026+
10211027
func (c *ChainConfig) IsInterop(time uint64) bool {
10221028
return isTimestampForked(c.InteropTime, time)
10231029
}
@@ -1064,6 +1070,10 @@ func (c *ChainConfig) IsOptimismJovian(time uint64) bool {
10641070
return c.IsOptimism() && c.IsJovian(time)
10651071
}
10661072

1073+
func (c *ChainConfig) IsOptimismKarst(time uint64) bool {
1074+
return c.IsOptimism() && c.IsKarst(time)
1075+
}
1076+
10671077
// IsOptimismPreBedrock returns true iff this is an optimism node & bedrock is not yet active
10681078
func (c *ChainConfig) IsOptimismPreBedrock(num *big.Int) bool {
10691079
return c.IsOptimism() && !c.IsBedrock(num)
@@ -1641,6 +1651,7 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules
16411651
IsOptimismHolocene: isMerge && c.IsOptimismHolocene(timestamp),
16421652
IsOptimismIsthmus: isMerge && c.IsOptimismIsthmus(timestamp),
16431653
IsOptimismJovian: isMerge && c.IsOptimismJovian(timestamp),
1654+
IsOptimismKarst: isMerge && c.IsOptimismKarst(timestamp),
16441655
}
16451656
}
16461657

params/config_op.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ func (c *ChainConfig) opCheckCompatible(newcfg *ChainConfig, headNumber *big.Int
3333
if isForkTimestampIncompatible(c.JovianTime, newcfg.JovianTime, headTimestamp, genesisTimestamp) {
3434
return newTimestampCompatError("Jovian fork timestamp", c.JovianTime, newcfg.JovianTime)
3535
}
36+
if isForkTimestampIncompatible(c.KarstTime, newcfg.KarstTime, headTimestamp, genesisTimestamp) {
37+
return newTimestampCompatError("Karst fork timestamp", c.KarstTime, newcfg.KarstTime)
38+
}
3639
if isForkTimestampIncompatible(c.InteropTime, newcfg.InteropTime, headTimestamp, genesisTimestamp) {
3740
return newTimestampCompatError("Interop fork timestamp", c.InteropTime, newcfg.InteropTime)
3841
}
@@ -65,6 +68,9 @@ func (c *ChainConfig) opDescription() string {
6568
if c.JovianTime != nil {
6669
banner += fmt.Sprintf(" - Jovian: @%-10v\n", *c.JovianTime)
6770
}
71+
if c.KarstTime != nil {
72+
banner += fmt.Sprintf(" - Karst: @%-10v\n", *c.KarstTime)
73+
}
6874
if c.InteropTime != nil {
6975
banner += fmt.Sprintf(" - Interop: @%-10v\n", *c.InteropTime)
7076
}

0 commit comments

Comments
 (0)