Commit 0eabbd7
Merge #4060
4060: Remove double counting of imports r=janezpodhostnik a=janezpodhostnik
closes: onflow/cadence#1684
This removes metering imports multiple times within the same "scope".
with this scenario:
```
A
B imports A
C imports A,B
D imports C,A, B <- order is important
```
this is the loading process:
- scope D: count importing D
- scope C: count importing C
- count importing A
- scope B:
- count importing A (even though it has been seen in scope C it has not been seen in scope B so we need to count it)
- don't count importing A it has already been seen in scope D
- don't count importing B (and dependencies) it has already been seen in scope D
The reason for this is that any of those individual "scopes"/contracts/programs need to be loaded independently because they are cached independently.
Co-authored-by: Janez Podhostnik <[email protected]>File tree
6 files changed
+368
-40
lines changed- fvm
- derived
- environment
- errors
6 files changed
+368
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
188 | 202 | | |
189 | 203 | | |
190 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
97 | 115 | | |
98 | 116 | | |
99 | 117 | | |
| |||
201 | 219 | | |
202 | 220 | | |
203 | 221 | | |
204 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
205 | 225 | | |
| 226 | + | |
206 | 227 | | |
207 | 228 | | |
208 | 229 | | |
209 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
210 | 233 | | |
211 | 234 | | |
212 | 235 | | |
| |||
339 | 362 | | |
340 | 363 | | |
341 | 364 | | |
342 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
343 | 368 | | |
344 | 369 | | |
345 | 370 | | |
| |||
354 | 379 | | |
355 | 380 | | |
356 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
0 commit comments