forked from cometbft/cometbft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(rpc): optimize genesis file chunking (cometbft#4349)
Closes cometbft#1289. ### Changes #### `Environment` type The `Environment` type will: - store the genesis file's path on disk - store a `map[int]string` where the keys are the chunks' IDs, and the values are the chunk's path on disk. - not store a pointer to a `types.GenesisDoc` anymore - not store a slice of genesis file chunks anymore. Instead the method `InitGenesisChunks` will create chunks and store them on disk, 1 file per chunk. #### `Node` type The `Node` type will: - not store a pointer to a `GenesisDoc` anymore. - pass the genesis file's path on disk to a new `Environment` object when creating it in the `ConfigureRPC()` method. #### RPC `/genesis_chunked` This endpoint will implement the chunking strategy described [here](cometbft#1290 (comment)). --- #### PR checklist - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments --------- Co-authored-by: Andy Nogueira <[email protected]> Co-authored-by: Anton Kaliaev <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Daniel <[email protected]>
- Loading branch information
1 parent
b1dcc58
commit 48db7ac
Showing
9 changed files
with
775 additions
and
206 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
.changelog/unreleased/breaking-changes/4250-node-no-genesis.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
- `[node]` Don't store a pointer to a `types.GenesisDoc` after the node is running | ||
startup ([\#4250](https://github.com/cometbft/cometbft/pull/4250)) | ||
- `[node]` Don't store a pointer to a `types.GenesisDoc` after the node is running ([\#4250](https://github.com/cometbft/cometbft/pull/4250)) |
4 changes: 1 addition & 3 deletions
4
.changelog/unreleased/improvements/4235-4234-environment-stores-one-genesis.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
- `[rpc]` Store either a pointer to a GenesisDoc or the genesis' chunks, but not both in Environment (RPC API) | ||
a GenesisDoc or the genesis' chunks, but not both. | ||
([\#4235](https://github.com/cometbft/cometbft/pull/4235)) | ||
- `[rpc]` Store either a pointer to a `GenesisDoc` or the genesis' chunks, but not both in Environment (RPC API) ([\#4235](https://github.com/cometbft/cometbft/pull/4235)) |
2 changes: 2 additions & 0 deletions
2
.changelog/unreleased/improvements/4349-optimize-genesis-file-chunking.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Node no longer stores genesis in memory after startup | ||
([\#4349](https://github.com/cometbft/cometbft/pull/4349)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.