Client.get_consensus_status error after rust-sdk and testnet node upgrade

Hi,

I’ve just upgraded my testnet node to the latest release and also "git pull"ed rust-sdk codebase for my client code. When I run basic code below to get consensus, I’m getting a json parse error. I can connect to the node and even get to show the block via concordium-client tool so connection is not an issue so it is just the parsing part of the raw response in the endpoint.rs code. Can you please help?

code:

let consensus_info = client.get_consensus_status().await?;
println!("{:?}", consensus_info);

error:

Error: Error parsing JSON result: 5 at line 1 column 1187

If it helps in debug, I printed the raw response by changing the endpoint.rs code in rust-sdk and below is the output that is incorrectly parsed:

Response { metadata: MetadataMap { headers: {“content-type”: “application/grpc”, “date”: “Tue, 22 Nov 2022 17:52:05 GMT”, “grpc-status”: “0”} }, message: JsonResponse { value: “{“bestBlock”:“44a088017df213bb36eba33831863b6cc86303eb6d4a19bd485f7ebaf97926d7”,“genesisBlock”:“4221332d34e1694168c2a0c0b3fd0f273809612cb13d000d5c2e00e85f50f796”,“genesisTime”:“2022-06-13T10:00:00Z”,“slotDuration”:250,“epochDuration”:3600000,“lastFinalizedBlock”:“44a088017df213bb36eba33831863b6cc86303eb6d4a19bd485f7ebaf97926d7”,“bestBlockHeight”:1388111,“lastFinalizedBlockHeight”:1388111,“blocksReceivedCount”:233,“blockLastReceivedTime”:“2022-11-22T17:52:03.403636885Z”,“blockReceiveLatencyEMA”:0.18602051436582898,“blockReceiveLatencyEMSD”:3.904443908163786e-2,“blockReceivePeriodEMA”:7.170320340051365,“blockReceivePeriodEMSD”:8.269568351853147,“blocksVerifiedCount”:233,“blockLastArrivedTime”:“2022-11-22T17:52:03.412895301Z”,“blockArriveLatencyEMA”:0.1955062553575589,“blockArriveLatencyEMSD”:3.910424762799442e-2,“blockArrivePeriodEMA”:7.1702950817193205,“blockArrivePeriodEMSD”:8.26952004462737,“transactionsPerBlockEMA”:4.997995805289294e-6,“transactionsPerBlockEMSD”:2.2356141942041865e-3,“finalizationCount”:207,“lastFinalizedTime”:“2022-11-22T17:52:03.998404971Z”,“finalizationPeriodEMA”:8.197342237884703,“finalizationPeriodEMSD”:8.898667544055028,“protocolVersion”:5,“genesisIndex”:2,“currentEraGenesisBlock”:“7687b54a59fa29d40c69278a01ddd33a40a8fdd6775a3a01343b3576205db1e1”,“currentEraGenesisTime”:“2022-11-22T11:05:19.5Z”}” }, extensions: Extensions }

That error looks like it cannot parse protocol 5. Are you sure you are using the latest rust-sdk?

At least from this tag Release concordium-rust-sdk 2.0.0 · Concordium/concordium-rust-sdk · GitHub

And have you updated git submodules

git submodule update --recursive

I have tested it against a testnet node and I have no problems.

1 Like

Thanks @abizjak. My bad. I did update (recursive) but didn’t realise that I’m using an old tag of the submodule. All good now. Thanks!

1 Like