-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Parallelise block/transaction changes creation in Importer #2618
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
Merged
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
5c822da
Parallelise encoding to changes of the block and transaction data
AurelienFT aeb0f7b
Add CHANGELOG.md
AurelienFT 9c08308
Update order check error in commit importer
AurelienFT b854452
Add possibility to submit a list of changes to rocksdb
AurelienFT 3134fb0
Special case history rocksdb and changelog
AurelienFT 8db1be9
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT 7b06b0d
Make sure we don't create a transaction if not needed & Clippy
AurelienFT e5d4ef9
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT 50a672b
Use new list of changes feature in importer
AurelienFT 55edadd
add not unique check
AurelienFT f8e001f
Change `commit_changes_with_height_update` to work with StorageChanges
AurelienFT 91f9e2e
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT b92cbd8
fix compilation relayer feature
AurelienFT f78d496
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT ab75ebb
Update importer to use the correct commit function
AurelienFT fb5c157
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT 6a95719
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT 81e7c12
Fix changelog
AurelienFT 6f50c51
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT 46c83e4
changelog
AurelienFT aba1fec
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT 3a67be5
Fix test compilation and clippy
AurelienFT 60c5e03
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT 9171473
fmt
AurelienFT f8e39c4
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT ed3d6cd
fix importer mock
AurelienFT 6ac67f1
fix importer tests
AurelienFT 6f7f24b
Fix clippy
AurelienFT 7c37e56
update changes returned by Importer
AurelienFT 742a0e3
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT 4e69661
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT 1dfaa47
Refactor `iter_store_keys` (#2651)
MitchTurner d5b5265
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT 965d208
Merge branch 'master' into take_vec_changes_rocksdb
MitchTurner ca80eea
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT eaf2c57
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT f89556c
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT fe267c5
Update CHANGELOG.md
AurelienFT b6eeb6a
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT 07c6855
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT f0e47f4
Add changelog
AurelienFT 6453efe
Handle conflicts in the case of multiple changes
xgreenx a2db262
Small things from the final review
xgreenx b74c791
Merge branch 'master' into take_vec_changes_rocksdb
xgreenx fc49831
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
xgreenx c70e803
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT 42cf2b8
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT 234fedc
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT 766edce
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT bd319f1
Dedicated threads for the block importer (#2750)
xgreenx e738d0f
Merge branch 'master' into take_vec_changes_rocksdb
AurelienFT 509aef3
Merge branch 'take_vec_changes_rocksdb' into parallelise_importer
AurelienFT b54ba66
Merge branch 'master' into parallelise_importer
AurelienFT c733269
Merge branch 'master' into parallelise_importer
xgreenx 615ecc5
Merge branch 'master' into parallelise_importer
xgreenx 64e338a
Merge branch 'master' into parallelise_importer
AurelienFT 030cab6
Update crates/services/importer/src/local_runner.rs
AurelienFT 1985aa6
Update crates/services/importer/src/local_runner.rs
AurelienFT 6322689
Update crates/services/importer/src/local_runner.rs
AurelienFT 55b96fc
fmt
AurelienFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
Parallelize block/transaction changes creation in Importer |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,81 @@ | ||
use fuel_core_storage::{ | ||
Error as StorageError, | ||
MerkleRoot, | ||
}; | ||
use fuel_core_types::{ | ||
blockchain::primitives::BlockId, | ||
fuel_types::BlockHeight, | ||
services::executor, | ||
}; | ||
use tokio::sync::{ | ||
mpsc, | ||
oneshot, | ||
TryAcquireError, | ||
}; | ||
|
||
#[derive(Debug, derive_more::Display, derive_more::From)] | ||
pub enum Error { | ||
#[display(fmt = "The commit is already in the progress: {_0}.")] | ||
Semaphore(TryAcquireError), | ||
#[display( | ||
fmt = "The wrong state of database during insertion of the genesis block." | ||
)] | ||
InvalidUnderlyingDatabaseGenesisState, | ||
#[display(fmt = "The wrong state of storage after execution of the block.\ | ||
The actual root is {_1:?}, when the expected root is {_0:?}.")] | ||
InvalidDatabaseStateAfterExecution(Option<MerkleRoot>, Option<MerkleRoot>), | ||
#[display(fmt = "Got overflow during increasing the height.")] | ||
Overflow, | ||
#[display(fmt = "The non-generic block can't have zero height.")] | ||
ZeroNonGenericHeight, | ||
#[display(fmt = "The actual height is {_1}, when the next expected height is {_0}.")] | ||
IncorrectBlockHeight(BlockHeight, BlockHeight), | ||
#[display( | ||
fmt = "Got another block id after validation of the block. Expected {_0} != Actual {_1}" | ||
)] | ||
BlockIdMismatch(BlockId, BlockId), | ||
#[display(fmt = "Some of the block fields are not valid: {_0}.")] | ||
FailedVerification(anyhow::Error), | ||
#[display(fmt = "The execution of the block failed: {_0}.")] | ||
FailedExecution(executor::Error), | ||
#[display(fmt = "It is not possible to execute the genesis block.")] | ||
ExecuteGenesis, | ||
#[display(fmt = "The database already contains the data at the height {_0}.")] | ||
NotUnique(BlockHeight), | ||
#[display(fmt = "The previous block processing is not finished yet.")] | ||
PreviousBlockProcessingNotFinished, | ||
#[display(fmt = "The send command to the inner task failed.")] | ||
SendCommandToInnerTaskFailed, | ||
#[display(fmt = "The inner import task is not running.")] | ||
InnerTaskIsNotRunning, | ||
#[from] | ||
Storage(StorageError), | ||
UnsupportedConsensusVariant(String), | ||
ActiveBlockResultsSemaphoreClosed(tokio::sync::AcquireError), | ||
RayonTaskWasCanceled, | ||
} | ||
|
||
impl From<Error> for anyhow::Error { | ||
fn from(error: Error) -> Self { | ||
anyhow::Error::msg(error) | ||
} | ||
} | ||
|
||
impl From<oneshot::error::RecvError> for Error { | ||
fn from(_: oneshot::error::RecvError) -> Self { | ||
Error::InnerTaskIsNotRunning | ||
} | ||
} | ||
|
||
impl<T> From<mpsc::error::SendError<T>> for Error { | ||
fn from(_: mpsc::error::SendError<T>) -> Self { | ||
Error::SendCommandToInnerTaskFailed | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
impl PartialEq for Error { | ||
fn eq(&self, other: &Self) -> bool { | ||
format!("{self}") == format!("{other}") | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.