Commit a9957ce
Bonsai archive feature (#7475)
* rebase of bonsai archive
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* Change BonsaiReferenceTestWorldStateStorage getContextSafeCopy() to use constructor that reuses worldStateStorage so that we don't lose values in the EvmToolSpecTests
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* Force archive mode for testing
Signed-off-by: Jason Frame <jason.frame@consensys.net>
* Rebase on main
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Create new DiffBasedWorldStateConfig when copying bonsai archive world state, and freeze it
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Add BONSAI_ARCHIVE storage format
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* New ACCOUNT_FREEZER_STATE DB segment. New BonsaiArchiveFreezer to listen for blocks and move account state to new DB segment
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Add freezer segment for account storage
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Find frozen storage slots correctly, refactor the DB segment names
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Check for blocks to freeze state for on startup. Store the most recent block state has been frozen for
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Make sure genesis world state is created in archive mode
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Fix incorrect logs
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Ensure deleted storage is returned from live DB segment, not old storage from the freezer segment
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Adding tests
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Refactor DB TX with retries
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Honour code hash or account hash config for storing code. Add tests for DB mode
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Refactor code to move one block's worth of state/storage changes at a time. Add more tests
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Refactoring, fix issues, ensure only 1 batch of blocks is archived at a time
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Improve archive progress logs
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Add archive mode tests to bonsai key/value tests
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Implement snap-serving from a Bonsai Archive node and add tests
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Parameterize snap-server tests, fix bug in storage slot ranges
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Remove todo comments
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Make BONSAI_ARCHIVE experimental for the first release. Add metrics. Use the term archive, not freezer
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Add changelog entry
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Don't store every block that is waiting to be archived
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Remove pre-startup catchup. Start on first block import instead
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Multiple deletes of the same address in a single block causes Bonsai to fail the block
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Metric should be a gauge not a counter
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Refactor archive tests after code refactor
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Remove commented out sections from tests
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Update the BFT soak test to include a Bonsai archive node
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Add archive-specific checks to the BFT soak test
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Update plugin API hash
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Add javadoc
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Merge fix
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Unit test fix
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* More UT fixing
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Tidy up
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Update ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/worldview/BonsaiArchiver.java
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>
* Update plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/configuration/BaseVersionedStorageFormat.java
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>
* Update plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/configuration/BaseVersionedStorageFormat.java
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>
* Remove debug file
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Various refactoring to manage archive flat DB access more cleanly
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Merge fix
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Merge tests
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Use alternative clearStorage()
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Fix metric name
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Don't override rollMutableStateToBlockHash, create archive-specific function name
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Update world state with block number being persisted
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Update changelog
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Move context management out of flat DB strategy
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Add more test cases, tidy up code
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Update plugin hash
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Address review comments
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Persist current block number only when we have a valid block & have calculated its root hash
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Ensure genesis context is initialised for archive
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Update k/v storage test
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Tidy up after merge
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Put/get keys as bytes not hex
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Update plugin hash
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Test fix
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Update plugin hash
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
* Apply checks for deleted values to entries from archive table
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
* API hash
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
* Throw error if trying to revert archive storage format version
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
* Update plugin hash
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
---------
Signed-off-by: Jason Frame <jason.frame@consensys.net>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matt Whitehead <matthew1001@hotmail.com>
Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io>
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>1 parent 2c87eac commit a9957ce
File tree
49 files changed
+3388
-170
lines changed- acceptance-tests
- dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration
- tests/src/test/java/org/hyperledger/besu/tests/acceptance
- bftsoak
- bft
- app/src/main/java/org/hyperledger/besu
- cli/subcommands/storage
- controller
- ethereum
- core/src
- main/java/org/hyperledger/besu/ethereum
- chain
- core
- storage/keyvalue
- trie
- common
- pathbased
- bonsai
- storage
- flat
- worldview
- common
- provider
- storage
- flat
- worldview
- worldstate
- test/java/org/hyperledger/besu/ethereum/trie/pathbased
- bonsai/storage
- common
- storage/flat
- trielog
- eth/src
- main/java/org/hyperledger/besu/ethereum/eth
- manager/snap
- sync
- fastsync
- snapsync
- request
- test/java/org/hyperledger/besu/ethereum/eth/manager/snap
- plugin-api
- src/main/java/org/hyperledger/besu/plugin/services/storage
- plugins/rocksdb/src
- main/java/org/hyperledger/besu/plugin/services/storage/rocksdb
- configuration
- test/java/org/hyperledger/besu/plugin/services/storage/rocksdb
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49 files changed
+3388
-170
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
565 | 567 | | |
566 | 568 | | |
567 | 569 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
| |||
Lines changed: 61 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
64 | | - | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
81 | 89 | | |
82 | 90 | | |
83 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
84 | 99 | | |
85 | 100 | | |
86 | 101 | | |
| |||
103 | 118 | | |
104 | 119 | | |
105 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
106 | 124 | | |
107 | 125 | | |
108 | 126 | | |
| |||
131 | 149 | | |
132 | 150 | | |
133 | 151 | | |
| 152 | + | |
134 | 153 | | |
135 | 154 | | |
136 | 155 | | |
| |||
150 | 169 | | |
151 | 170 | | |
152 | 171 | | |
| 172 | + | |
153 | 173 | | |
154 | 174 | | |
155 | 175 | | |
| |||
169 | 189 | | |
170 | 190 | | |
171 | 191 | | |
| 192 | + | |
172 | 193 | | |
173 | | - | |
174 | 194 | | |
175 | 195 | | |
176 | 196 | | |
| |||
202 | 222 | | |
203 | 223 | | |
204 | 224 | | |
| 225 | + | |
205 | 226 | | |
206 | 227 | | |
207 | 228 | | |
208 | 229 | | |
209 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
210 | 235 | | |
211 | 236 | | |
212 | 237 | | |
| |||
220 | 245 | | |
221 | 246 | | |
222 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
223 | 251 | | |
224 | 252 | | |
225 | 253 | | |
| |||
230 | 258 | | |
231 | 259 | | |
232 | 260 | | |
| 261 | + | |
| 262 | + | |
233 | 263 | | |
234 | 264 | | |
235 | 265 | | |
| |||
253 | 283 | | |
254 | 284 | | |
255 | 285 | | |
| 286 | + | |
| 287 | + | |
256 | 288 | | |
257 | 289 | | |
258 | 290 | | |
259 | 291 | | |
260 | 292 | | |
261 | | - | |
| 293 | + | |
262 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
263 | 312 | | |
264 | 313 | | |
265 | 314 | | |
| |||
295 | 344 | | |
296 | 345 | | |
297 | 346 | | |
| 347 | + | |
| 348 | + | |
298 | 349 | | |
299 | 350 | | |
300 | 351 | | |
301 | 352 | | |
302 | 353 | | |
| 354 | + | |
303 | 355 | | |
304 | 356 | | |
305 | 357 | | |
306 | 358 | | |
307 | 359 | | |
| 360 | + | |
308 | 361 | | |
309 | 362 | | |
310 | 363 | | |
311 | 364 | | |
312 | 365 | | |
| 366 | + | |
313 | 367 | | |
314 | 368 | | |
315 | 369 | | |
| |||
323 | 377 | | |
324 | 378 | | |
325 | 379 | | |
| 380 | + | |
326 | 381 | | |
327 | 382 | | |
328 | 383 | | |
329 | 384 | | |
330 | 385 | | |
| 386 | + | |
331 | 387 | | |
332 | 388 | | |
333 | 389 | | |
334 | 390 | | |
335 | 391 | | |
| 392 | + | |
336 | 393 | | |
337 | 394 | | |
338 | 395 | | |
339 | 396 | | |
340 | 397 | | |
| 398 | + | |
341 | 399 | | |
342 | 400 | | |
343 | 401 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
328 | 327 | | |
329 | 328 | | |
330 | 329 | | |
331 | | - | |
332 | | - | |
| 330 | + | |
| 331 | + | |
333 | 332 | | |
334 | 333 | | |
335 | 334 | | |
| |||
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
803 | 806 | | |
804 | 807 | | |
805 | 808 | | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
806 | 822 | | |
807 | 823 | | |
808 | 824 | | |
| |||
866 | 882 | | |
867 | 883 | | |
868 | 884 | | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
869 | 903 | | |
870 | 904 | | |
871 | 905 | | |
| |||
1155 | 1189 | | |
1156 | 1190 | | |
1157 | 1191 | | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
1158 | 1208 | | |
1159 | 1209 | | |
1160 | 1210 | | |
| |||
0 commit comments