Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
729e524
WIP Statement store
arkpar Mar 14, 2023
7591d22
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Mar 15, 2023
ff1edaa
Sync with networking changes in master
arkpar Mar 15, 2023
8407e40
WIP statement pallet
arkpar Mar 15, 2023
21c9aaf
Statement validation
arkpar Mar 16, 2023
c706097
pallet tests
arkpar Mar 16, 2023
e066abe
Validation queue
arkpar Mar 17, 2023
bfbbc5b
Store maintenance
arkpar Mar 20, 2023
d36a867
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Mar 21, 2023
d610e62
Basic statement refactoring + tests + docs
arkpar Mar 21, 2023
0b73266
Store metrics
arkpar Mar 22, 2023
66b9c98
Store tests
arkpar Mar 22, 2023
c8f0467
Store maintenance test
arkpar Mar 23, 2023
9bc6773
cargo fmt
arkpar Mar 23, 2023
8263aa4
Build fix
arkpar Mar 23, 2023
7779458
OCW Api
arkpar Mar 23, 2023
f01160e
Offchain worker
arkpar Mar 23, 2023
7431f55
Enable host functions
arkpar Mar 23, 2023
5cc24b2
fmt
arkpar Mar 23, 2023
dea2dea
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Mar 24, 2023
4febbea
Minor tweaks
arkpar Mar 24, 2023
b06e356
Fixed a warning
arkpar Mar 24, 2023
c6f2b53
Removed tracing
arkpar Mar 24, 2023
50b583d
Manual expiration
arkpar Mar 24, 2023
e141eb7
Reworked constraint management
arkpar Mar 28, 2023
c5555e9
Updated pallet constraint calculation
arkpar Mar 28, 2023
1171ba0
Added small test
arkpar Mar 28, 2023
399cbbd
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Mar 30, 2023
365e5e8
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Apr 1, 2023
3d571ca
Added remove function to the APIs
arkpar Apr 1, 2023
85a31c9
Copy-paste spec into readme
arkpar Apr 1, 2023
b07775f
Comments
arkpar Apr 1, 2023
659b494
Made the store optional
arkpar Apr 2, 2023
25f3771
Removed network protocol controller
arkpar Apr 2, 2023
27e73cc
fmt
arkpar Apr 3, 2023
39f0145
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Apr 3, 2023
51b16ff
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Apr 3, 2023
0e84775
Clippy fixes
arkpar Apr 3, 2023
312a07e
fmt
arkpar Apr 3, 2023
9c21172
fmt
arkpar Apr 3, 2023
0d95b2e
More clippy fixes
arkpar Apr 3, 2023
61f6e5f
More clippy fixes
arkpar Apr 3, 2023
d93493a
More clippy fixes
arkpar Apr 3, 2023
f06ac25
Update client/statement-store/README.md
arkpar Apr 5, 2023
3c2373d
Apply suggestions from code review
arkpar Apr 5, 2023
a13e2c0
Removed sstore from node-template
arkpar Apr 5, 2023
ac499ab
Sort out data path
arkpar Apr 5, 2023
e562b65
Added offline check
arkpar Apr 5, 2023
06f3376
Removed dispatch_statement
arkpar Apr 5, 2023
167c4ad
Renamed into_generic
arkpar Apr 5, 2023
4c840c0
Fixed commit placement
arkpar Apr 5, 2023
03906c8
Use HashSet for tracking peers/statements
arkpar Apr 5, 2023
f33942c
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Apr 5, 2023
206488d
fmt
arkpar Apr 5, 2023
2625783
Use ExtendedHostFunctions
arkpar Apr 5, 2023
a7f652a
Fixed benches
arkpar Apr 5, 2023
0bf748e
Tweaks
arkpar Apr 5, 2023
8c883a7
Apply suggestions from code review
arkpar Apr 17, 2023
c05e3d7
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Apr 17, 2023
6c15ce9
Fixed priority mixup
arkpar Apr 17, 2023
f383ab6
Rename
arkpar Apr 17, 2023
a978b2a
newtypes for priorities
arkpar Apr 18, 2023
83f343f
Added MAX_TOPICS
arkpar Apr 18, 2023
94b10a7
Fixed key filtering logic
arkpar Apr 18, 2023
1c22fef
Remove empty entrie
arkpar Apr 18, 2023
f08810b
Removed prefix from signing
arkpar Apr 18, 2023
7849cc8
More documentation
arkpar Apr 18, 2023
64ac7f5
fmt
arkpar Apr 18, 2023
f05f5a3
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Apr 19, 2023
21dd020
Moved store setup from sc-service to node
arkpar Apr 19, 2023
d72290c
Handle maintenance task in sc-statement-store
arkpar Apr 19, 2023
16e469e
Use statement iterator
arkpar Apr 19, 2023
8d18b5e
Renamed runtime API mod
arkpar Apr 19, 2023
9d3add2
fmt
arkpar Apr 19, 2023
cd7c9dc
Remove dump_encoded
arkpar Apr 19, 2023
d29ebc7
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Apr 24, 2023
38d893d
fmt
arkpar Apr 24, 2023
fdb43c5
Apply suggestions from code review
arkpar Apr 24, 2023
74e4945
Apply suggestions from code review
arkpar Apr 24, 2023
4f1ac76
Fixed build after applying review suggestions
arkpar Apr 24, 2023
2f2d4f8
License exceptions
arkpar Apr 25, 2023
75ee1bf
fmt
arkpar Apr 25, 2023
b501198
Store options
arkpar Apr 25, 2023
692f58a
Moved pallet consts to config trait
arkpar Apr 25, 2023
704d53a
Removed global priority
arkpar Apr 25, 2023
71b39cf
Validate fields when decoding
arkpar Apr 25, 2023
a798b08
Limit validation channel size
arkpar Apr 25, 2023
7af3b5a
Made a comment into module doc
arkpar Apr 25, 2023
47a8e6b
Removed submit_encoded
arkpar Apr 25, 2023
4fb2aee
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Apr 25, 2023
df2df2a
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar Apr 25, 2023
f81511d
Merge branch 'master' of github.com:paritytech/substrate into a-state…
arkpar May 3, 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
Prev Previous commit
Next Next commit
Made the store optional
  • Loading branch information
