Skip to content

Commit 55748b9

Browse files
committed
coordinator: adds config v2 classes and parsing tests
1 parent 92f70d7 commit 55748b9

File tree

54 files changed

+2366
-1253
lines changed

Some content is hidden

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

54 files changed

+2366
-1253
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[defaults]
2+
l1-endpoint = "http://127.0.0.1:8445"
3+
l2-endpoint = "http://127.0.0.1:8545"
4+
5+
[prover]
6+
version = "v2.0.0"
7+
[prover.execution]
8+
fs-requests-directory = "tmp/local/prover/v3/execution/requests"
9+
fs-responses-directory = "tmp/local/prover/v3/execution/responses"
10+
[prover.blob-compression]
11+
fs-requests-directory = "tmp/local/prover/v3/compression/requests"
12+
fs-responses-directory = "tmp/local/prover/v3/compression/responses"
13+
[prover.proof-aggregation]
14+
fs-requests-directory = "tmp/local/prover/v2/aggregation/requests"
15+
fs-responses-directory = "tmp/local/prover/v2/aggregation/responses"
16+
17+
[traces]
18+
[traces.counters]
19+
endpoints = ["http://127.0.0.1:8745/"]
20+
[traces.conflation]
21+
endpoints = ["http://127.0.0.1:8745/"]
22+
23+
[state-manager]
24+
endpoints = ["http://127.0.0.1:8998/"]
25+
26+
[type2-state-proof-provider]
27+
disabled = true
28+
29+
[l1-finalization-monitor]
30+
l1-query-block-tag="LATEST"
31+
32+
[l1-submission.blob.signer]
33+
type = "Web3j"
34+
35+
[l1-submission.aggregation.signer]
36+
type = "Web3j"
37+
38+
[message-anchoring]
39+
disabled = false
40+
l1-highest-block-tag="LATEST"
41+
l2-highest-block-tag="LATEST"
42+
anchoring-tick-interval = "PT1S"
43+
messages-anchoring-chuck-size = 100
44+
45+
[message-anchoring.l1-event-scraping]
46+
polling-interval = "PT1S"
47+
polling-timeout = "PT5S"
48+
message-limit-pertick = 100
49+
block-range-limit = 500
50+
51+
52+
[message-anchoring.signer]
53+
type = "Web3j"
54+
55+
[l2-network-gas-pricing]
56+
disabled = false
57+
extra-data-update-endpoint = "http://127.0.0.1:8545/"
58+
59+
[database]
60+
hostname = "127.0.0.1"
61+
port = "5432"
62+
63+
[api]
64+
observability_port = 9545
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[l1-submission.blob.signer]
2+
type = "Web3signer"
3+
4+
[l1-submission.aggregation.signer]
5+
type = "Web3signer"
6+
7+
[message-anchoring.signer]
8+
type = "Web3signer"

config/coordinator/coordinator-config-v2-sample.toml renamed to config/coordinator/coordinator-config-v2.toml

Lines changed: 55 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,37 @@ genesis-state-root-hash = "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c
99
# Keccak256(parentShnarf="0x00...00", snarkHash="0x00...00",
1010
# parentStateRootHash="0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",
1111
# evaludationClaim="0x00...00", evaludationPoint="0x00...00")
12-
genesis-shnarf-v5 = "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f"
12+
genesis-shnarf = "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f"
1313
[protocol.l1]
1414
contract-address = "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
15-
#contract-deployment-block-number = 3
15+
block-time = "PT1S"
1616
[protocol.l2]
1717
contract-address = "0xe537D669CA013d86EBeF1D64e40fC74CADC91987"
1818
contract-deployment-block-number = 3
1919

