Skip to content

Commit

Permalink
op-chain-ops: add useInterop flag
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfuturistic committed May 7, 2024
1 parent 858257c commit 83c63cc
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ type DeployConfig struct {
// L2GenesisFjordTimeOffset is the number of seconds after genesis block that Fjord hard fork activates.
// Set it to 0 to activate at genesis. Nil to disable Fjord.
L2GenesisFjordTimeOffset *hexutil.Uint64 `json:"l2GenesisFjordTimeOffset,omitempty"`
// L2GenesisInteropTimeOffset is the number of seconds after genesis block that the Interop hard fork activates.
// Set it to 0 to activate at genesis. Nil to disable Interop.
L2GenesisInteropTimeOffset *hexutil.Uint64 `json:"l2GenesisInteropTimeOffset,omitempty"`
// L2GenesisBlockExtraData is configurable extradata. Will default to []byte("BEDROCK") if left unspecified.
L2GenesisBlockExtraData []byte `json:"l2GenesisBlockExtraData"`
// ProxyAdminOwner represents the owner of the ProxyAdmin predeploy on L2.
Expand Down Expand Up @@ -268,6 +265,9 @@ type DeployConfig struct {

// When Cancun activates. Relative to L1 genesis.
L1CancunTimeOffset *hexutil.Uint64 `json:"l1CancunTimeOffset,omitempty"`

// UseInterop is a flag that indicates if the system is using interop
UseInterop bool `json:"useInterop"`
}

// Copy will deeply copy the DeployConfig. This does a JSON roundtrip to copy
Expand Down Expand Up @@ -575,14 +575,10 @@ func (d *DeployConfig) FjordTime(genesisTime uint64) *uint64 {
}

func (d *DeployConfig) InteropTime(genesisTime uint64) *uint64 {
if d.L2GenesisInteropTimeOffset == nil {
if !d.UseInterop {
return nil
}
v := uint64(0)
if offset := *d.L2GenesisInteropTimeOffset; offset > 0 {
v = genesisTime + uint64(offset)
}
return &v
return &genesisTime
}

// RollupConfig converts a DeployConfig to a rollup.Config
Expand Down Expand Up @@ -626,6 +622,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
DeltaTime: d.DeltaTime(l1StartBlock.Time()),
EcotoneTime: d.EcotoneTime(l1StartBlock.Time()),
FjordTime: d.FjordTime(l1StartBlock.Time()),
UseInterop: d.UseInterop,
InteropTime: d.InteropTime(l1StartBlock.Time()),
UsePlasma: d.UsePlasma,
DAChallengeAddress: d.DAChallengeProxy,
Expand Down

0 comments on commit 83c63cc

Please sign in to comment.