Commit 66a2d43
authored
feat: remove total logs len from pre tail kernels + add to L1 (AztecProtocol#6466)
## Remove total logs length
Now individual logs lengths are tracked inside the kernels, we can
accurately calculate DA gas and don't need the total lengths
(`(un)encrypted_log_preimages_length`). This PR removes them.
However, we should be checking that logs emitted on L1 are the lengths
claimed in the circuits since they originate in untrusted contexts.
## Add length check to L1
To allow for this check, total lengths are calculated when converting to
`CombinedAccumulatedData` at the 'end' of the tail kernels. In the
circuit, these are maintained throughout the rollup stages and included
in the `txsEffectHash`.
On L1, when we re-calculate the hash, the lengths of the raw logs are
accumulated and asserted to match those given in the block. A mismatch
suggests that a user may have claimed their log was shorter than reality
to try and pay less gas (and the sequencer missed it or is dishonest).
---
- [x] Remove total logs length from pre-tail kernel circuits
- [x] Calculate the total length when converting to
`CombinedAccumulatedData`
- [x] Add lengths to `txEffectsHash` and check against raw logs on L1
---1 parent 0ac83dc commit 66a2d43
65 files changed
Lines changed: 381 additions & 443 deletions
File tree
- barretenberg/cpp/src/barretenberg/vm/avm_trace
- l1-contracts
- src/core/libraries
- decoders
- test
- decoders
- helpers
- fixtures
- noir-projects
- aztec-nr/aztec/src
- context
- oracle
- noir-protocol-circuits/crates
- private-kernel-lib/src
- public-kernel-lib/src
- reset-kernel-lib/src/reset
- rollup-lib/src
- types/src
- abis
- accumulated_data
- tests
- yarn-project
- circuit-types/src
- logs
- tx
- circuits.js/src
- structs
- __snapshots__
- kernel
- tests
- noir-protocol-circuits-types/src
- simulator/src
- avm/journal
- client
- mocks
- public
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
151 | | - | |
152 | | - | |
153 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
154 | 189 | | |
155 | 190 | | |
156 | 191 | | |
| |||
185 | 220 | | |
186 | 221 | | |
187 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
188 | 227 | | |
189 | 228 | | |
190 | 229 | | |
| |||
194 | 233 | | |
195 | 234 | | |
196 | 235 | | |
197 | | - | |
| 236 | + | |
198 | 237 | | |
199 | 238 | | |
200 | 239 | | |
| |||
207 | 246 | | |
208 | 247 | | |
209 | 248 | | |
210 | | - | |
211 | | - | |
212 | | - | |
| 249 | + | |
| 250 | + | |
213 | 251 | | |
214 | 252 | | |
215 | 253 | | |
216 | | - | |
| 254 | + | |
217 | 255 | | |
218 | 256 | | |
219 | 257 | | |
| |||
229 | 267 | | |
230 | 268 | | |
231 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
232 | 274 | | |
233 | 275 | | |
234 | 276 | | |
235 | 277 | | |
236 | 278 | | |
237 | 279 | | |
238 | 280 | | |
239 | | - | |
| 281 | + | |
240 | 282 | | |
241 | 283 | | |
242 | 284 | | |
| 285 | + | |
243 | 286 | | |
244 | 287 | | |
245 | 288 | | |
| |||
253 | 296 | | |
254 | 297 | | |
255 | 298 | | |
| 299 | + | |
| 300 | + | |
256 | 301 | | |
257 | 302 | | |
258 | 303 | | |
| |||
268 | 313 | | |
269 | 314 | | |
270 | 315 | | |
271 | | - | |
| 316 | + | |
272 | 317 | | |
273 | 318 | | |
274 | 319 | | |
| |||
284 | 329 | | |
285 | 330 | | |
286 | 331 | | |
287 | | - | |
| 332 | + | |
288 | 333 | | |
289 | 334 | | |
290 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
| |||
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
193 | | - | |
| 195 | + | |
| 196 | + | |
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| |||
202 | 205 | | |
203 | 206 | | |
204 | 207 | | |
| 208 | + | |
| 209 | + | |
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
| |||
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
225 | | - | |
| 230 | + | |
| 231 | + | |
226 | 232 | | |
227 | 233 | | |
228 | 234 | | |
| |||
238 | 244 | | |
239 | 245 | | |
240 | 246 | | |
| 247 | + | |
| 248 | + | |
241 | 249 | | |
242 | 250 | | |
243 | 251 | | |
| |||
263 | 271 | | |
264 | 272 | | |
265 | 273 | | |
266 | | - | |
| 274 | + | |
| 275 | + | |
267 | 276 | | |
268 | 277 | | |
269 | 278 | | |
| |||
281 | 290 | | |
282 | 291 | | |
283 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
284 | 296 | | |
285 | 297 | | |
286 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
0 commit comments