bnb-chain / go-sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Client.Block() returns nil block ID and invalid block hash

denalimarsh opened this issue · comments

Updating to tendermint v0.33.3 has impacted the client. Blocks queried with client.Block() always have a nil BlockID and an invalid Block.Hash(). Testnet block 79769927's block hash is 4CD0241B2DFD9A3457EC9B0D66B8F24C4AC1D1AF2FD0C41EFDD5F1172C81A04B.

But client.Block(79769927) returns:

{:0:000000000000 Block{
  Header{
    Version:        {10 0}
    ChainID:        Binance-Chain-Nile
    Height:         79769927
    Time:           2020-04-30 00:02:56.674655137 +0000 UTC
    LastBlockID:    E074DE874955E29A5AA189F6E1CFED66DF6ED8CA175A76FE8169E1EC23A3F55D:1:236038624FB3
    LastCommit:     7CED5D60594F057E26FDA29C8450228CB4A3575285A2D6A4704BF6416BB5662A
    Data:           
    Validators:     80D9AB0FC10D18CA0E0832D5F4C063C5489EC1443DFB738252D038A82131B27A
    NextValidators: 80D9AB0FC10D18CA0E0832D5F4C063C5489EC1443DFB738252D038A82131B27A
    App:            AB93795DADCCBCFA328505F77AD2930B7F2484ED7430E8BE9D05726856C203E9
    Consensus:      294D8FBD0B94B767A7EBA9840F299A3586DA7FE6B5DEAD3B7EECBA193C400F93
    Results:        6E340B9CFFB37A989CA544E6BB780A2C78901D3FB33738768511A30617AFA01D
    Evidence:       
    Proposer:       62633D9DB7ED78E951F79913FDC8231AA77EC12B
  }#497ED601A8D9DC5A69039978DEA81BD4230CD5B8B3AE5198BF9C3A78569EA7E4
  Data{
    
  }#
  EvidenceData{
    
  }#
  Commit{
    Height:     0
    Round:      0
    BlockID:    E074DE874955E29A5AA189F6E1CFED66DF6ED8CA175A76FE8169E1EC23A3F55D:1:236038624FB3
    Signatures:
      
  }#
}#497ED601A8D9DC5A69039978DEA81BD4230CD5B8B3AE5198BF9C3A78569EA7E4}

What's missing

  • Block ID is 0:000000000000, should be 4CD0241B2DFD9A3457EC9B0D66B8F24C4AC1D1AF2FD0C41EFDD5F1172C81A04B:1:BE23B3A45B19
  • Commit.Height is 0, should be 79769926
  • Commit.Signatures is empty
  • Block.Hash() is 497ED601A8D9DC5A69039978DEA81BD4230CD5B8B3AE5198BF9C3A78569EA7E4, should be 4CD0241B2DFD9A3457EC9B0D66B8F24C4AC1D1AF2FD0C41EFDD5F1172C81A04B.
commented

thank you for submitting this issue. We have reverted the code that causes this issue in the master branch.

commented

@cbarraford I am sorry that #114 have been reverted, because of this issue, binance-chain is based on tendermint v0.32, while v.0.33 have changed a lot about Block structure to save storage.

ok, thanks for letting me know cc @jackzampolin