Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shard Overflow #46

Open
DimFirsov opened this issue Mar 7, 2024 · 1 comment
Open

Shard Overflow #46

DimFirsov opened this issue Mar 7, 2024 · 1 comment

Comments

@DimFirsov
Copy link

There is an integer overflow happens with shard

this code

    let client = TonClient::builder().build().await?;
    let (_, info) = client.get_masterchain_info().await?;
    println!("MasterchainInfo: {:?}", &info);
    let block_id = BlockId {
        workchain: info.last.workchain,
        shard: info.last.shard,
        seqno: info.last.seqno,
    };
    let block_id_ext = client.lookup_block(1, &block_id, 0, 0).await?;
    println!("BlockIdExt: {:?}", &block_id_ext);

outputs negative shard equals to std::i64::MIN
BlockIdExt: BlockIdExt { workchain: -1, shard: -9223372036854775808, seqno: 36549398, root_hash: "5vLN0mXB4r8n0ZpAjOUp4drqskiMSylfPMPJit03Pvc=", file_hash: "iCqgL7fq8jPxsP8XToP2UYd5AsD8PXRObdMUzeTMbHs=" }

@Sild
Copy link
Collaborator

Sild commented Mar 28, 2024

Hi @DimFirsov

As long as masterchain doesn't support sharding, it doesn't make any sense to look into Masterchain.Block.Shard field

As you can see, this method always return Block.Shard std::i64::MIN: https://getblock.io/docs/ton/json-rpc/ton_getmasterchaininfo/

I assume it's some default value hardcoded in ton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants