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

Enable warp sync #901

Merged
merged 42 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
89f7f00
Substrate updates
Dinonard Mar 24, 2023
6c3820c
Everything required except XCM
Dinonard Mar 24, 2023
8cbd0fc
Fix deps
Dinonard Mar 24, 2023
817d40a
Fix messed dependencies repos
Dinonard Mar 24, 2023
d48798f
Progress with Shibuya XCM & some leftover for other parts
Dinonard Mar 24, 2023
f0d4ca1
Frontier miss
Dinonard Mar 27, 2023
cdd8ac1
Shibuya fixes
Dinonard Mar 27, 2023
751200c
Additional bumps & fixes
Dinonard Mar 27, 2023
ebae80e
Shibuya compiles
Dinonard Mar 27, 2023
a208ccd
Shibuya additonal change
Dinonard Mar 27, 2023
84541e8
Local runtime
Dinonard Mar 27, 2023
478df92
Shiden compiles
Dinonard Mar 27, 2023
4b8633f
Astar
Dinonard Mar 27, 2023
306960a
xcm-tools fix
Dinonard Mar 27, 2023
92b974c
client progress
Dinonard Mar 27, 2023
a9e33e3
Client finished
Dinonard Mar 27, 2023
01fc717
evm-tracing adjustment
Dinonard Mar 27, 2023
421ab82
Bump
Dinonard Mar 31, 2023
c6533d0
Updated xc-asset-config & added migration
Dinonard Mar 31, 2023
d1d4298
Sorting out some TODOs
Dinonard Apr 3, 2023
1d088b6
Progress with xcm-simulator
Dinonard Apr 3, 2023
b77f602
xcm simulator tests - 1 issue remains
Dinonard Apr 3, 2023
806266e
Xcm simulator resolved
Dinonard Apr 3, 2023
adb33e2
Fix CI issue
Dinonard Apr 3, 2023
bdd1a11
Another fix
Dinonard Apr 3, 2023
7adf671
Additional updates & TODOs resolution
Dinonard Apr 3, 2023
14094c5
Updated SafeCallFilter - more work required
Dinonard Apr 4, 2023
62f1a9f
PoV size as part of unit weight cost
Dinonard Apr 4, 2023
cef4fb1
Latest dapps-staking benchmarks code
Dinonard Apr 4, 2023
2113d44
Updated weights in astar-frame
Dinonard Apr 4, 2023
1818e3a
Add pallet-xcm to benchmarks
Dinonard Apr 4, 2023
2e1135a
Improved safe call filter
Dinonard Apr 4, 2023
207f5d5
Weight re-work
Dinonard Apr 5, 2023
b6ecc49
XCM weights from benchmarks
Dinonard Apr 5, 2023
16c50e1
SafeCallFilter for Astar
Dinonard Apr 5, 2023
89bc043
Deps bump
Dinonard Apr 5, 2023
aa06997
Enable warp sync
shunsukew Apr 6, 2023
5516e67
remove WarpSync from local node
shunsukew Apr 7, 2023
b7bafc2
resolved conflicts
shunsukew Apr 13, 2023
7086dd5
fix block import queue verifier
shunsukew Apr 24, 2023
13c5c93
bump version
shunsukew May 6, 2023
c87702d
merged master
shunsukew May 6, 2023
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
32 changes: 14 additions & 18 deletions bin/collator/src/parachain/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use cumulus_client_cli::CollatorOptions;
use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion};
use cumulus_client_consensus_common::{ParachainBlockImport, ParachainConsensus};
use cumulus_client_consensus_relay_chain::Verifier as RelayChainVerifier;
use cumulus_client_network::BlockAnnounceValidator;
use cumulus_client_service::{
prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams,
prepare_node_config, start_collator, start_full_node, BuildNetworkParams, StartCollatorParams,
StartFullNodeParams,
};
use cumulus_primitives_core::ParaId;
use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain;
Expand Down Expand Up @@ -405,25 +405,23 @@ where
RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x,
s => format!("{}", s).into(),
})?;
let block_announce_validator = BlockAnnounceValidator::new(relay_chain_interface.clone(), id);

