Skip to content

Commit 1b33d37

Browse files
Revert "Sandbox: add a development mode (#7127)" (#7168)
This reverts commit 87a0ee9. CHANGELOG_BEGIN WARNING remove the changelog entry from 87a0ee9 and starting by : "[Sandbox] By default Sandbox rejects the development versions of ..." CHANGELOG_END
1 parent 5b2319e commit 1b33d37

File tree

6 files changed

+43
-50
lines changed

6 files changed

+43
-50
lines changed

daml-lf/engine/src/main/scala/com/digitalasset/daml/lf/engine/EngineConfig.scala

+28-26
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,35 @@ final case class EngineConfig(
3333

3434
object EngineConfig {
3535

36-
private[this] def toDev(config: EngineConfig): EngineConfig =
37-
config.copy(
38-
allowedLanguageVersions =
39-
config.allowedLanguageVersions.copy(max = LV(LV.Major.V1, LV.Minor.Dev)),
40-
allowedInputTransactionVersions = config.allowedInputTransactionVersions.copy(
41-
max = TransactionVersions.acceptedVersions.last),
42-
allowedOutputTransactionVersions = config.allowedOutputTransactionVersions.copy(
43-
max = TransactionVersions.acceptedVersions.last),
36+
// Development configuration, should not be used in PROD.
37+
val Dev: EngineConfig = new EngineConfig(
38+
allowedLanguageVersions = VersionRange(
39+
LV(LV.Major.V1, LV.Minor.Stable("6")),
40+
LV(LV.Major.V1, LV.Minor.Dev),
41+
),
42+
allowedInputTransactionVersions = VersionRange(
43+
TV("10"),
44+
TransactionVersions.acceptedVersions.last
45+
),
46+
allowedOutputTransactionVersions = TransactionVersions.DevOutputVersions
47+
)
48+
49+
// Legacy configuration, to be used by sandbox classic only
50+
@deprecated("Sandbox_Classic is to be used by sandbox classic only", since = "1.4.0")
51+
val Sandbox_Classic: EngineConfig = new EngineConfig(
52+
allowedLanguageVersions = VersionRange(
53+
LV(LV.Major.V1, LV.Minor.Stable("0")),
54+
LV(LV.Major.V1, LV.Minor.Dev),
55+
),
56+
allowedInputTransactionVersions = VersionRange(
57+
TransactionVersions.acceptedVersions.head,
58+
TransactionVersions.acceptedVersions.last
59+
),
60+
allowedOutputTransactionVersions = VersionRange(
61+
TV("10"),
62+
TransactionVersions.acceptedVersions.last
4463
)
64+
)
4565

4666
// recommended configuration
4767
val Stable: EngineConfig = new EngineConfig(
@@ -53,22 +73,4 @@ object EngineConfig {
5373
allowedOutputTransactionVersions = VersionRange(TV("10"), TV("10"))
5474
)
5575

56-
// development configuration, should not be used in PROD.
57-
// accept all language and transaction versions supported by SDK_1_x plus development versions.
58-
val Dev: EngineConfig = toDev(Stable)
59-
60-
// Legacy configuration, to be used by sandbox classic only
61-
@deprecated("Sandbox_Classic_Stable is to be used by sandbox classic only", since = "1.5.0")
62-
val Sandbox_Classic_Stable: EngineConfig =
63-
Stable.copy(
64-
allowedLanguageVersions =
65-
Stable.allowedLanguageVersions.copy(min = LV(LV.Major.V1, LV.Minor.Stable("0"))),
66-
allowedInputTransactionVersions = Stable.allowedInputTransactionVersions.copy(
67-
min = TransactionVersions.acceptedVersions.head),
68-
)
69-
70-
// Legacy configuration, to be used by sandbox classic only
71-
@deprecated("Sandbox_Classic_Dev is to be used by sandbox classic only", since = "1.5.0")
72-
val Sandbox_Classic_Dev = toDev(Sandbox_Classic_Stable)
73-
7476
}

daml-lf/engine/src/test/scala/com/digitalasset/daml/lf/engine/EngineInfoTest.scala

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
package com.daml.lf.engine
5-
65
import com.github.ghik.silencer.silent
76
import org.scalatest.{Matchers, WordSpec}
87

98
class EngineInfoTest extends WordSpec with Matchers {
109

1110
"EngineInfo" should {
1211

13-
@silent("Sandbox_Classic_Dev in object EngineConfig is deprecated")
12+
@silent("Sandbox_Classic in object EngineConfig is deprecated")
1413
def infos =
15-
Seq(EngineConfig.Stable, EngineConfig.Dev, EngineConfig.Sandbox_Classic_Dev)
14+
Seq(EngineConfig.Stable, EngineConfig.Dev, EngineConfig.Sandbox_Classic)
1615
.map(new EngineInfo(_))
1716

1817
val Seq(engineInfoStable, engineInfoDev, engineInfoLegacy) = infos

ledger/sandbox-classic/src/main/scala/platform/sandbox/SandboxServer.scala

+6-8
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,12 @@ final class SandboxServer(
143143
) extends AutoCloseable {
144144

145145
private[this] val engine = {
146-
@silent("Sandbox_Classic_Dev in object EngineConfig is deprecated")
147-
@silent("Sandbox_Classic_Stable in object EngineConfig is deprecated")
148-
val engineConfig = (
149-
if (config.devMode) EngineConfig.Sandbox_Classic_Stable else EngineConfig.Sandbox_Classic_Dev
150-
).copy(
151-
profileDir = config.profileDir,
152-
stackTraceMode = config.stackTraces,
153-
)
146+
@silent("Sandbox_Classic in object EngineConfig is deprecated")
147+
val engineConfig =
148+
EngineConfig.Sandbox_Classic.copy(
149+
profileDir = config.profileDir,
150+
stackTraceMode = config.stackTraces,
151+
)
154152
getEngine(engineConfig)
155153
}
156154

ledger/sandbox-common/src/main/scala/platform/sandbox/cli/CommonCli.scala

-5
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,6 @@ class CommonCli(name: LedgerName) {
296296
.text(
297297
s"Maximum skew (in seconds) between the ledger time and the record time. Default is ${v1.TimeModel.reasonableDefault.minSkew.getSeconds}.")
298298

299-
opt[Unit]("dev-mode")
300-
.optional()
301-
.action((_, config) => config.copy(devMode = true))
302-
.text("Allows development versions of DAML-LF language and transaction format.")
303-
304299
help("help").text("Print the usage text")
305300

306301
checkConfig(c => {

ledger/sandbox-common/src/main/scala/platform/sandbox/config/SandboxConfig.scala

-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ final case class SandboxConfig(
4747
lfValueTranslationContractCacheConfiguration: SizedCache.Configuration,
4848
profileDir: Option[Path],
4949
stackTraces: Boolean,
50-
devMode: Boolean,
5150
)
5251

5352
object SandboxConfig {
@@ -92,7 +91,6 @@ object SandboxConfig {
9291
lfValueTranslationContractCacheConfiguration = DefaultLfValueTranslationCacheConfiguration,
9392
profileDir = None,
9493
stackTraces = true,
95-
devMode = false,
9694
)
9795

9896
}

ledger/sandbox/src/main/scala/platform/sandboxnext/Runner.scala

+7-6
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ class Runner(config: SandboxConfig) extends ResourceOwner[Port] {
6363
None
6464
}
6565

66+
// FIXME: https://github.com/digital-asset/daml/issues/5164
67+
// should not use EngineConfig.Dev
6668
private[this] val engine = {
67-
val engineConfig = (
68-
if (config.devMode) EngineConfig.Dev else EngineConfig.Stable
69-
).copy(
70-
profileDir = config.profileDir,
71-
stackTraceMode = config.stackTraces,
72-
)
69+
val engineConfig =
70+
EngineConfig.Dev.copy(
71+
profileDir = config.profileDir,
72+
stackTraceMode = config.stackTraces,
73+
)
7374
new Engine(engineConfig)
7475
}
7576

0 commit comments

Comments
 (0)