github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/updatable_configs/validation/require_approvals_for_seal_construction.go (about) 1 package validation 2 3 import ( 4 "fmt" 5 ) 6 7 func ValidateRequireApprovals(requiredApprovalsForSealConstruction uint, requiredApprovalsForSealVerification uint, chunkAlpha uint) error { 8 // We need to ensure `requiredApprovalsForSealVerification <= requiredApprovalsForSealConstruction <= chunkAlpha` 9 if requiredApprovalsForSealVerification > requiredApprovalsForSealConstruction { 10 return fmt.Errorf("invalid consensus parameters, requiredApprovalsForSealVerification (%v) > requiredApprovalsForSealConstruction (%v)", 11 requiredApprovalsForSealVerification, requiredApprovalsForSealConstruction) 12 } 13 14 if requiredApprovalsForSealConstruction > chunkAlpha { 15 return fmt.Errorf("invalid consensus parameters: requiredApprovalsForSealConstruction (%v) > chunkAlpha (%v)", 16 requiredApprovalsForSealConstruction, chunkAlpha) 17 } 18 19 return nil 20 }