Skip to content

Commit

Permalink
move l2BlobTime to ChainConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
blockchaindevsh committed Sep 18, 2024
1 parent e117904 commit 26b8cff
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum v1.13.15 => github.com/ethstorage/op-geth v0.0.0-20240917122918-64a6306fa986
replace github.com/ethereum/go-ethereum v1.13.15 => github.com/ethstorage/op-geth v0.0.0-20240918005936-a18d1c99aecb

//replace github.com/ethereum/go-ethereum v1.13.9 => ../op-geth

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R
github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethstorage/da-server v0.0.0-20240628094857-ed2ee4ff52d9 h1:yRJRj81rP83R5dZEsYitAFcqRagK/e+UxhiSSK4/Wds=
github.com/ethstorage/da-server v0.0.0-20240628094857-ed2ee4ff52d9/go.mod h1:YeveZNzQFdseeqS0mQavqfyMI+U9l1GQu0CEwezTZA8=
github.com/ethstorage/op-geth v0.0.0-20240917122918-64a6306fa986 h1:VOG50dsZCNOBBBg6yoKWn3/eWMtfFLXoOnvT23t68nI=
github.com/ethstorage/op-geth v0.0.0-20240917122918-64a6306fa986/go.mod h1:8tQ6r0e1NNJbSVHzYKafQqf62gV9BzZR+SKkXRckjLM=
github.com/ethstorage/op-geth v0.0.0-20240918005936-a18d1c99aecb h1:f076fgZk2/vUmrpHewhKOJgLXjQqfzsRlU/gKVPiKbg=
github.com/ethstorage/op-geth v0.0.0-20240918005936-a18d1c99aecb/go.mod h1:8tQ6r0e1NNJbSVHzYKafQqf62gV9BzZR+SKkXRckjLM=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
Expand Down
17 changes: 14 additions & 3 deletions op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ type DeployConfig struct {
// UseInterop is a flag that indicates if the system is using interop
UseInterop bool `json:"useInterop,omitempty"`
// l2 blob related configs
L2BlobTime *uint64 `json:"l2BlobTime,omitempty"`
DACURLS []string `json:"dac_urls,omitempty"`
L2GenesisL2BlobTimeOffset *hexutil.Uint64 `json:"l2BlobTime,omitempty"`
DACURLS []string `json:"dac_urls,omitempty"`

// UseSoulGasToken is a flag that indicates if the system is using SoulGasToken
UseSoulGasToken bool `json:"useSoulGasToken"`
Expand Down Expand Up @@ -612,6 +612,17 @@ func (d *DeployConfig) InteropTime(genesisTime uint64) *uint64 {
return &v
}

func (d *DeployConfig) L2BlobTime(genesisTime uint64) *uint64 {
if d.L2GenesisL2BlobTimeOffset == nil {
return nil
}
v := uint64(0)
if offset := *d.L2GenesisL2BlobTimeOffset; offset > 0 {
v = genesisTime + uint64(offset)
}
return &v
}

// RollupConfig converts a DeployConfig to a rollup.Config. If Ecotone is active at genesis, the
// Overhead value is considered a noop.
func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHash common.Hash, l2GenesisBlockNumber uint64) (*rollup.Config, error) {
Expand All @@ -633,7 +644,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
var l2BlobConfig *rollup.L2BlobConfig
if d.L2BlobTime != nil {
l2BlobConfig = &rollup.L2BlobConfig{
L2BlobTime: d.L2BlobTime,
L2BlobTime: d.L2BlobTime(l1StartBlock.Time()),
}
if len(d.DACURLS) > 0 {
l2BlobConfig.DACConfig = &rollup.DACConfig{URLS: d.DACURLS}
Expand Down
2 changes: 1 addition & 1 deletion op-chain-ops/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
EcotoneTime: config.EcotoneTime(block.Time()),
FjordTime: config.FjordTime(block.Time()),
InteropTime: config.InteropTime(block.Time()),
L2BlobTime: config.L2BlobTime(block.Time()),
Optimism: &params.OptimismConfig{
EIP1559Denominator: eip1559Denom,
EIP1559Elasticity: eip1559Elasticity,
EIP1559DenominatorCanyon: eip1559DenomCanyon,
L2BlobTime: config.L2BlobTime,
IsSoulBackedByNative: config.IsSoulBackedByNative,
UseSoulGasToken: config.UseSoulGasToken,
},
Expand Down

0 comments on commit 26b8cff

Please sign in to comment.