<commit_before>(* Copyright (c) 2015-2016 The Qeditas developers *)
(* Distributed under the MIT software license, see the accompanying
   file COPYING or http://www.opensource.org/licenses/mit-license.php. *)

open Ser
open Sha256
open Hash
open Db
open Big_int
open Mathdata
open Assets
open Signat
open Cryptocurr
open Tx
open Ctre
open Ctregraft

(*** 256 bits ***)
type stakemod = int64 * int64 * int64 * int64

let genesiscurrentstakemod : stakemod ref = ref (0L,0L,0L,0L)
let genesisfuturestakemod : stakemod ref = ref (0L,0L,0L,0L)

let set_genesis_stakemods x =
  let (x4,x3,x2,x1,x0) = hexstring_hashval x in
  sha256init();
  currblock.(0) <- x4;
  currblock.(1) <- x3;
  currblock.(2) <- x2;
  currblock.(3) <- x1;
  currblock.(4) <- x0;
  currblock.(5) <- 0x80000000l;
  for i = 6 to 14 do
    currblock.(i) <- 0l;
  done;
  currblock.(15) <- 160l;
  sha256round();
  let (y0,y1,y2,y3,y4,y5,y6,y7) = getcurrmd256() in
  sha256init();
  currblock.(0) <- y0;
  currblock.(1) <- y1;
  currblock.(2) <- y2;
  currblock.(3) <- y3;
  currblock.(4) <- y4;
  currblock.(5) <- y5;
  currblock.(6) <- y6;
  currblock.(7) <- y7;
  currblock.(8) <- 0x80000000l;
  for i = 9 to 14 do
    currblock.(i) <- 0l;
  done;
  currblock.(15) <- 256l;
  sha256round();
  let (z0,z1,z2,z3,z4,z5,z6,z7) = getcurrmd256() in
  let c a b =
    Int64.logor
      (Int64.shift_left (Int64.of_int32 (Int32.logand (Int32.shift_right_logical a 16) 0xffl)) 48)
      (Int64.logor
	 (Int64.shift_left (Int64.of_int32 (Int32.logand a 0xffl)) 32)
	 (Int64.logor
	    (Int64.shift_left (Int64.of_int32 (Int32.logand (Int32.shift_right_logical b 16) 0xffl)) 16)
	    (Int64.of_int32 (Int32.logand b 0xffl))))
  in
  genesiscurrentstakemod := (c y0 y1,c y2 y3,c y4 y5,c y6 y7);
  genesisfuturestakemod := (c z0 z1,c z2 z3,c z4 z5,c z6 z7);;
  
(*** Here the last 20 bytes (40 hex chars) of the block hash for a particular bitcoin block should be included.
 sha256 is used to extract 512 bits to set the genesis current and future stake modifiers.
 ***)
set_genesis_stakemods "0000000000000000000000000000000000000000"

(*** max target/min difficulty: 2^220 (for mainnet) ***)
let max_target = ref (shift_left_big_int unit_big_int 220)
let genesistarget = ref (shift_left_big_int unit_big_int 205) (* current estimate for initial difficulty *)
let genesisledgerroot : hashval ref = ref (hexstring_hashval "a47da9044687cc40e368fbd60f404ad5b4ddd4cf");; (*** snapshot ledger root ***)

(*** base reward of 50 fraenks (5 trillion cants) like bitcoin, but assume the first 350000 blocks have passed. ***)
let basereward = 5000000000000L<commit_msg>updated the root of the initial ledger<commit_after>(* Copyright (c) 2015-2016 The Qeditas developers *)
(* Distributed under the MIT software license, see the accompanying
   file COPYING or http://www.opensource.org/licenses/mit-license.php. *)

open Ser
open Sha256
open Hash
open Db
open Big_int
open Mathdata
open Assets
open Signat
open Cryptocurr
open Tx
open Ctre
open Ctregraft

(*** 256 bits ***)
type stakemod = int64 * int64 * int64 * int64

let genesiscurrentstakemod : stakemod ref = ref (0L,0L,0L,0L)
let genesisfuturestakemod : stakemod ref = ref (0L,0L,0L,0L)

let set_genesis_stakemods x =
  let (x4,x3,x2,x1,x0) = hexstring_hashval x in
  sha256init();
  currblock.(0) <- x4;
  currblock.(1) <- x3;
  currblock.(2) <- x2;
  currblock.(3) <- x1;
  currblock.(4) <- x0;
  currblock.(5) <- 0x80000000l;
  for i = 6 to 14 do
    currblock.(i) <- 0l;
  done;
  currblock.(15) <- 160l;
  sha256round();
  let (y0,y1,y2,y3,y4,y5,y6,y7) = getcurrmd256() in
  sha256init();
  currblock.(0) <- y0;
  currblock.(1) <- y1;
  currblock.(2) <- y2;
  currblock.(3) <- y3;
  currblock.(4) <- y4;
  currblock.(5) <- y5;
  currblock.(6) <- y6;
  currblock.(7) <- y7;
  currblock.(8) <- 0x80000000l;
  for i = 9 to 14 do
    currblock.(i) <- 0l;
  done;
  currblock.(15) <- 256l;
  sha256round();
  let (z0,z1,z2,z3,z4,z5,z6,z7) = getcurrmd256() in
  let c a b =
    Int64.logor
      (Int64.shift_left (Int64.of_int32 (Int32.logand (Int32.shift_right_logical a 16) 0xffl)) 48)
      (Int64.logor
	 (Int64.shift_left (Int64.of_int32 (Int32.logand a 0xffl)) 32)
	 (Int64.logor
	    (Int64.shift_left (Int64.of_int32 (Int32.logand (Int32.shift_right_logical b 16) 0xffl)) 16)
	    (Int64.of_int32 (Int32.logand b 0xffl))))
  in
  genesiscurrentstakemod := (c y0 y1,c y2 y3,c y4 y5,c y6 y7);
  genesisfuturestakemod := (c z0 z1,c z2 z3,c z4 z5,c z6 z7);;
  
(*** Here the last 20 bytes (40 hex chars) of the block hash for a particular bitcoin block should be included.
 sha256 is used to extract 512 bits to set the genesis current and future stake modifiers.
 ***)
set_genesis_stakemods "0000000000000000000000000000000000000000"

(*** max target/min difficulty: 2^220 (for mainnet) ***)
let max_target = ref (shift_left_big_int unit_big_int 220)
let genesistarget = ref (shift_left_big_int unit_big_int 205) (* current estimate for initial difficulty *)
let genesisledgerroot : hashval ref = ref (hexstring_hashval "66c029f4c29b351785c0480cedc9449b64332dfa");; (*** snapshot ledger root ***)

(*** base reward of 50 fraenks (5 trillion cants) like bitcoin, but assume the first 350000 blocks have passed. ***)
let basereward = 5000000000000L
{'fraction_non_alphanumeric': 0.13049267643142476, 'fraction_numerical': 0.11774776488491535, 'mean_word_length': 4.012392755004766, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 8, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2676213', 'n_tokens_mistral': 2511, 'n_tokens_neox': 2083, 'n_words': 569}