Skip to content

Commit 154d2e0

Browse files
committed
coordinator: adds config v2 classes and parsing tests
1 parent 7f4ea0c commit 154d2e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+314
-313
lines changed

coordinator/app/src/main/kotlin/linea/coordinator/config/Mappers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ fun RetryConfig.toJsonRpcRetry(): RequestRetryConfig {
88
maxRetries = maxRetries,
99
timeout = timeout,
1010
backoffDelay = backoffDelay,
11-
failuresWarningThreshold = failuresWarningThreshold
11+
failuresWarningThreshold = failuresWarningThreshold,
1212
)
1313
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package linea.coordinator.config.v2
22

33
data class ApiConfig(
4-
val observabilityPort: UInt
4+
val observabilityPort: UInt,
55
)

coordinator/app/src/main/kotlin/linea/coordinator/config/v2/ConflationConfig.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ data class ConflationConfig(
2121
val l2GetLogsEndpoint: URL,
2222
val blobCompression: BlobCompression = BlobCompression(),
2323
val proofAggregation: ProofAggregation = ProofAggregation(),
24-
val tracesCountersLimitsV2: TracesCountersV2
24+
val tracesCountersLimitsV2: TracesCountersV2,
2525
) : FeatureToggle {
2626
data class BlobCompression(
2727
val blobSizeLimit: UInt = 102400u,
2828
val handlerPollingInterval: Duration = 1.seconds,
2929
val batchesLimit: UInt? = null,
30-
val blobCompressorVersion: BlobCompressorVersion = BlobCompressorVersion.V1_2
30+
val blobCompressorVersion: BlobCompressorVersion = BlobCompressorVersion.V1_2,
3131
)
3232

3333
data class ProofAggregation(
@@ -36,6 +36,6 @@ data class ConflationConfig(
3636
val deadlineCheckInterval: Duration = 30.seconds,
3737
val coordinatorPollingInterval: Duration = 3.seconds,
3838
val targetEndBlocks: List<ULong>? = null,
39-
val aggregationSizeMultipleOf: UInt = 1u
39+
val aggregationSizeMultipleOf: UInt = 1u,
4040
)
4141
}

coordinator/app/src/main/kotlin/linea/coordinator/config/v2/CoordinatorConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ data class CoordinatorConfig(
1616
val l2NetworkGasPricing: L2NetworkGasPricingConfig? = null,
1717
val database: DatabaseConfig,
1818
val api: ApiConfig,
19-
val smartContractErrors: SmartContractErrors
19+
val smartContractErrors: SmartContractErrors,
2020
)

coordinator/app/src/main/kotlin/linea/coordinator/config/v2/DatabaseConfig.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ data class DatabaseConfig(
1717
val persistenceRetries: RetryConfig = RetryConfig(
1818
backoffDelay = 1.seconds,
1919
timeout = 10.minutes,
20-
failuresWarningThreshold = 3u
21-
)
20+
failuresWarningThreshold = 3u,
21+
),
2222
)

coordinator/app/src/main/kotlin/linea/coordinator/config/v2/L1FinalizationMonitorConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ data class L1FinalizationMonitorConfig(
99
val l1Endpoint: URL,
1010
val l2Endpoint: URL,
1111
val l1PollingInterval: Duration = 6.seconds,
12-
val l1QueryBlockTag: BlockParameter.Tag = BlockParameter.Tag.FINALIZED
12+
val l1QueryBlockTag: BlockParameter.Tag = BlockParameter.Tag.FINALIZED,
1313
)

