Author Topic: Help——A question about sign_block  (Read 1611 times)

0 Members and 1 Guest are viewing this topic.

Offline xiaorui.dong

  • Newbie
  • *
  • Posts: 13
    • View Profile
  • BitShares: dongxr
     FC_ASSERT( fc::ripemd160::hash( header.previous_secret ) == *prev_secret_hash );
   Why the header.previous_secret should Equal the prev_secret_hash?

Actually it states that the HASH of the secret published in the previous block should equal the "previous secret hash".
This is for the random number generation in BitShares .. The delegates publish a HASH(secret) and reveal
the secret in the block they sign next. Thus you get verifiable secret hashes on the blockchain from the delegates

Quote
   And what situation can cause the exception of FC_ASSERT( fc::ripemd160::hash( header.previous_secret ) == *prev_secret_hash )?
Where do you see this exception? On a delegate machine or a client? In what context?

On a delegate machine

I build 10 test node(client with delegate account).Then 5 delegate (last created block number is 6,5,4,3 and 2) cannot build new block.I think they are in a same block chain.But I don't know why the delegate have this exception.If another client with other block chain connect it, does it affect these delegate?

Offline xiaorui.dong

  • Newbie
  • *
  • Posts: 13
    • View Profile
  • BitShares: dongxr
     FC_ASSERT( fc::ripemd160::hash( header.previous_secret ) == *prev_secret_hash );
   Why the header.previous_secret should Equal the prev_secret_hash?

Actually it states that the HASH of the secret published in the previous block should equal the "previous secret hash".
This is for the random number generation in BitShares .. The delegates publish a HASH(secret) and reveal
the secret in the block they sign next. Thus you get verifiable secret hashes on the blockchain from the delegates

Quote
   And what situation can cause the exception of FC_ASSERT( fc::ripemd160::hash( header.previous_secret ) == *prev_secret_hash )?
Where do you see this exception? On a delegate machine or a client? In what context?

On a delegate machine

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
     FC_ASSERT( fc::ripemd160::hash( header.previous_secret ) == *prev_secret_hash );
   Why the header.previous_secret should Equal the prev_secret_hash?

Actually it states that the HASH of the secret published in the previous block should equal the "previous secret hash".
This is for the random number generation in BitShares .. The delegates publish a HASH(secret) and reveal
the secret in the block they sign next. Thus you get verifiable secret hashes on the blockchain from the delegates

Quote
   And what situation can cause the exception of FC_ASSERT( fc::ripemd160::hash( header.previous_secret ) == *prev_secret_hash )?
Where do you see this exception? On a delegate machine or a client? In what context?
« Last Edit: May 13, 2015, 07:24:53 am by xeroc ¯\_(ツ)_/¯ »

Offline xiaorui.dong

  • Newbie
  • *
  • Posts: 13
    • View Profile
  • BitShares: dongxr
Dear all,
    I don't understand the source code in function "void wallet::sign_block( signed_block_header& header )":
     FC_ASSERT( fc::ripemd160::hash( header.previous_secret ) == *prev_secret_hash );
   Why the header.previous_secret should Equal the prev_secret_hash?
   And what situation can cause the exception of FC_ASSERT( fc::ripemd160::hash( header.previous_secret ) == *prev_secret_hash )?

Thanks verymuch.