Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenesis support #1693

Merged
merged 30 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1ff2a7b
Split initial state from chain config (#1459)
MujkicA Dec 20, 2023
c4946de
Chain state encoding (#1474)
MujkicA Jan 26, 2024
16817f2
merge master
MujkicA Feb 5, 2024
a4021f1
Stream reader for chain state (#1519)
MujkicA Feb 21, 2024
e9324c4
merge master part 1
MujkicA Feb 21, 2024
cfb7eab
fmt
MujkicA Feb 21, 2024
fd725ee
merge
MujkicA Feb 22, 2024
f33eb56
off chain genesis
MujkicA Feb 22, 2024
590793e
off chain generated utxos
MujkicA Feb 22, 2024
290c932
remove optional fields from configs
MujkicA Feb 27, 2024
503f177
Merge branch 'master' of github.com:FuelLabs/fuel-core into feature/r…
MujkicA Feb 27, 2024
c3818fa
merge]
MujkicA Feb 27, 2024
ca96107
put rand behind std flag
MujkicA Feb 27, 2024
81a0a98
Revert removing optional fields from config
MujkicA Feb 28, 2024
5c74cb0
revert
MujkicA Feb 28, 2024
5d95ad9
Merge branch 'master' of github.com:FuelLabs/fuel-core into feature/r…
MujkicA Feb 28, 2024
edf72fa
update contract latest utxo insertion
MujkicA Feb 28, 2024
8188f9e
review comments
MujkicA Feb 29, 2024
650257d
fix chain config
MujkicA Feb 29, 2024
2bc8303
merge
MujkicA Mar 4, 2024
10077ca
restore missing contract from dev config
MujkicA Mar 4, 2024
88938c8
merge now, fix tests later
MujkicA Mar 4, 2024
a4b98c6
Merge branch 'master' of github.com:FuelLabs/fuel-core into feature/r…
MujkicA Mar 4, 2024
4f2f988
fix build
MujkicA Mar 4, 2024
caded52
human readable storage slot value
segfault-magnet Mar 5, 2024
2535d48
fix p2p tests
MujkicA Mar 5, 2024
fd14783
Merge branch 'master' of github.com:FuelLabs/fuel-core into feature/r…
MujkicA Mar 5, 2024
037686c
Merge branch 'master' into feature/regenesis-support
MujkicA Mar 5, 2024
4e12b37
Added comments regarding the future work
xgreenx Mar 5, 2024
b5d8e75
Added mroe TODOS
xgreenx Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

#### Breaking

- [#1693](https://github.com/FuelLabs/fuel-core/pull/1693): The change separates the initial chain state from the chain config and stores them in separate files when generating a snapshot. The state snapshot can be generated in a new format where parquet is used for compression and indexing while postcard is used for encoding. This enables importing in a stream like fashion which reduces memory requirements. Json encoding is still supported to enable easy manual setup. However, parquet is prefered for large state files.

### Snapshot command

The CLI was expanded to allow customizing the used encoding. Snapshots are now generated along with a metadata file describing the encoding used. The metadata file contains encoding details as well as the location of additional files inside the snapshot directory containing the actual data. The chain config is always generated in the JSON format.

The snapshot command now has the '--output-directory' for specifying where to save the snapshot.

### Run command

The run command now includes the 'db_prune' flag which when provided will prune the existing db and start genesis from the provided snapshot metadata file or the local testnet configuration.

The snapshot metadata file contains paths to the chain config file and files containing chain state items (coins, messages, contracts, contract states, and balances), which are loaded via streaming.

Each item group in the genesis process is handled by a separate worker, allowing for parallel loading. Workers stream file contents in batches.

A database transaction is committed every time an item group is succesfully loaded. Resumability is achieved by recording the last loaded group index within the same db tx. If loading is aborted, the remaining workers are shutdown. Upon restart, workers resume from the last processed group.

### Contract States and Balances

Using uniform-sized batches may result in batches containing items from multiple contracts. Optimal performance can presumably be achieved by selecting a batch size that typically encompasses an entire contract's state or balance, allowing for immediate initialization of relevant Merkle trees.

- [#1725](https://github.com/FuelLabs/fuel-core/pull/1725): All API endpoints now are prefixed with `/v1` version. New usage looks like: `/v1/playground`, `/v1/graphql`, `/v1/graphql-sub`, `/v1/metrics`, `/v1/health`.
- [#1722](https://github.com/FuelLabs/fuel-core/pull/1722): Bugfix: Zero `predicate_gas_used` field during validation of the produced block.
- [#1714](https://github.com/FuelLabs/fuel-core/pull/1714): The change bumps the `fuel-vm` to `0.47.1`. It breaks several breaking changes into the protocol:
Expand Down Expand Up @@ -239,7 +261,6 @@ FuelVM received a lot of safety and stability improvements:
- Refactored errors, returning more detailed errors to the user, simplifying debugging.

### Added

- [#1503](https://github.com/FuelLabs/fuel-core/pull/1503): Add `gtf` opcode sanity check.
- [#1502](https://github.com/FuelLabs/fuel-core/pull/1502): Added price benchmark for `vm_initialization`.
- [#1501](https://github.com/FuelLabs/fuel-core/pull/1501): Add a CLI command for generating a fee collection contract.
Expand Down
Loading
Loading