From 7171b3a3ac0064659d2cccb859d078de8493c714 Mon Sep 17 00:00:00 2001 From: segfaultdoctor Date: Fri, 14 Jan 2022 21:53:34 -0500 Subject: [PATCH] Bugfix/block subscribe (#22516) * use correct operation name * require enable_rpc_transaction_history flag when enabling block_subscription Co-authored-by: Zano --- client/src/pubsub_client.rs | 2 +- multinode-demo/bootstrap-validator.sh | 3 +++ validator/src/main.rs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/pubsub_client.rs b/client/src/pubsub_client.rs index 5a6abd2850dd4c..edb742e4d78119 100644 --- a/client/src/pubsub_client.rs +++ b/client/src/pubsub_client.rs @@ -305,7 +305,7 @@ impl PubsubClient { let result = PubsubClientSubscription { message_type: PhantomData, - operation: "blocks", + operation: "block", socket, subscription_id, t_cleanup: Some(t_cleanup), diff --git a/multinode-demo/bootstrap-validator.sh b/multinode-demo/bootstrap-validator.sh index 6625bc1f5b0dbd..e7fdd0e3ae6c37 100755 --- a/multinode-demo/bootstrap-validator.sh +++ b/multinode-demo/bootstrap-validator.sh @@ -49,6 +49,9 @@ while [[ -n $1 ]]; do elif [[ $1 = --enable-rpc-transaction-history ]]; then args+=("$1") shift + elif [[ $1 = --rpc-pubsub-enable-block-subscription ]]; then + args+=("$1") + shift elif [[ $1 = --enable-cpi-and-log-storage ]]; then args+=("$1") shift diff --git a/validator/src/main.rs b/validator/src/main.rs index d2da166d702320..3e2220da6e4591 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -1206,6 +1206,7 @@ pub fn main() { .arg( Arg::with_name("rpc_pubsub_enable_block_subscription") .long("rpc-pubsub-enable-block-subscription") + .requires("enable_rpc_transaction_history") .takes_value(false) .help("Enable the unstable RPC PubSub `blockSubscribe` subscription"), )