Bitcoin Forum
November 09, 2024, 09:02:50 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to work out 'checkpoint of stake modifiers'?  (Read 2103 times)
mammix2 (OP)
Legendary
*
Offline Offline

Activity: 1302
Merit: 1004



View Profile
April 24, 2014, 05:31:10 PM
 #1

Hi All

Im deving for other coins at the moment, can someone tell me how to work out the 'checkpoint of stake modifier' values within kernel.cpp ?

This is for one of those oh so popular PoS coins at the moment  Wink


Code:
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
    boost::assign::map_list_of
            (     0, 0xfd11f4e7u )
;


1HfpFYxBUpQ941mKd4DEjsyA22HN4Kerzu
mammix2 (OP)
Legendary
*
Offline Offline

Activity: 1302
Merit: 1004



View Profile
April 25, 2014, 08:46:44 AM
 #2

Bump.

Anyone?

1HfpFYxBUpQ941mKd4DEjsyA22HN4Kerzu
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
April 25, 2014, 10:30:56 AM
 #3


I don't know that much about PoS but here's what Sunny King had to say:

CheckStakeModifierCheckpoints() is just used to make sure the stake modifier computation is deterministic and every node computes to the same value. It's only checked with a few blocks, like the hard checkpoint that bitcoin uses.

It's not actually part of the protocol itself. The reason it was there is because of the complexity of modifier computation there could be bugs that made it non-deterministic. I put it there just so if someone runs into it then I would know a bug exists with the modifier computation.

Peercoin currently has 3 checkpoints added after genesis. I guess you can add them whenever you feel like it,
in connection with client updates for instance.

“God does not play dice"
mammix2 (OP)
Legendary
*
Offline Offline

Activity: 1302
Merit: 1004



View Profile
April 28, 2014, 12:42:07 PM
 #4


I don't know that much about PoS but here's what Sunny King had to say:

CheckStakeModifierCheckpoints() is just used to make sure the stake modifier computation is deterministic and every node computes to the same value. It's only checked with a few blocks, like the hard checkpoint that bitcoin uses.

It's not actually part of the protocol itself. The reason it was there is because of the complexity of modifier computation there could be bugs that made it non-deterministic. I put it there just so if someone runs into it then I would know a bug exists with the modifier computation.

Peercoin currently has 3 checkpoints added after genesis. I guess you can add them whenever you feel like it,
in connection with client updates for instance.

Thanks for the reply, i'll check it out Smiley

1HfpFYxBUpQ941mKd4DEjsyA22HN4Kerzu
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
April 28, 2014, 06:08:03 PM
 #5

Thanks for the reply, i'll check it out Smiley

To clarify a little, you don't actually need those as they are extra security precaution.

Still it might be a good idea to add one for the genesis block at least.

When you've got your genesis, run getblock on it. Copy the modifierchecksum field, insert into code and recompile.

“God does not play dice"
bwmedia
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
April 28, 2014, 06:52:45 PM
 #6

Interesting info Smiley
Skyripper
Jr. Member
*
Offline Offline

Activity: 51
Merit: 1


View Profile
October 31, 2016, 08:15:41 PM
 #7

Hi All

Im deving for other coins at the moment, can someone tell me how to work out the 'checkpoint of stake modifier' values within kernel.cpp ?

This is for one of those oh so popular PoS coins at the moment  Wink


Code:
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
    boost::assign::map_list_of
            (     0, 0xfd11f4e7u )
;


Bump! I am interested how to get a Stake Modifier Checksum for the Genesis Block? I got this error:

Code:
ERROR: AddToBlockIndex() : Rejected by stake modifier checkpoint height=0, modifier=0x0000000000000000
ERROR: LoadBlockIndex() : genesis block not accepted
mammix2 (OP)
Legendary
*
Offline Offline

Activity: 1302
Merit: 1004



View Profile
November 02, 2016, 12:06:06 AM
 #8

Hi All

Im deving for other coins at the moment, can someone tell me how to work out the 'checkpoint of stake modifier' values within kernel.cpp ?

This is for one of those oh so popular PoS coins at the moment  Wink


Code:
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
    boost::assign::map_list_of
            (     0, 0xfd11f4e7u )
;


Bump! I am interested how to get a Stake Modifier Checksum for the Genesis Block? I got this error:

Code:
ERROR: AddToBlockIndex() : Rejected by stake modifier checkpoint height=0, modifier=0x0000000000000000
ERROR: LoadBlockIndex() : genesis block not accepted

You need to comment out this check while creating the genesis block

example..
https://github.com/mammix2/boostcoin-core/blob/master/src/main.cpp#L2074-L2075

Then uncomment it once you're up and running

1HfpFYxBUpQ941mKd4DEjsyA22HN4Kerzu
Skyripper
Jr. Member
*
Offline Offline

Activity: 51
Merit: 1


View Profile
November 02, 2016, 10:23:07 PM
 #9

You need to comment out this check while creating the genesis block

example..
https://github.com/mammix2/boostcoin-core/blob/master/src/main.cpp#L2074-L2075

Then uncomment it once you're up and running

Thank you very much, it helped me a lot.
leonid_coin
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
September 17, 2018, 05:37:19 AM
 #10

Hi All

Im deving for other coins at the moment, can someone tell me how to work out the 'checkpoint of stake modifier' values within kernel.cpp ?

This is for one of those oh so popular PoS coins at the moment  Wink


Code:
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
    boost::assign::map_list_of
            (     0, 0xfd11f4e7u )
;


Bump! I am interested how to get a Stake Modifier Checksum for the Genesis Block? I got this error:

Code:
ERROR: AddToBlockIndex() : Rejected by stake modifier checkpoint height=0, modifier=0x0000000000000000
ERROR: LoadBlockIndex() : genesis block not accepted

You need to comment out this check while creating the genesis block

example..
https://github.com/mammix2/boostcoin-core/blob/master/src/main.cpp#L2074-L2075

Then uncomment it once you're up and running

would you share your dependencies at C:/tools/* ??
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!