arkpar committed Apr 2, 2023
commit 659b494927c0936109b7dd0b22c94995777bd5b7
2 changes: 1 addition & 1 deletion bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub fn new_partial(
keystore_container,
select_chain,
transaction_pool,
statement_store,
statement_store: Some(statement_store),
other: (grandpa_block_import, grandpa_link, telemetry),
})
}
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ pub fn new_partial(
select_chain,
import_queue,
transaction_pool,
statement_store,
statement_store: Some(statement_store),
other: (rpc_extensions_builder, import_setup, rpc_setup, telemetry),
})
}
Expand Down
89 changes: 51 additions & 38 deletions client/service/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ pub struct SpawnTasksParams<'a, TBl: BlockT, TCl, TExPool, TRpc, Backend> {
/// A shared transaction pool.
pub transaction_pool: Arc<TExPool>,
/// Shared statement store.
pub statement_store: Arc<StatementStore>,
pub statement_store: Option<Arc<StatementStore>>,
/// Builds additional [`RpcModule`]s that should be added to the server
pub rpc_builder:
Box<dyn Fn(DenyUnsafe, SubscriptionTaskExecutor) -> Result<RpcModule<TRpc>, Error>>,
Expand Down Expand Up @@ -461,13 +461,15 @@ where

// Perform periodic statement store maintenance
let store = statement_store.clone();
spawn_handle.spawn("statement-store-notifications", Some("statement-store"), async move {
let mut interval = tokio::time::interval(sc_statement_store::MAINTENANCE_PERIOD);
loop {
interval.tick().await;
store.maintain();
}
});
if let Some(store) = store {
spawn_handle.spawn("statement-store-notifications", Some("statement-store"), async move {
let mut interval = tokio::time::interval(sc_statement_store::MAINTENANCE_PERIOD);
loop {
interval.tick().await;
store.maintain();
}
});
}