20-
2120
[conflation]
2221
diabled = false
22+
2323
blocks-limit = 2
24+
new-blocks-polling-interval="PT1S"
2425
conflation-calculator-version = "1.0.0"
2526
conflation-deadline = "PT6S" # =3*l2_block_time
2627
conflation-deadline-check-interval = "PT3S"
2728
conflation-deadline-last-block-confirmation-delay = "PT2S" # recommended: at least 2 * blockInterval
28-
2fetch-blocks-limit = 4000
29-
l2-block-creation-endpoint = "http://sequencer:8545"
30-
l2-logs-endpoint = "http://sequencer:8545"
29+
l2-fetch-blocks-limit = 4000
30+
force-stop-conflation-at-block-inclusive=100_000_000
3131

3232
# This is to prevent inflight trasactions that may change Smart contract state while coordinator is restarted.
3333
# Queries SMC for last finalised block, and keeps polling until this number of blocks observe the same state.
3434
# If state is updated meanwhile, it resets counter and restarts the polling.
3535
consistent-number-of-blocks-on-l1-to-wait = 1
36+
[conflation.l2-endpoint-request-retries]
37+
backoff-delay = "PT1S"
38+
failures-warning-threshold = 3
39+
3640

3741
[conflation.blob-compression]
42+
blob-compressor-version="V1_2"
3843
blob-size-limit = 102400 # 100KB
3944
handler-polling-interval = "PT1S"
4045
# default batches limit is aggregation-proofs-limit -1
@@ -77,23 +82,20 @@ fs-responses-directory = "/data/prover/v2/aggregation/responses"
7782
#fs-responses-directory = "/data/prover/v3/aggregation/responses"
7883

7984
[traces]
80-
raw-execution-traces-version = "0.2.0" # TODO: remove after we remove geth tracing
81-
expected-traces-api-version = "0.2.0"
85+
expected-traces-api-version = "beta-v2.1-rc16.2"
8286
[traces.counters]
8387
endpoints = ["http://traces-api:8080/"]
8488
request-limit-per-endpoint = 20
8589
[traces.counters.request-retries]
86-
max-attempts = 4
8790
backoff-delay = "PT1S"
88-
failures-warning-threshold = 2
91+
failures-warning-threshold = 10
8992

9093
[traces.conflation]
9194
endpoints = ["http://traces-api:8080/"]
9295
request-limit-per-endpoint = 2
9396
[traces.conflation.request-retries]
94-
max-attempts = 4
9597
backoff-delay = "PT1S"
96-
failures-warning-threshold = 2
98+
failures-warning-threshold = 10
9799

98100
#[traces.new]
99101
##switch-block-number-inclusive=1000
@@ -102,24 +104,24 @@ failures-warning-threshold = 2
102104
#endpoints = ["http://traces-api-v2:8080/"]
103105
#request-limit-per-endpoint = 20
104106
#[traces.new.counters.request-retries]
105-
#max-attempts = 4
107+
#max-retries = 4
106108
#backoff-delay = "PT1S"
107109
#failures-warning-threshold = 2
108110
#
109111
#[traces.new.conflation]
110112
#endpoints = ["http://traces-api:8080/"]
111113
#request-limit-per-endpoint = 2
112114
#[traces.new.conflation.request-retries]
113-
#max-attempts = 4
115+
#max-retries = 4
114116
#backoff-delay = "PT1S"
115117
#failures-warning-threshold = 2
116118

117119
[state-manager]
118-
version = "2.2.0"
120+
version = "2.3.0"
119121
endpoints = ["http://shomei:8888/"]
120122
request-limit-per-endpoint = 3
121123
[state-manager.request-retries]
122-
max-attempts = 5
124+
max-retries = 5
123125
backoff-delay = "PT2S"
124126
failures-warning-threshold = 2
125127

@@ -129,7 +131,7 @@ failures-warning-threshold = 2
129131
#endpoints = ["http://shomei:8888/"]
130132
#request-limit-per-endpoint = 3
131133
#[state-manager.new.request-retries]
132-
#max-attempts = 5
134+
#max-retries = 5
133135
#backoff-delay = "PT2S"
134136
#failures-warning-threshold = 2
135137

@@ -140,27 +142,19 @@ l1-query-block-tag="LATEST"
140142
l1-polling-interval="PT12S"
141143

142144
[type2-state-proof-provider.request-retries]
143-
max-attempts = 3
145+
max-retries = 3
144146
backoff-delay = "PT1S"
145147
failures-warning-threshold = 2
146148

147149

148150
[l1-finalization-monitor]
149-
l1-endpoint = "http://l1-el-node:8545"
150-
l2-endpoint = "http://sequencer:8545"
151151
polling-interval = "PT1S"
152152
l1-query-block-tag="FINALIZED"
153153

154-
[l1-finalization-monitor.request-retries]
155-
max-attempts = 3
156-
backoff-delay = "PT1S"
157-
failures-warning-threshold = 2
158-
159-
160154
[l1-submission] # submission
161155
disabled = true
162156
[l1-submission.dynamic-gas-price-cap]
163-
disabled = true
157+
disabled = false
164158
[l1-submission.dynamic-gas-price-cap.gas-price-cap-calculation]
165159
adjustment-constant = 25
166160
blob-adjustment-constant = 25
@@ -173,7 +167,7 @@ gas-price-caps-check-coefficient = 0.9
173167
fetch-interval = "PT1S"
174168
max-block-count = 1000
175169
reward-percentiles = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
176-
[l1-submission.dynamic-gas-price-cap.fee-history-storage]
170+
num-of-blocks-before-latest = 2
177171
storage-period = "P10D"
178172

179173
[l1-submission.fallback-gas-price]
@@ -182,7 +176,6 @@ fee-history-reward-percentile = 15
182176

183177
[l1-submission.blob]
184178
disabled = false
185-
endpoint = "http://l1-el-node:8545"
186179
submission-delay = "PT1S"
187180
submission-tick-interval = "PT1S"
188181
max-submission-transactions-per-tick = 10
@@ -192,6 +185,7 @@ db-max-blobs-to-return = 100
192185
gas-limit = 10000000
193186
max-fee-per-gas-cap = 100000000000
194187
max-fee-per-blob-gas-cap = 100000000000
188+
max-priority-fee-per-gas-cap=20000000000
195189
# Note: prefixed with "fallback-", used when dynamic gas price is disabled or DB is not populated yet
196190
[l1-submission.blob.gas.fallback]
197191
priority-fee-per-gas-upper-bound = 20000000000 # 20 GWEI
@@ -219,8 +213,9 @@ submission-delay = "PT1S"
219213
submission-tick-interval = "PT1S"
220214
max-submissions-per-tick = 10
221215
[l1-submission.aggregation.gas]
222-
gas-limit = 10000000
223-
max-fee-per-gas-cap = 100000000000
216+
gas-limit = 10_000_000
217+
max-fee-per-gas-cap = 100_000_000_000
218+
max-priority-fee-per-gas-cap = 10_000_000_001
224219

225220
[l1-submission.aggregation.gas.fallback]
226221
# Note: prefixed with "fallback-", used when dynamic gas price is disabled or DB is not populated yet
@@ -242,8 +237,6 @@ public-key = "ba5734d8f7091719471e7f7ed6b9df170dc70cc661ca05e688601ad984f068b0d6
242237

243238
[message-anchoring]
244239
disabled = false
245-
l1-endpoint = "http://l1-el-node:8545"
246-
l2-endpoint = "http://sequencer:8545"
247240
l1-highest-block-tag="FINALIZED"
248241
l2-highest-block-tag="LATEST" # optional, default to LATEST it shall not be necessary as Linea has instant finality
249242
anchoring-tick-interval = "PT10S" # "polling-interval="PT10S"
@@ -283,52 +276,47 @@ disabled = false
283276
price-update-interval = "PT12S"
284277
fee-history-block-count = 50
285278
fee-history-reward-percentile = 15
286-
min-mineable-fees-enabled = true
287-
extra-data-enabled = true
288-
## Usend un both extraDataPricerService and minMineableFeesCalculator,
289-
# extraDataPricerService just uses minMineableFeesCalculator as delegate to get legacy fees
290-
gas-price-upper-bound = 10000000000 # 10 GWEI
291-
gas-price-lower-bound = 90000000 # 0.09 GWEI
292279
gas-price-fixed-cost = 3000000
280+
extra-data-update-endpoint = "http://sequencer:8545/"
281+
[l2-network-gas-pricing.extra-data-update-request-retries]
282+
max-retries = 4
283+
timeout = "PT7S"
284+
backoff-delay = "PT2S"
285+
failures-warning-threshold = 3
293286