let force_authoring = parachain_config.force_authoring;
let is_authority = parachain_config.role.is_authority();
let prometheus_registry = parachain_config.prometheus_registry().cloned();
let transaction_pool = params.transaction_pool.clone();
let import_queue_service = params.import_queue.service();
let (network, system_rpc_tx, tx_handler_controller, start_network) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &parachain_config,
cumulus_client_service::build_network(BuildNetworkParams {
parachain_config: &parachain_config,
para_id: id,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
import_queue: params.import_queue,
block_announce_validator_builder: Some(Box::new(|_| {
Box::new(block_announce_validator)
})),
warp_sync_params: None,
})?;
relay_chain_interface: relay_chain_interface.clone(),
})
.await?;
Comment on lines +423 to +425
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just interested, how come we can get rid of block_announce_validator_builder? Is it not required or deprecated?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build_network is doing this internally.


let filter_pool: FilterPool = Arc::new(std::sync::Mutex::new(BTreeMap::new()));
let fee_history_cache: FeeHistoryCache = Arc::new(std::sync::Mutex::new(BTreeMap::new()));
Expand Down Expand Up @@ -722,25 +720,23 @@ where
RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x,
s => format!("{}", s).into(),
})?;
let block_announce_validator = BlockAnnounceValidator::new(relay_chain_interface.clone(), id);

let force_authoring = parachain_config.force_authoring;
let is_authority = parachain_config.role.is_authority();
let prometheus_registry = parachain_config.prometheus_registry().cloned();
let transaction_pool = params.transaction_pool.clone();
let import_queue_service = params.import_queue.service();
let (network, system_rpc_tx, tx_handler_controller, start_network) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &parachain_config,
cumulus_client_service::build_network(BuildNetworkParams {
parachain_config: &parachain_config,
para_id: id,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
import_queue: params.import_queue,
block_announce_validator_builder: Some(Box::new(|_| {
Box::new(block_announce_validator)
})),
warp_sync_params: None,
})?;
relay_chain_interface: relay_chain_interface.clone(),
})
.await?;

let filter_pool: FilterPool = Arc::new(std::sync::Mutex::new(BTreeMap::new()));
let fee_history_cache: FeeHistoryCache = Arc::new(std::sync::Mutex::new(BTreeMap::new()));
Expand Down
15 changes: 13 additions & 2 deletions bin/collator/src/parachain/shell_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use cumulus_client_consensus_common::{ParachainCandidate, ParachainConsensus};
use cumulus_primitives_core::relay_chain::{Hash as PHash, PersistedValidationData};
use futures::lock::Mutex;
use sc_consensus::{import_queue::Verifier as VerifierT, BlockImportParams};
use sc_consensus::{import_queue::Verifier as VerifierT, BlockImportParams, ForkChoiceStrategy};
use sp_api::ApiExt;
use sp_consensus::CacheKeyId;
use sp_consensus_aura::{sr25519::AuthorityId as AuraId, AuraApi};
Expand Down Expand Up @@ -113,14 +113,25 @@ where
{
async fn verify(
&mut self,
block_import: BlockImportParams<Block, ()>,
mut block_import: BlockImportParams<Block, ()>,
) -> Result<
(
BlockImportParams<Block, ()>,
Option<Vec<(CacheKeyId, Vec<u8>)>>,
),
String,
> {
// Skip checks that include execution, if being told so or when importing only state.
//
// This is done for example when gap syncing and it is expected that the block after the gap
// was checked/chosen properly, e.g. by warp syncing to this block using a finality proof.
// Or when we are importing state only and can not verify the seal.
if block_import.with_state() || block_import.state_action.skip_execution_checks() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// When we are importing only the state of a block, it will be the best block.
block_import.fork_choice = Some(ForkChoiceStrategy::Custom(block_import.with_state()));
return Ok((block_import, None));
}

let block_hash = *block_import.header.parent_hash();

if self
Expand Down