File tree 2 files changed +29
-8
lines changed 2 files changed +29
-8
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,21 @@ pub struct BlockLimitingProposer<P> {
35
35
transaction_pool : Arc < sc_transaction_pool:: FullPool < Block , ParachainClient > > ,
36
36
}
37
37
38
+ impl < P > BlockLimitingProposer < P > {
39
+ /// Create a new block-limiting proposer.
40
+ pub fn new (
41
+ inner : P ,
42
+ para_id : ParaId ,
43
+ transaction_pool : Arc < sc_transaction_pool:: FullPool < Block , ParachainClient > > ,
44
+ ) -> Self {
45
+ BlockLimitingProposer {
46
+ inner,
47
+ para_id,
48
+ transaction_pool,
49
+ }
50
+ }
51
+ }
52
+
38
53
#[ async_trait:: async_trait]
39
54
impl < P : ProposerInterface < Block > + Send > ProposerInterface < Block > for BlockLimitingProposer < P > {
40
55
async fn propose (
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ use sc_transaction_pool_api::OffchainTransactionPoolFactory;
30
30
use sp_keystore:: KeystorePtr ;
31
31
use substrate_prometheus_endpoint:: Registry ;
32
32
33
+ use crate :: proposer:: BlockLimitingProposer ;
34
+
33
35
// This is fine, even for the Kusama and Polkadot parachains.
34
36
//
35
37
// Runtime API invocations are one of the dumbest things in Substrate:
@@ -389,15 +391,19 @@ fn start_consensus(
389
391
390
392
let slot_duration = cumulus_client_consensus_aura:: slot_duration ( & * client) ?;
391
393
392
- let proposer_factory = sc_basic_authorship:: ProposerFactory :: with_proof_recording (
393
- task_manager. spawn_handle ( ) ,
394
- client. clone ( ) ,
395
- transaction_pool,
396
- prometheus_registry,
397
- telemetry. clone ( ) ,
398
- ) ;
394
+ let proposer = {
395
+ let proposer_factory = sc_basic_authorship:: ProposerFactory :: with_proof_recording (
396
+ task_manager. spawn_handle ( ) ,
397
+ client. clone ( ) ,
398
+ transaction_pool. clone ( ) ,
399
+ prometheus_registry,
400
+ telemetry. clone ( ) ,
401
+ ) ;
399
402
400
- let proposer = Proposer :: new ( proposer_factory) ;
403
+ let proposer = Proposer :: new ( proposer_factory) ;
404
+
405
+ BlockLimitingProposer :: new ( proposer, para_id, transaction_pool)
406
+ } ;
401
407
402
408
let collator_service = CollatorService :: new (
403
409
client. clone ( ) ,
You can’t perform that action at this time.
0 commit comments