Commit ddc37daa authored by Axel Kingsley's avatar Axel Kingsley Committed by GitHub

Don't enforce Challenge/Resolve Window Config for Generic Commitments (#11171)

parent c55ade09
...@@ -437,14 +437,17 @@ func (d *DeployConfig) Check() error { ...@@ -437,14 +437,17 @@ func (d *DeployConfig) Check() error {
log.Warn("DisputeGameFinalityDelaySeconds is 0") log.Warn("DisputeGameFinalityDelaySeconds is 0")
} }
if d.UsePlasma { if d.UsePlasma {
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 { if d.DAChallengeWindow == 0 {
return fmt.Errorf("%w: DAChallengeWindow cannot be 0 when using alt-da mode", ErrInvalidDeployConfig) return fmt.Errorf("%w: DAChallengeWindow cannot be 0 when using alt-da mode with Keccak Commitments", ErrInvalidDeployConfig)
} }
if d.DAResolveWindow == 0 { if d.DAResolveWindow == 0 {
return fmt.Errorf("%w: DAResolveWindow cannot be 0 when using alt-da mode", ErrInvalidDeployConfig) return fmt.Errorf("%w: DAResolveWindow cannot be 0 when using alt-da mode with Keccak Commitments", ErrInvalidDeployConfig)
} }
if !(d.DACommitmentType == plasma.KeccakCommitmentString || d.DACommitmentType == plasma.GenericCommitmentString) {
return fmt.Errorf("%w: DACommitmentType must be either KeccakCommitment or GenericCommitment", ErrInvalidDeployConfig)
} }
} }
if d.UseCustomGasToken { if d.UseCustomGasToken {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment