Commit 926247b
refactor(l2): decouple guest program IO (#5314)
**Motivation**
Our guest program library is used for both L1 and L2 block proving, and
the logic for it is very coupled. A first step towards decoupling this
is separating the guest program inputs for L1 and L2. This also improves
the UX for users that only care about proving L1 blocks.
**Description**
Guest program inputs for L1
```rust
pub struct ProgramInput {
/// Block to execute
pub block: Block,
/// database containing all the data necessary to execute
pub execution_witness: ExecutionWitness,
}
```
Guest program inputs for L2
```rust
pub struct ProgramInput {
/// blocks to execute
pub blocks: Vec<Block>,
/// database containing all the data necessary to execute
pub execution_witness: ExecutionWitness,
/// value used to calculate base fee
pub elasticity_multiplier: u64,
/// Configuration for L2 fees used for each block
pub fee_configs: Vec<ethrex_common::types::fee_config::FeeConfig>,
/// KZG commitment to the blob data
#[serde_as(as = "[_; 48]")]
pub blob_commitment: ethrex_common::types::blobs_bundle::Commitment,
/// KZG opening for a challenge over the blob commitment
#[serde_as(as = "[_; 48]")]
pub blob_proof: ethrex_common::types::blobs_bundle::Proof,
}
```
---------
Co-authored-by: ilitteri <[email protected]>
Co-authored-by: Tomás Paradelo <[email protected]>1 parent 82d4ead commit 926247b
File tree
5 files changed
+121
-64
lines changed- crates/l2
- prover/src
- guest_program/src
- tee/quote-gen/src
5 files changed
+121
-64
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 5 | | |
| 6 | + | |
| 7 | + | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
| |||
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
22 | | - | |
| 19 | + | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
91 | 88 | | |
92 | 89 | | |
93 | 90 | | |
| 91 | + | |
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
99 | | - | |
100 | | - | |
| 97 | + | |
101 | 98 | | |
102 | | - | |
103 | 99 | | |
104 | 100 | | |
105 | 101 | | |
106 | 102 | | |
107 | 103 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
120 | 121 | | |
121 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
127 | | - | |
128 | 131 | | |
129 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
| |||
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
189 | | - | |
| 196 | + | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
| |||
227 | 234 | | |
228 | 235 | | |
229 | 236 | | |
230 | | - | |
| 237 | + | |
231 | 238 | | |
232 | 239 | | |
233 | 240 | | |
234 | 241 | | |
235 | | - | |
| 242 | + | |
236 | 243 | | |
237 | 244 | | |
238 | 245 | | |
239 | 246 | | |
240 | 247 | | |
241 | | - | |
242 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
243 | 254 | | |
244 | 255 | | |
245 | 256 | | |
| |||
258 | 269 | | |
259 | 270 | | |
260 | 271 | | |
261 | | - | |
| 272 | + | |
262 | 273 | | |
263 | 274 | | |
264 | 275 | | |
| |||
282 | 293 | | |
283 | 294 | | |
284 | 295 | | |
285 | | - | |
| 296 | + | |
286 | 297 | | |
287 | 298 | | |
288 | 299 | | |
| |||
314 | 325 | | |
315 | 326 | | |
316 | 327 | | |
317 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
318 | 331 | | |
319 | 332 | | |
320 | 333 | | |
| |||
344 | 357 | | |
345 | 358 | | |
346 | 359 | | |
347 | | - | |
| 360 | + | |
348 | 361 | | |
349 | 362 | | |
350 | 363 | | |
351 | 364 | | |
352 | 365 | | |
353 | 366 | | |
354 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
355 | 370 | | |
356 | 371 | | |
357 | 372 | | |
| |||
394 | 409 | | |
395 | 410 | | |
396 | 411 | | |
397 | | - | |
| 412 | + | |
398 | 413 | | |
399 | 414 | | |
400 | 415 | | |
| |||
439 | 454 | | |
440 | 455 | | |
441 | 456 | | |
442 | | - | |
| 457 | + | |
443 | 458 | | |
444 | | - | |
| 459 | + | |
445 | 460 | | |
446 | 461 | | |
447 | | - | |
| 462 | + | |
448 | 463 | | |
449 | 464 | | |
450 | 465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 1 | + | |
6 | 2 | | |
7 | 3 | | |
8 | | - | |
9 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
| 18 | + | |
12 | 19 | | |
13 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
14 | 23 | | |
15 | 24 | | |
16 | 25 | | |
| |||
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
22 | | - | |
23 | | - | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | | - | |
27 | | - | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | | - | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
36 | | - | |
| 44 | + | |
37 | 45 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | | - | |
43 | | - | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
| 27 | + | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | 33 | | |
36 | | - | |
37 | 34 | | |
38 | | - | |
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
| |||
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
126 | 133 | | |
127 | 134 | | |
| 135 | + | |
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
131 | 139 | | |
132 | 140 | | |
133 | | - | |
| 141 | + | |
| 142 | + | |
134 | 143 | | |
135 | 144 | | |
136 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments