Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 5feb2d1

Browse files
committed
Merge remote-tracking branch 'origin' into polkadot-alliance-review
2 parents 7c063c8 + f2d5ece commit 5feb2d1

File tree

116 files changed

+3752
-2685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+3752
-2685
lines changed

.github/workflows/check-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
check-labels:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
with:
1313
fetch-depth: 0
1414
ref: ${{ github.event.pull_request.head.ref }}

.github/workflows/md-link-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
markdown-link-check:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
16-
- uses: gaurav-nelson/github-action-markdown-link-check@7481451f70251762f149d69596e3e276ebf2b236
15+
- uses: actions/checkout@v3
16+
- uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976 # v1.0.13
1717
with:
1818
use-quiet-mode: 'yes'
1919
config-file: '.github/workflows/mlc_config.json'

.github/workflows/monthly-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
echo "::set-output name=new::$(date +'monthly-%Y-%m')"
1717
echo "::set-output name=old::$(date -d'1 month ago' +'monthly-%Y-%m')"
1818
- name: Checkout branch "master"
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020
with:
2121
ref: 'master'
2222
fetch-depth: 0

.github/workflows/pr-custom-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ jobs:
3737
if: github.event.pull_request.draft == true
3838
run: exit 1
3939
- name: pr-custom-review
40-
uses: paritytech/pr-custom-review@v2
40+
uses: paritytech/pr-custom-review@action-v3
4141
with:
42-
token: ${{ secrets.PRCR_TOKEN }}
42+
checks-reviews-api: http://pcr.parity-prod.parity.io/api/v1/check_reviews

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/node-template/node/src/rpc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ where
3939
C::Api: BlockBuilder<Block>,
4040
P: TransactionPool + 'static,
4141
{
42-
use pallet_transaction_payment_rpc::{TransactionPaymentApiServer, TransactionPaymentRpc};
43-
use substrate_frame_rpc_system::{SystemApiServer, SystemRpc};
42+
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
43+
use substrate_frame_rpc_system::{System, SystemApiServer};
4444

4545
let mut module = RpcModule::new(());
4646
let FullDeps { client, pool, deny_unsafe } = deps;
4747

48-
module.merge(SystemRpc::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
49-
module.merge(TransactionPaymentRpc::new(client).into_rpc())?;
48+
module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
49+
module.merge(TransactionPayment::new(client).into_rpc())?;
5050

5151
// Extend this RPC with a custom API by using the following syntax.
5252
// `YourRpcStruct` should have a reference to a client, which is needed

bin/node/rpc/src/lib.rs

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ use jsonrpsee::RpcModule;
3737
use node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Index};
3838
use sc_client_api::AuxStore;
3939
use sc_consensus_babe::{Config, Epoch};
40-
use sc_consensus_babe_rpc::BabeRpc;
4140
use sc_consensus_epochs::SharedEpochChanges;
4241
use sc_finality_grandpa::{
4342
FinalityProofProvider, GrandpaJustificationStream, SharedAuthoritySet, SharedVoterState,
4443
};
45-
use sc_finality_grandpa_rpc::GrandpaRpc;
4644
use sc_rpc::SubscriptionTaskExecutor;
4745
pub use sc_rpc_api::DenyUnsafe;
4846
use sc_transaction_pool_api::TransactionPool;
@@ -120,15 +118,15 @@ where
120118
B: sc_client_api::Backend<Block> + Send + Sync + 'static,
121119
B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,
122120
{
123-
use pallet_contracts_rpc::{ContractsApiServer, ContractsRpc};
124-
use pallet_mmr_rpc::{MmrApiServer, MmrRpc};
125-
use pallet_transaction_payment_rpc::{TransactionPaymentApiServer, TransactionPaymentRpc};
126-
use sc_consensus_babe_rpc::BabeApiServer;
127-
use sc_finality_grandpa_rpc::GrandpaApiServer;
121+
use pallet_contracts_rpc::{Contracts, ContractsApiServer};
122+
use pallet_mmr_rpc::{Mmr, MmrApiServer};
123+
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
124+
use sc_consensus_babe_rpc::{Babe, BabeApiServer};
125+
use sc_finality_grandpa_rpc::{Grandpa, GrandpaApiServer};
128126
use sc_rpc::dev::{Dev, DevApiServer};
129-
use sc_sync_state_rpc::{SyncStateRpc, SyncStateRpcApiServer};
130-
use substrate_frame_rpc_system::{SystemApiServer, SystemRpc};
131-
use substrate_state_trie_migration_rpc::StateMigrationApiServer;
127+
use sc_sync_state_rpc::{SyncState, SyncStateApiServer};
128+
use substrate_frame_rpc_system::{System, SystemApiServer};
129+
use substrate_state_trie_migration_rpc::{StateMigration, StateMigrationApiServer};
132130

133131
let mut io = RpcModule::new(());
134132
let FullDeps { client, pool, select_chain, chain_spec, deny_unsafe, babe, grandpa } = deps;
@@ -142,15 +140,15 @@ where
142140
finality_provider,
143141
} = grandpa;
144142

145-
io.merge(SystemRpc::new(client.clone(), pool, deny_unsafe).into_rpc())?;
143+
io.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
146144
// Making synchronous calls in light client freezes the browser currently,
147145
// more context: https://github.com/paritytech/substrate/pull/3480
148146
// These RPCs should use an asynchronous caller instead.
149-
io.merge(ContractsRpc::new(client.clone()).into_rpc())?;
150-
io.merge(MmrRpc::new(client.clone()).into_rpc())?;
151-
io.merge(TransactionPaymentRpc::new(client.clone()).into_rpc())?;
147+
io.merge(Contracts::new(client.clone()).into_rpc())?;
148+
io.merge(Mmr::new(client.clone()).into_rpc())?;
149+
io.merge(TransactionPayment::new(client.clone()).into_rpc())?;
152150
io.merge(
153-
BabeRpc::new(
151+
Babe::new(
154152
client.clone(),
155153
shared_epoch_changes.clone(),
156154
keystore,
@@ -161,7 +159,7 @@ where
161159
.into_rpc(),
162160
)?;
163161
io.merge(
164-
GrandpaRpc::new(
162+
Grandpa::new(
165163
subscription_executor,
166164
shared_authority_set.clone(),
167165
shared_voter_state,
@@ -172,14 +170,11 @@ where
172170
)?;
173171

174172
io.merge(
175-
SyncStateRpc::new(chain_spec, client.clone(), shared_authority_set, shared_epoch_changes)?
173+
SyncState::new(chain_spec, client.clone(), shared_authority_set, shared_epoch_changes)?
176174
.into_rpc(),
177175
)?;
178176

179-
io.merge(
180-
substrate_state_trie_migration_rpc::MigrationRpc::new(client.clone(), backend, deny_unsafe)
181-
.into_rpc(),
182-
)?;
177+
io.merge(StateMigration::new(client.clone(), backend, deny_unsafe).into_rpc())?;
183178
io.merge(Dev::new(client, deny_unsafe).into_rpc())?;
184179

185180
Ok(io)

client/allocator/src/freeing_bump.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ impl Link {
216216
/// | 0 | next element link |
217217
/// +--------------+-------------------+
218218
/// ```
219-
///
220219
/// ## Occupied header
221220
/// ```ignore
222221
/// 64 32 0

client/beefy/rpc/src/lib.rs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ pub trait BeefyApi<Notification, Hash> {
100100
}
101101

102102
/// Implements the BeefyApi RPC trait for interacting with BEEFY.
103-
pub struct BeefyRpcHandler<Block: BlockT> {
103+
pub struct Beefy<Block: BlockT> {
104104
signed_commitment_stream: BeefySignedCommitmentStream<Block>,
105105
beefy_best_block: Arc<RwLock<Option<Block::Hash>>>,
106106
executor: SubscriptionTaskExecutor,
107107
}
108108

109-
impl<Block> BeefyRpcHandler<Block>
109+
impl<Block> Beefy<Block>
110110
where
111111
Block: BlockT,
112112
{
113-
/// Creates a new BeefyRpcHandler instance.
113+
/// Creates a new Beefy Rpc handler instance.
114114
pub fn new(
115115
signed_commitment_stream: BeefySignedCommitmentStream<Block>,
116116
best_block_stream: BeefyBestBlockStream<Block>,
@@ -131,8 +131,7 @@ where
131131
}
132132

133133
#[async_trait]
134-
impl<Block> BeefyApiServer<notification::EncodedSignedCommitment, Block::Hash>
135-
for BeefyRpcHandler<Block>
134+
impl<Block> BeefyApiServer<notification::EncodedSignedCommitment, Block::Hash> for Beefy<Block>
136135
where
137136
Block: BlockT,
138137
{
@@ -174,24 +173,20 @@ mod tests {
174173
use sp_runtime::traits::{BlakeTwo256, Hash};
175174
use substrate_test_runtime_client::runtime::Block;
176175

177-
fn setup_io_handler() -> (RpcModule<BeefyRpcHandler<Block>>, BeefySignedCommitmentSender<Block>)
178-
{
176+
fn setup_io_handler() -> (RpcModule<Beefy<Block>>, BeefySignedCommitmentSender<Block>) {
179177
let (_, stream) = BeefyBestBlockStream::<Block>::channel();
180178
setup_io_handler_with_best_block_stream(stream)
181179
}
182180

183181
fn setup_io_handler_with_best_block_stream(
184182
best_block_stream: BeefyBestBlockStream<Block>,
185-
) -> (RpcModule<BeefyRpcHandler<Block>>, BeefySignedCommitmentSender<Block>) {
183+
) -> (RpcModule<Beefy<Block>>, BeefySignedCommitmentSender<Block>) {
186184
let (commitment_sender, commitment_stream) =
187185
BeefySignedCommitmentStream::<Block>::channel();
188186

189-
let handler = BeefyRpcHandler::new(
190-
commitment_stream,
191-
best_block_stream,
192-
sc_rpc::testing::test_executor(),
193-
)
194-
.expect("Setting up the BEEFY RPC handler works");
187+
let handler =
188+
Beefy::new(commitment_stream, best_block_stream, sc_rpc::testing::test_executor())
189+
.expect("Setting up the BEEFY RPC handler works");
195190

196191
(handler.into_rpc(), commitment_sender)
197192
}

client/cli/src/commands/run_cmd.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ pub struct RunCmd {
115115
#[clap(long)]
116116
pub rpc_max_response_size: Option<usize>,
117117

118+
/// Set the the maximum concurrent subscriptions per connection.
119+
/// Default is 1024.
120+
#[clap(long)]
121+
pub rpc_max_subscriptions_per_connection: Option<usize>,
122+
118123
/// Expose Prometheus exporter on all interfaces.
119124
///
120125
/// Default is local.
@@ -459,6 +464,18 @@ impl CliConfiguration for RunCmd {
459464
Ok(self.rpc_max_payload)
460465
}
461466

467+
fn rpc_max_request_size(&self) -> Result<Option<usize>> {
468+
Ok(self.rpc_max_request_size)
469+
}
470+
471+
fn rpc_max_response_size(&self) -> Result<Option<usize>> {
472+
Ok(self.rpc_max_response_size)
473+
}
474+
475+
fn rpc_max_subscriptions_per_connection(&self) -> Result<Option<usize>> {
476+
Ok(self.rpc_max_subscriptions_per_connection)
477+
}
478+
462479
fn ws_max_out_buffer_capacity(&self) -> Result<Option<usize>> {
463480
Ok(self.ws_max_out_buffer_capacity)
464481
}

0 commit comments

Comments
 (0)