// Prometheus metrics.
let metrics_service =
Expand Down Expand Up @@ -506,7 +508,7 @@ where
task_manager.spawn_handle(),
client.clone(),
transaction_pool.clone(),
Some(statement_store.clone()),
statement_store.clone(),
keystore.clone(),
system_rpc_tx.clone(),
&config,
Expand Down Expand Up @@ -721,7 +723,7 @@ pub struct BuildNetworkParams<'a, TBl: BlockT, TExPool, TImpQu, TCl> {
/// A shared transaction pool.
pub transaction_pool: Arc<TExPool>,
/// A shared statement store.
pub statement_store: Arc<StatementStore>,
pub statement_store: Option<Arc<StatementStore>>,
/// A handle for spawning tasks.
pub spawn_handle: SpawnTaskHandle,
/// An import queue.
Expand All @@ -740,7 +742,7 @@ pub fn build_network<TBl, TExPool, TImpQu, TCl>(
Arc<NetworkService<TBl, <TBl as BlockT>::Hash>>,
TracingUnboundedSender<sc_rpc::system::Request<TBl>>,
sc_network_transactions::TransactionsHandlerController<<TBl as BlockT>::Hash>,
sc_network_statement::StatementHandlerController,
Option<sc_network_statement::StatementHandlerController>,
NetworkStarter,
Arc<SyncingService<TBl>>,
),
Expand Down Expand Up @@ -919,20 +921,25 @@ where
.insert(0, transactions_handler_proto.set_config());

// crate statment protocol and add it to the list of supported protocols of `network_params`
let statement_handler_proto = sc_network_statement::StatementHandlerPrototype::new(
protocol_id.clone(),
client
.block_hash(0u32.into())
.ok()
.flatten()
.expect("Genesis block exists; qed"),
config.chain_spec.fork_id(),
);
network_params
.network_config
.extra_sets
.insert(0, statement_handler_proto.set_config());

let statement_handler_proto = if statement_store.is_some() {
let statement_handler_proto = sc_network_statement::StatementHandlerPrototype::new(
protocol_id.clone(),
client
.block_hash(0u32.into())
.ok()
.flatten()
.expect("Genesis block exists; qed"),
config.chain_spec.fork_id(),
);
network_params
.network_config
.extra_sets
.insert(0, statement_handler_proto.set_config());
Some(statement_handler_proto)
} else {
None
};
Copy link
Member

Choose a reason for hiding this comment

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

This should be passed in extra_sets. We don't want to change this functionality here anymore because that "forces" people to use these things.

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean? It is inserted in extra_sets. The protocol handler is an Option so it does not force usage.

Copy link
Member

Choose a reason for hiding this comment

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

I mean that this doesn't need to be a depedency in `sc-service. We should get rid off the "include all the things in sc-service". There is no need to have this as an option here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

let has_bootnodes = !network_params.network_config.boot_nodes.is_empty();
let network_mut = sc_network::NetworkWorker::new(network_params)?;
let network = network_mut.service().clone();
Expand All @@ -945,22 +952,28 @@ where
)?;
spawn_handle.spawn("network-transactions-handler", Some("networking"), tx_handler.run());

let statement_protocol_executor = {
let spawn_handle = Clone::clone(&spawn_handle);
Box::new(move |fut| {
spawn_handle.spawn("network-statement-validator", Some("networking"), fut);
})
};
// crate statement gossip protocol and add it to the list of supported protocols of
// `network_params`
let (statement_handler, statement_handler_controller) = statement_handler_proto.build(
network.clone(),
sync_service.clone(),
statement_store.clone(),
config.prometheus_config.as_ref().map(|config| &config.registry),
statement_protocol_executor,
)?;
spawn_handle.spawn("network-statement-handler", Some("networking"), statement_handler.run());
let statement_handler_controller = if let Some(statement_store) = statement_store {
let statement_protocol_executor = {
let spawn_handle = Clone::clone(&spawn_handle);
Box::new(move |fut| {
spawn_handle.spawn("network-statement-validator", Some("networking"), fut);
})
};
let statement_handler_proto = statement_handler_proto.expect("statement_handler_proto is always created when statement_store is `Some`");
let (statement_handler, statement_handler_controller) = statement_handler_proto.build(
network.clone(),
sync_service.clone(),
statement_store.clone(),
config.prometheus_config.as_ref().map(|config| &config.registry),
statement_protocol_executor,
)?;
spawn_handle.spawn("network-statement-handler", Some("networking"), statement_handler.run());
Some(statement_handler_controller)
} else {
None
};

spawn_handle.spawn_blocking(
"chain-sync-network-service-provider",
Expand Down
2 changes: 1 addition & 1 deletion client/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub struct PartialComponents<Client, Backend, SelectChain, ImportQueue, Transact
/// A shared transaction pool.
pub transaction_pool: Arc<TransactionPool>,
/// A shared statement store.
pub statement_store: Arc<StatementStore>,
pub statement_store: Option<Arc<StatementStore>>,
/// Everything else that needs to be passed into the main build function.
pub other: Other,
}
Expand Down