@@ -777,6 +777,98 @@ class CoordinatorConfigTest {
777
777
}
778
778
}
779
779
780
+ @Test
781
+ fun parsesValidTracesV2ConfigOverride () {
782
+ val smartContractErrorCodes: SmartContractErrors =
783
+ CoordinatorAppCli .loadConfigsOrError<SmartContractErrorCodesConfig >(
784
+ listOf (File (" ../../config/common/smart-contract-errors.toml" ))
785
+ ).get()!! .smartContractErrors
786
+ val timeOfDayMultipliers =
787
+ CoordinatorAppCli .loadConfigsOrError<GasPriceCapTimeOfDayMultipliersConfig >(
788
+ listOf (File (" ../../config/common/gas-price-cap-time-of-day-multipliers.toml" ))
789
+ )
790
+ val tracesLimitsConfigs =
791
+ CoordinatorAppCli .loadConfigsOrError<TracesLimitsV1ConfigFile >(
792
+ listOf (File (" ../../config/common/traces-limits-v1.toml" ))
793
+ )
794
+ val tracesLimitsV2Configs =
795
+ CoordinatorAppCli .loadConfigsOrError<TracesLimitsV2ConfigFile >(
796
+ listOf (File (" ../../config/common/traces-limits-v2.toml" ))
797
+ )
798
+
799
+ CoordinatorAppCli .loadConfigsOrError<CoordinatorConfigTomlDto >(
800
+ listOf (
801
+ File (" ../../config/coordinator/coordinator-docker.config.toml" ),
802
+ File (" ../../config/coordinator/coordinator-docker-traces-v2-override.config.toml" )
803
+ )
804
+ )
805
+ .onFailure { error: String -> fail(error) }
806
+ .onSuccess {
807
+ val configs = it.copy(
808
+ conflation = it.conflation.copy(
809
+ _tracesLimitsV1 = tracesLimitsConfigs.get()?.tracesLimits?.let { TracesCountersV1 (it) },
810
+ _tracesLimitsV2 = tracesLimitsV2Configs.get()?.tracesLimits?.let { TracesCountersV2 (it) },
811
+ _smartContractErrors = smartContractErrorCodes
812
+ ),
813
+ l1DynamicGasPriceCapService = it.l1DynamicGasPriceCapService.copy(
814
+ gasPriceCapCalculation = it.l1DynamicGasPriceCapService.gasPriceCapCalculation.copy(
815
+ timeOfDayMultipliers = timeOfDayMultipliers.get()?.gasPriceCapTimeOfDayMultipliers
816
+ )
817
+ )
818
+ )
819
+
820
+ val expectedConfig =
821
+ coordinatorConfig.copy(
822
+ zkTraces = zkTracesConfig.copy(ethApi = URI (" http://traces-node-v2:8545" ).toURL()),
823
+ l2NetworkGasPricingService = l2NetworkGasPricingServiceConfig.copy(
824
+ legacy =
825
+ l2NetworkGasPricingServiceConfig.legacy.copy(
826
+ transactionCostCalculatorConfig =
827
+ l2NetworkGasPricingServiceConfig.legacy.transactionCostCalculatorConfig?.copy(
828
+ compressedTxSize = 350 ,
829
+ expectedGas = 29400
830
+ )
831
+ )
832
+ ),
833
+ traces = tracesConfig.copy(
834
+ switchToLineaBesu = true ,
835
+ expectedTracesApiVersionV2 = " v0.8.0-rc3" ,
836
+ conflationV2 = tracesConfig.conflation.copy(
837
+ endpoints = listOf (URI (" http://traces-node-v2:8545/" ).toURL())
838
+ ),
839
+ countersV2 = TracesConfig .FunctionalityEndpoint (
840
+ listOf (
841
+ URI (" http://traces-node-v2:8545/" ).toURL()
842
+ ),
843
+ requestLimitPerEndpoint = 20U ,
844
+ requestRetry = RequestRetryConfigTomlFriendly (
845
+ backoffDelay = Duration .parse(" PT1S" ),
846
+ failuresWarningThreshold = 2
847
+ )
848
+ )
849
+ ),
850
+ proversConfig = proversConfig.copy(
851
+ proverA = proversConfig.proverA.copy(
852
+ execution = proversConfig.proverA.execution.copy(
853
+ requestsDirectory = Path .of(" /data/prover/v3/execution/requests" ),
854
+ responsesDirectory = Path .of(" /data/prover/v3/execution/responses" )
855
+ ),
856
+ blobCompression = proversConfig.proverA.blobCompression.copy(
857
+ requestsDirectory = Path .of(" /data/prover/v3/compression/requests" ),
858
+ responsesDirectory = Path .of(" /data/prover/v3/compression/responses" )
859
+ ),
860
+ proofAggregation = proversConfig.proverA.proofAggregation.copy(
861
+ requestsDirectory = Path .of(" /data/prover/v3/aggregation/requests" ),
862
+ responsesDirectory = Path .of(" /data/prover/v3/aggregation/responses" )
863
+ )
864
+ )
865
+ )
866
+ )
867
+
868
+ assertEquals(expectedConfig, configs.reified ())
869
+ }
870
+ }
871
+
780
872
@Test
781
873
fun invalidConfigReturnsErrorResult () {
782
874
val configs =
0 commit comments