Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Help——A question about sign_block  (Read 211 times)

0 Members and 1 Guest are viewing this topic.

Offline xiaorui.dong

  • Newbie
  • *
  • Posts: 13
    • View Profile
  • BTS: dongxr
  • Witness: dxr
  • Payrate: 100%
Help——A question about sign_block
« on: May 13, 2015, 06:49:44 AM »

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.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12175
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: Help——A question about sign_block
« Reply #1 on: May 13, 2015, 07:13:16 AM »
     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 ¯\_(ツ)_/¯ »
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline xiaorui.dong

  • Newbie
  • *
  • Posts: 13
    • View Profile
  • BTS: dongxr
  • Witness: dxr
  • Payrate: 100%
Re: Help——A question about sign_block
« Reply #2 on: May 14, 2015, 12:55:47 AM »
     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 xiaorui.dong

  • Newbie
  • *
  • Posts: 13
    • View Profile
  • BTS: dongxr
  • Witness: dxr
  • Payrate: 100%
Re: Help——A question about sign_block
« Reply #3 on: May 14, 2015, 01:09:13 AM »
     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?

 

Google+