Commit 3f1b469
committed
chore(gas_price_service): split into v0 and v1 and squash FuelGasPriceUpdater type into GasPriceService (#2256)
> [!WARNING]
> 🚧🚧 This is PR 6/n in refactoring the gas price service. Now that the
`algorithm_updater` is a part of `fuel-core-gas-price-service` we have
squashed it into the `GasPriceService` using the `UninitializedTask`
struct. We don't implement `RunnableService` *or* `RunnableTask` for the
`UninitializedTask` struct, merely use it as a wrapper to generate the
`GasPriceServiceV0` 🚧🚧
## Linked Issues/PRs
<!-- List of related issues/PRs -->
- FuelLabs/fuel-core#2246
- FuelLabs/fuel-core#2245
- FuelLabs/fuel-core#2230
- FuelLabs/fuel-core#2226
- FuelLabs/fuel-core#2224
- FuelLabs/fuel-core#2192
## Description
<!-- List of detailed changes -->
- created common module containing storage adapter, l2 block source and
some updater metadata stuff (linked to storage)
- created v0 module containing impl of GasPriceAlgorithm for
AlgorithmV0, and V0metadata stuff
- created v1 module containing impl of GasPriceAlgorithm for AlgorithmV1
& da block costs source (V1Metadata didn’t exist before so i didn’t
create it)
- fuel-gas-price-updater will be nuked, an
UninitializedGasPriceServiceV(x) for each version that takes in all the
args needed
```mermaid
graph TD
A["lib.rs (entry point)"]
B[common]
B1[utils]
B2[storage]
B3[l2_block_source]
C[ports]
D[v0]
E[v1]
F[v0/algorithm]
G[v1/algorithm]
H[v0/service]
I[v1/da_source]
J[v0/metadata]
K[v1/service]
L[v0/uninitialized]
A --> B
B --> B1
B --> B2
B --> B3
B --> C
C --> D
C --> E
D --> F
D --> H
D --> J
D --> L
E --> G
E --> I
E --> K
F --> H
G --> I
H --> J
J --> L
L --> M[SharedV0Algorithm]
L --> N[GasPriceServiceV0]
subgraph Common
B
B1
B2
B3
end
subgraph Ports
C
end
subgraph V0
D
F
H
J
L
end
subgraph V1
E
G
I
K
end
```
## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [x] New behavior is reflected in tests
- [x] [The specification](https://github.com/FuelLabs/fuel-specs/)
matches the implemented behavior (link update PR if changes are needed)
### Before requesting review
- [x] I have reviewed the code myself
- [ ] I have created follow-up issues caused by this PR and linked them
here
### After merging, notify other teams
[Add or remove entries as needed]
- [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- [ ] [Sway compiler](https://github.com/FuelLabs/sway/)
- [ ] [Platform
documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+)
(for out-of-organization contributors, the person merging the PR will do
this)
- [ ] Someone else?
---------1 parent 20ffce8 commit 3f1b469
File tree
35 files changed
+1276
-1354
lines changed- crates
- fuel-core/src
- database/database_description
- service
- adapters
- fuel_gas_price_provider/tests
- services/gas_price_service/src
- common
- fuel_core_storage_adapter
- l2_block_source
- fuel_gas_price_updater
- v0
- v1
- da_source_adapter
- tests/tests
35 files changed
+1276
-1354
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | | - | |
80 | | - | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 5 additions & 3 deletions
| 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 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 41 | + | |
| 42 | + | |
46 | 43 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
53 | 47 | | |
54 | 48 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 49 | | |
60 | 50 | | |
61 | 51 | | |
| |||
79 | 69 | | |
80 | 70 | | |
81 | 71 | | |
82 | | - | |
| 72 | + | |
83 | 73 | | |
84 | 74 | | |
85 | 75 | | |
86 | 76 | | |
87 | 77 | | |
88 | 78 | | |
89 | 79 | | |
90 | | - | |
| 80 | + | |
91 | 81 | | |
92 | 82 | | |
93 | 83 | | |
| |||
199 | 189 | | |
200 | 190 | | |
201 | 191 | | |
202 | | - | |
| 192 | + | |
203 | 193 | | |
204 | 194 | | |
205 | 195 | | |
206 | 196 | | |
207 | 197 | | |
208 | 198 | | |
209 | 199 | | |
210 | | - | |
211 | | - | |
212 | 200 | | |
213 | | - | |
| 201 | + | |
| 202 | + | |
214 | 203 | | |
215 | 204 | | |
216 | 205 | | |
| |||
345 | 334 | | |
346 | 335 | | |
347 | 336 | | |
348 | | - | |
| 337 | + | |
349 | 338 | | |
350 | 339 | | |
351 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | | - | |
9 | 5 | | |
10 | 6 | | |
11 | | - | |
12 | 7 | | |
13 | 8 | | |
14 | 9 | | |
15 | | - | |
16 | | - | |
17 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
43 | | - | |
44 | 41 | | |
45 | 42 | | |
46 | | - | |
47 | 43 | | |
48 | 44 | | |
49 | 45 | | |
50 | 46 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 47 | | |
55 | 48 | | |
56 | 49 | | |
| |||
61 | 54 | | |
62 | 55 | | |
63 | 56 | | |
64 | | - | |
| 57 | + | |
65 | 58 | | |
66 | 59 | | |
67 | 60 | | |
68 | | - | |
| 61 | + | |
69 | 62 | | |
70 | 63 | | |
71 | 64 | | |
72 | 65 | | |
73 | 66 | | |
74 | | - | |
| 67 | + | |
75 | 68 | | |
76 | 69 | | |
77 | 70 | | |
78 | 71 | | |
79 | | - | |
| 72 | + | |
| 73 | + | |
80 | 74 | | |
81 | 75 | | |
82 | 76 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | 77 | | |
88 | 78 | | |
89 | 79 | | |
90 | 80 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 81 | | |
112 | 82 | | |
113 | 83 | | |
| |||
117 | 87 | | |
118 | 88 | | |
119 | 89 | | |
120 | | - | |
| 90 | + | |
121 | 91 | | |
122 | 92 | | |
123 | 93 | | |
| |||
126 | 96 | | |
127 | 97 | | |
128 | 98 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 99 | + | |
132 | 100 | | |
133 | 101 | | |
134 | 102 | | |
| |||
143 | 111 | | |
144 | 112 | | |
145 | 113 | | |
146 | | - | |
147 | 114 | | |
148 | 115 | | |
149 | 116 | | |
150 | 117 | | |
151 | 118 | | |
152 | | - | |
153 | 119 | | |
154 | 120 | | |
155 | 121 | | |
| |||
158 | 124 | | |
159 | 125 | | |
160 | 126 | | |
161 | | - | |
162 | 127 | | |
163 | 128 | | |
164 | 129 | | |
| |||
168 | 133 | | |
169 | 134 | | |
170 | 135 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 4 | | |
10 | 5 | | |
11 | 6 | | |
| |||
28 | 23 | | |
29 | 24 | | |
30 | 25 | | |
31 | | - | |
| 26 | + | |
32 | 27 | | |
33 | 28 | | |
34 | 29 | | |
| |||
0 commit comments