Skip to content

Commit

Permalink
Don't enforce Challenge/Resolve Window Config for Generic Commitments (
Browse files Browse the repository at this point in the history
  • Loading branch information
axelKingsley authored Jul 17, 2024
1 parent c55ade0 commit ddc37da
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,18 @@ func (d *DeployConfig) Check() error {
log.Warn("DisputeGameFinalityDelaySeconds is 0")
}
if d.UsePlasma {
if d.DAChallengeWindow == 0 {
return fmt.Errorf("%w: DAChallengeWindow cannot be 0 when using alt-da mode", ErrInvalidDeployConfig)
}
if d.DAResolveWindow == 0 {
return fmt.Errorf("%w: DAResolveWindow cannot be 0 when using alt-da mode", ErrInvalidDeployConfig)
}
if !(d.DACommitmentType == plasma.KeccakCommitmentString || d.DACommitmentType == plasma.GenericCommitmentString) {
return fmt.Errorf("%w: DACommitmentType must be either KeccakCommitment or GenericCommitment", ErrInvalidDeployConfig)
}
// only enforce challenge and resolve window if using alt-da mode with Keccak Commitments
if d.DACommitmentType != plasma.GenericCommitmentString {
if d.DAChallengeWindow == 0 {
return fmt.Errorf("%w: DAChallengeWindow cannot be 0 when using alt-da mode with Keccak Commitments", ErrInvalidDeployConfig)
}
if d.DAResolveWindow == 0 {
return fmt.Errorf("%w: DAResolveWindow cannot be 0 when using alt-da mode with Keccak Commitments", ErrInvalidDeployConfig)
}
}
}
if d.UseCustomGasToken {
if d.CustomGasTokenAddress == (common.Address{}) {
Expand Down

0 comments on commit ddc37da

Please sign in to comment.