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

Keep data in fails cases in sync service #2361

Merged
merged 36 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b191e08
Update p2p mock and add a test for the save of data
AurelienFT Oct 15, 2024
704a583
Fix a test
AurelienFT Oct 15, 2024
e94bee2
Add caching of headers or blocks already fetched. Removed when succes…
AurelienFT Oct 16, 2024
6a61661
Add changelog and fmt
AurelienFT Oct 16, 2024
34ec1c6
Fix clippy
AurelienFT Oct 16, 2024
c4bb96c
Add new cache structure. (Not fully working because of batch of heade…
AurelienFT Oct 17, 2024
23c7eaa
Add new chunk system to distinguish chunks of blocks and blocks heade…
AurelienFT Oct 18, 2024
41966a6
Improve changes made to back pressure test because going too fast
AurelienFT Oct 18, 2024
8e4fc44
Update get_chunks method to be more readable
AurelienFT Oct 18, 2024
27a5856
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Oct 18, 2024
879eb94
Update CHANGELOG.md
AurelienFT Oct 18, 2024
a29e763
Avoid unecessary changes in changelog
AurelienFT Oct 18, 2024
83401ce
Remove old comment
AurelienFT Oct 18, 2024
62cae71
fix compil benchmark
AurelienFT Oct 18, 2024
84bac0a
fix clippy
AurelienFT Oct 21, 2024
42719bf
Add a way to fetch transactions without specifying a peer in P2P
AurelienFT Oct 21, 2024
c80f3ac
Update CANGELOG.md
AurelienFT Oct 21, 2024
ab3221c
Merge branch 'add_p2p_fetch_txs_no_peer_specified' into sync_service/…
AurelienFT Oct 21, 2024
99135e3
Use get transactions without peer_id when use headers from cache
AurelienFT Oct 21, 2024
862ef36
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Oct 31, 2024
0ac1e34
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Oct 31, 2024
2407078
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Oct 31, 2024
bb3b8ca
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Nov 14, 2024
6dae6c7
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Nov 18, 2024
0862890
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Nov 21, 2024
1ab0af5
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Nov 27, 2024
a566ac5
Improve some caches mechanism in sync and more comments on tests
AurelienFT Nov 27, 2024
17a38e4
Simplify chunk lf cache creation algorithm
AurelienFT Nov 27, 2024
2f18123
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Nov 27, 2024
d9ef69e
toml lint
AurelienFT Nov 27, 2024
546bcf5
Improve test and fix some safety clippy.
AurelienFT Nov 28, 2024
193e0ac
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Nov 28, 2024
10c8a21
Fix tests checks and clippy
AurelienFT Nov 28, 2024
2af4312
Simplified the implementation
xgreenx Nov 28, 2024
8ffd925
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Nov 29, 2024
e7e4195
Merge branch 'master' into sync_service/keep-data-on-stop
AurelienFT Nov 29, 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- [2362](https://github.com/FuelLabs/fuel-core/pull/2362): Added a new request_response protocol version `/fuel/req_res/0.0.2`. In comparison with `/fuel/req/0.0.1`, which returns an empty response when a request cannot be fulfilled, this version returns more meaningful error codes. Nodes still support the version `0.0.1` of the protocol to guarantee backward compatibility with fuel-core nodes. Empty responses received from nodes using the old protocol `/fuel/req/0.0.1` are automatically converted into an error `ProtocolV1EmptyResponse` with error code 0, which is also the only error code implemented. More specific error codes will be added in the future.
- [2386](https://github.com/FuelLabs/fuel-core/pull/2386): Add a flag to define the maximum number of file descriptors that RocksDB can use. By default it's half of the OS limit.
- [2376](https://github.com/FuelLabs/fuel-core/pull/2376): Add a way to fetch transactions in P2P without specifying a peer.
- [2361](https://github.com/FuelLabs/fuel-core/pull/2361): Add caches to the sync service to not reask for data it already fetched from the network.
- [2327](https://github.com/FuelLabs/fuel-core/pull/2327): Add more services tests and more checks of the pool. Also add an high level documentation for users of the pool and contributors.
- [2416](https://github.com/FuelLabs/fuel-core/issues/2416): Define the `GasPriceServiceV1` task.


### Fixed
- [2366](https://github.com/FuelLabs/fuel-core/pull/2366): The `importer_gas_price_for_block` metric is properly collected.
- [2369](https://github.com/FuelLabs/fuel-core/pull/2369): The `transaction_insertion_time_in_thread_pool_milliseconds` metric is properly collected.
Expand Down
2 changes: 1 addition & 1 deletion benches/benches/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use fuel_core_sync::state::State;
use std::time::Duration;
use tokio::runtime::Runtime;

async fn execute_import(import: PressureImport, shutdown: &mut StateWatcher) {
async fn execute_import(mut import: PressureImport, shutdown: &mut StateWatcher) {
import.import(shutdown).await.unwrap();
}

Expand Down
19 changes: 19 additions & 0 deletions crates/fuel-core/src/service/adapters/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ impl PeerToPeerPort for P2PAdapter {
}

async fn get_transactions(
&self,
block_ids: Range<u32>,
) -> anyhow::Result<SourcePeer<Option<Vec<Transactions>>>> {
let result = if let Some(service) = &self.service {
service.get_transactions(block_ids).await
} else {
Err(anyhow::anyhow!("No P2P service available"))
};
match result {
Ok((peer_id, transactions)) => {
let peer_id: PeerId = peer_id.into();
let transactions = peer_id.bind(transactions);
Ok(transactions)
}
Err(err) => Err(err),
}
}

async fn get_transactions_from_peer(
&self,
range: SourcePeer<Range<u32>>,
) -> anyhow::Result<Option<Vec<Transactions>>> {
Expand Down
Loading
Loading