Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: merge dev into main #66

Merged
merged 2 commits into from
Feb 13, 2024
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
12 changes: 10 additions & 2 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,20 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
// // Apply Base Goerli regolith time
// config.RegolithTime = &params.BaseGoerliRegolithTime
// }
// TODO(pangssu): need to hardcode overrides for each chain. (kroma mainnet, kroma sepolia, devnet)

// NOTE: kroma always post-regolith
// [Kroma: START]
zero := uint64(0)
if config.IsKroma() {
// NOTE: kroma always post-regolith
config.BedrockBlock = new(big.Int).SetUint64(zero)
config.RegolithTime = &zero
// Canyon upgrade
canyonTime := &params.UpgradeConfigs[config.ChainID.Uint64()].CanyonTime
config.CanyonTime = canyonTime
config.ShanghaiTime = canyonTime
config.Kroma.EIP1559DenominatorCanyon = 250
}
// [Kroma: END]
if overrides != nil && overrides.OverrideCancun != nil {
config.CancunTime = overrides.OverrideCancun
}
Expand All @@ -333,12 +339,14 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
}
}

// [Kroma: START]
if overrides != nil && overrides.CircuitParams != nil && overrides.CircuitParams.MaxTxs != nil {
config.MaxTxPerBlock = overrides.CircuitParams.MaxTxs
}
if overrides != nil && overrides.CircuitParams != nil && overrides.CircuitParams.MaxCalldata != nil {
config.MaxTxPayloadBytesPerBlock = overrides.CircuitParams.MaxCalldata
}
// [Kroma: END]
}
}
// Just commit the new block if there is no stored genesis block.
Expand Down
1 change: 1 addition & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var (
const (
KromaMainnetChainID = 255
KromaSepoliaChainID = 2358
KromaDevnetChainID = 7791
)

func newUint64(val uint64) *uint64 { return &val }
Expand Down
25 changes: 25 additions & 0 deletions params/kroma.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package params

import (
"fmt"
)

func init() {
NetworkNames[fmt.Sprintf("%d", KromaMainnetChainID)] = "KromaMainnet"
NetworkNames[fmt.Sprintf("%d", KromaSepoliaChainID)] = "KromaSepolia"
NetworkNames[fmt.Sprintf("%d", KromaDevnetChainID)] = "KromaDevnet"
}

type UpgradeConfig struct {
CanyonTime uint64
}

var UpgradeConfigs = map[uint64]*UpgradeConfig{
KromaMainnetChainID: {},
KromaSepoliaChainID: {
CanyonTime: 1707897600,
},
KromaDevnetChainID: {
CanyonTime: 1707292800,
},
}
Loading