coordinator/app/src/main/kotlin/linea/coordinator/config/v2/L1SubmissionConfig.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data class L1SubmissionConfig(
88
val dynamicGasPriceCap: DynamicGasPriceCapConfig,
99
val fallbackGasPrice: FallbackGasPriceConfig,
1010
val blob: BlobSubmissionConfig,
11-
val aggregation: AggregationSubmissionConfig
11+
val aggregation: AggregationSubmissionConfig,
1212
) : FeatureToggle {
1313
override val disabled: Boolean
1414
get() = blob.disabled && aggregation.disabled
@@ -17,7 +17,7 @@ data class L1SubmissionConfig(
1717
override val disabled: Boolean,
1818
val gasPriceCapCalculation: GasPriceCapCalculationConfig,
1919
val feeHistoryFetcher: FeeHistoryFetcherConfig,
20-
val timeOfDayMultipliers: TimeOfDayMultipliers
20+
val timeOfDayMultipliers: TimeOfDayMultipliers,
2121
) : FeatureToggle {
2222
data class GasPriceCapCalculationConfig(
2323
val adjustmentConstant: UInt,
@@ -27,7 +27,7 @@ data class L1SubmissionConfig(
2727
val baseFeePerGasPercentileWindowLeeway: Duration,
2828
val baseFeePerGasPercentile: UInt,
2929
val gasPriceCapsCheckCoefficient: Double,
30-
val timeOfTheDayMultipliers: Map<String, Double>
30+
val timeOfTheDayMultipliers: Map<String, Double>,
3131
)
3232

3333
data class FeeHistoryFetcherConfig(
@@ -36,25 +36,25 @@ data class L1SubmissionConfig(
3636
val maxBlockCount: UInt,
3737
val rewardPercentiles: List<UInt>,
3838
val numOfBlocksBeforeLatest: UInt,
39-
val storagePeriod: Duration
39+
val storagePeriod: Duration,
4040
)
4141
}
4242

4343
data class FallbackGasPriceConfig(
4444
val feeHistoryBlockCount: UInt,
45-
val feeHistoryRewardPercentile: UInt
45+
val feeHistoryRewardPercentile: UInt,
4646
)
4747

4848
data class GasConfig(
4949
val gasLimit: ULong,
5050
val maxFeePerGasCap: ULong,
5151
val maxPriorityFeePerGasCap: ULong,
5252
val maxFeePerBlobGasCap: ULong? = null,
53-
val fallback: FallbackGasConfig
53+
val fallback: FallbackGasConfig,
5454
) {
5555
data class FallbackGasConfig(
5656
val priorityFeePerGasUpperBound: ULong,
57-
val priorityFeePerGasLowerBound: ULong
57+
val priorityFeePerGasLowerBound: ULong,
5858
)
5959
}
6060

@@ -67,7 +67,7 @@ data class L1SubmissionConfig(
6767
val targetBlobsPerTransaction: UInt,
6868
val dbMaxBlobsToReturn: UInt,
6969
val gas: GasConfig,
70-
val signer: SignerConfig
70+
val signer: SignerConfig,
7171
) : FeatureToggle
7272

7373
data class AggregationSubmissionConfig(
@@ -77,6 +77,6 @@ data class L1SubmissionConfig(
7777
val submissionTickInterval: Duration,
7878
val maxSubmissionsPerTick: UInt,
7979
val gas: GasConfig,
80-
val signer: SignerConfig
80+
val signer: SignerConfig,
8181
) : FeatureToggle
8282
}

coordinator/app/src/main/kotlin/linea/coordinator/config/v2/L2NetworkGasPricingConfig.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ data class L2NetworkGasPricingConfig(
1414
val flatRateGasPricing: FlatRateGasPricing,
1515
val extraDataUpdateEndpoint: URL,
1616
val extraDataUpdateRequestRetries: RetryConfig,
17-
val l1Endpoint: URL
17+
val l1Endpoint: URL,
1818
) : FeatureToggle {
1919
data class DynamicGasPricing(
2020
val l1BlobGas: ULong,
2121
val blobSubmissionExpectedExecutionGas: ULong,
2222
val variableCostUpperBound: ULong,
2323
val variableCostLowerBound: ULong,
24-
val margin: Double
24+
val margin: Double,
2525
)
2626

2727
data class FlatRateGasPricing(
2828
val gasPriceLowerBound: ULong,
2929
val gasPriceUpperBound: ULong,
3030
val plainTransferCostMultiplier: Double = 1.0,
3131
val compressedTxSize: UInt = 125u,
32-
val expectedGas: UInt = 21000u
32+
val expectedGas: UInt = 21000u,
3333
)
3434
}

coordinator/app/src/main/kotlin/linea/coordinator/config/v2/MessageAnchoringConfig.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ data class MessageAnchoringConfig(
1313
val l1HighestBlockTag: BlockParameter = BlockParameter.Tag.FINALIZED,
1414
val l1RequestRetries: RetryConfig = RetryConfig.endlessRetry(
1515
backoffDelay = 1.seconds,
16-
failuresWarningThreshold = 3u
16+
failuresWarningThreshold = 3u,
1717
),
1818
val l1EventScrapping: L1EventScrapping = L1EventScrapping(),
1919
val l2Endpoint: URL,
2020
val l2HighestBlockTag: BlockParameter = BlockParameter.Tag.LATEST,
2121
val l2RequestRetries: RetryConfig = RetryConfig.endlessRetry(
2222
backoffDelay = 1.seconds,
23-
failuresWarningThreshold = 3u
23+
failuresWarningThreshold = 3u,
2424
),
2525
val anchoringTickInterval: Duration = 2.seconds,
2626
val messageQueueCapacity: UInt = 10_000u,
2727
val maxMessagesToAnchorPerL2Transaction: UInt = 100u,
2828
val signer: SignerConfig,
29-
val gas: GasConfig = GasConfig()
29+
val gas: GasConfig = GasConfig(),
3030
) : FeatureToggle {
3131
init {
3232
require(messageQueueCapacity >= 1u) {
@@ -44,7 +44,7 @@ data class MessageAnchoringConfig(
4444
val pollingInterval: Duration = 2.seconds,
4545
val pollingTimeout: Duration = 5.seconds,
4646
val ethLogsSearchSuccessBackoffDelay: Duration = 1.milliseconds,
47-
val ethLogsSearchBlockChunkSize: UInt = 1000u
47+
val ethLogsSearchBlockChunkSize: UInt = 1000u,
4848
) {
4949
init {
5050
require(pollingInterval >= 1.milliseconds) {
@@ -66,6 +66,6 @@ data class MessageAnchoringConfig(
6666
val maxFeePerGasCap: ULong = 100_000_000_000uL, // 100 gwei
6767
val gasLimit: ULong = 2_500_000uL,
6868
val feeHistoryBlockCount: UInt = 4u,
69-
val feeHistoryRewardPercentile: UInt = 15u
69+
val feeHistoryRewardPercentile: UInt = 15u,
7070
)
7171
}

coordinator/app/src/main/kotlin/linea/coordinator/config/v2/ProtocolConfig.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import kotlin.time.Duration
66
data class ProtocolConfig(
77
val genesis: Genesis,
88
val l1: Layer1Config,
9-
val l2: Layer2Config
9+
val l2: Layer2Config,
1010
) {
1111
data class Genesis(
1212
val genesisStateRootHash: ByteArray,
13-
val genesisShnarf: ByteArray
13+
val genesisShnarf: ByteArray,
1414
) {
1515

1616
override fun equals(other: Any?): Boolean {
@@ -34,11 +34,11 @@ data class ProtocolConfig(
3434

3535
data class Layer1Config(
3636
val contractAddress: String,
37-
val blockTime: Duration
37+
val blockTime: Duration,
3838
)
3939

4040
data class Layer2Config(
4141
val contractAddress: String,
42-
val contractDeploymentBlockNumber: BlockParameter.BlockNumber?
42+
val contractDeploymentBlockNumber: BlockParameter.BlockNumber?,
4343
)
4444
}

0 commit comments

Comments
 (0)