aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
5.89k stars 3.56k forks source link

[Bug] failed to get BCS block with rust rest sdk #13613

Open crazybits opened 3 weeks ago

crazybits commented 3 weeks ago

🐛 Bug

call get_block_by_height_bcs with below error

Err(Bcs(Custom("invalid value: integer 115, expected variant index 0 <= i < 5")))

To reproduce

Code snippet to reproduce

use aptos_sdk::rest_client::Client;

let result = client.get_block_by_height_bcs(*block_num, true).await;

info!("new block {:?}",result);

Stack trace/error message

> Err(Bcs(Custom("invalid value: integer `115`, expected variant index 0 <= i < 5")))

Expected Behavior

get block successfully

System information

Please complete the following information:

Additional context

the api work fine before, the error prompt in these two days, it may due to the aptos upgrade

crazybits commented 3 weeks ago

issue solved after fallback rust sdk to tag aptos-node-v1.12.0, confirmed the issue is due to aptos upgrade