Skip to content

Commit afb760f

Browse files
author
VM
committed
feat: rollup config sets volta time
1 parent 1fa142d commit afb760f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

op-chain-ops/genesis/config.go

+15
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ type DeployConfig struct {
141141
// L2GenesisInteropTimeOffset is the number of seconds after genesis block that the Interop hard fork activates.
142142
// Set it to 0 to activate at genesis. Nil to disable Interop.
143143
L2GenesisInteropTimeOffset *hexutil.Uint64 `json:"l2GenesisInteropTimeOffset,omitempty"`
144+
// L2GenesisVoltaTimeOffset is the number of seconds after genesis block that the Volta hard fork activates.
145+
// Set it to 0 to activate at genesis. Nil to disable Interop.
146+
L2GenesisVoltaTimeOffset *hexutil.Uint64 `json:"l2GenesisVoltaTimeOffset,omitempty"`
144147
// L2GenesisBlockExtraData is configurable extradata. Will default to []byte("BEDROCK") if left unspecified.
145148
L2GenesisBlockExtraData []byte `json:"l2GenesisBlockExtraData"`
146149
// ProxyAdminOwner represents the owner of the ProxyAdmin predeploy on L2.
@@ -656,6 +659,17 @@ func (d *DeployConfig) SnowTime(genesisTime uint64) *uint64 {
656659
return &v
657660
}
658661

662+
func (d *DeployConfig) VoltaTime(genesisTime uint64) *uint64 {
663+
if d.L2GenesisVoltaTimeOffset == nil {
664+
return nil
665+
}
666+
v := uint64(0)
667+
if offset := *d.L2GenesisVoltaTimeOffset; offset > 0 {
668+
v = genesisTime + uint64(offset)
669+
}
670+
return &v
671+
}
672+
659673
func (d *DeployConfig) HaberTime(genesisTime uint64) *uint64 {
660674
if d.HaberTimeOffset == nil {
661675
return nil
@@ -733,6 +747,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
733747
PlasmaConfig: plasma,
734748
Fermat: d.Fermat,
735749
SnowTime: d.SnowTime(l1StartBlock.Time()),
750+
VoltaTime: d.VoltaTime(l1StartBlock.Time()),
736751
}, nil
737752
}
738753

0 commit comments

Comments
 (0)