294-
# Defaults to expected-blob-gas
295-
#bytes-per-data-submission=131072.0 # 2^17
296-
[l2-network-gas-pricing.request-retries]
297-
max-attempts = 3
298-
timeout = "PT6S"
299-
backoff-delay = "PT1S"
300-
failures-warning-threshold = 2
301-
302-
[l2-network-gas-pricing.extra-data] # TODO: find proper name for "new", maybe "2D"
303-
l1-blob-gas = 131072.0 # 2^17 # expected-l1-blob-gas previous name: expected-blob-gas
304-
blob-submission-expected-execution-gas = 213000.0 # Lower to 120k as we improve efficiency
287+
[l2-network-gas-pricing.flat-rate-gas-pricing]
288+
# Relate to legacy gas pricing, goes into extradata
289+
# and is exposed on Bessu eth_gasPrice
290+
gas-price-upper-bound = 10000000000 # 10 GWEI
291+
gas-price-lower-bound = 90000000 # 0.09 GWEI
292+
compressed-tx-size = 125
293+
expected-gas = 21000
294+
cost-multiplier = 1.0
295+
296+
[l2-network-gas-pricing.dynamic-gas-pricing]
297+
# Propagated to Sequencer and Besude through extraDataPricerService and besu
298+
# uses it dynaically culcuale the profitability of each transaction on:
299+
# eth_sendRawTransaction, linea_estimateGas, and block building
300+
l1-blob-gas = 131072 # 2^17 # expected-l1-blob-gas previous name: expected-blob-gas
301+
blob-submission-expected-execution-gas = 213000
305302
variable-cost-upper-bound = 10000000001 # ~10 GWEI
306303
variable-cost-lower-bound = 90000001 # ~0.09 GWEI
307304
margin = 4.0
308-
extra-data-update-endpoint = "http://sequencer:8545/"
309-
310-
[l2-network-gas-pricing.min-mineable] # current legacy implementation
311-
base-fee-coefficient = 0.1
312-
priority-fee-coefficient = 1.0
313-
base-fee-blob-coefficient = 0.1
314-
legacy-fees-multiplier = 1.2
315-
geth-gas-price-update-endpoints = [
316-
"http://traces-node:8545/",
317-
"http://l2-node:8545/"
318-
]
319-
besu-gas-price-update-endpoints = [
320-
"http://sequencer:8545/"
321-
]
322305

323306
[database]
324-
host = "postgres"
325-
port = "5432"
307+
hostname = "postgres"
308+
port=5432
326309
username = "postgres"
327310
password = "postgres"
328311
schema = "linea_coordinator"
329312
read_pool_size = 10
330313
read_pipelining_limit = 10
331314
transactional_pool_size = 10
315+
[database.persistence-retries]
316+
max-retries = 3
317+
backoff-delay = "PT1S"
318+
timeout = "PT10S"
319+
failures-warning-threshold = 2
332320

333321
[api]
334-
observability_port = 9545
322+
observability-port = 9545
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package linea.coordinator.config
2+
3+
import linea.domain.RetryConfig
4+
import net.consensys.linea.jsonrpc.client.RequestRetryConfig
5+
6+
fun RetryConfig.toJsonRpcRetry(): RequestRetryConfig {
7+
return RequestRetryConfig(
8+
maxRetries = maxRetries,
9+
timeout = timeout,
10+
backoffDelay = backoffDelay,
11+
failuresWarningThreshold = failuresWarningThreshold
12+
)
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package linea.coordinator.config.v2
2+
3+
data class ApiConfig(
4+
val observabilityPort: UInt
5+
)

0 commit comments

Comments
 (0)