Browse Source

V4 introduction

PascalCoin 6 years ago
parent
commit
9b5d6a5091
5 changed files with 22 additions and 15 deletions
  1. 10 3
      README.md
  2. 9 8
      src/core/UConst.pas
  3. 0 1
      src/core/UCrypto.pas
  4. 0 2
      src/core/UNetProtocol.pas
  5. 3 1
      src/gui-classic/UFRMWallet.pas

+ 10 - 3
README.md

@@ -35,13 +35,16 @@ Also, consider a donation at PascalCoin development account: "0-10"
 ## History:  
 
 TODO: Bug in Lazarus optimization cause Access Violation on "getpendings" call (must be 0 or 1). techworker/ugo4brain in discord 2018-05-11 #development channel
-### Build XXXXXX - CURRENT
-- Implementation of Hard fork on block XXXXXXX (PENDING... TODO !)
+### Build 4.0.0 - 2018-10-26
+- MANDATORY UPGRADE - HARD FORK ACTIVATION WILL OCCUR ON BLOCK 260000
+  - PIP - 0009: RandomHash
+    - RandomHash is a new hash algo created by Herman Schoenfeld, see https://github.com/PascalCoin/PascalCoin/blob/master/PIP/PIP-0009.md 
   - PIP - 0015: Fast Block Propagation
   - PIP - 0016: Layer-2 protocol support
   - Limit blockchain to allow max only one 0-fee operation by signer per block (prior was limited by network, not by core)
   - New digest hash for signature verifications
   - Added OrderedAccountKeysList that allows an indexed search of public keys in the safebox with mem optimization
+  - Improved net protections
 - JSON-RPC changes:
   - New protection for "open ports" server: When a server has whitelist to ALL IP's access to JSON-RPC calls, all calls that use the wallet keys are protected to avoid hacking
     - Added param "RPC_ALLOWUSEPRIVATEKEYS" on pascalcoin_daemon.ini file
@@ -69,7 +72,11 @@ TODO: Bug in Lazarus optimization cause Access Violation on "getpendings" call (
   - Account Object change:
     - Changed return value of "price". Previously was returned without decimals in native value (inconsistency bug), now will be returned as a PASCURRENCY (with 4 decimals)
 - Bug fixed: DoProcess_GetAccount_Request request type=1 (single account) didn't returned only 1
-
+- Bug fixed: Invalid "lastBlockCache" value when found and orphan block that causes invalid propagation until a new block is found. Fixed.
+- Net protocol upgraded to "8" in order to accept new network p2p calls:
+  - "Fast block propagation" : NetOp 0x0012 for PIP-0015 
+  - "Get blockchain operations": NetOp 0x0013 for PIP-0015
+  - "Get Public key accounts": NetOp 0x0032
 
 ### Build 3.0.1 - 2018-05-07
 - Deprecated use of OpenSSL v1.0 versions. Only allowed OpenSSL v1.1 versions

+ 9 - 8
src/core/UConst.pas

@@ -73,7 +73,7 @@ Const
 
   {$IFDEF ACTIVATE_RANDOMHASH_V4}
   CT_CompactTarget_Reset_v4: Cardinal = // First compact target of block if using Protocol 4 and RandomHash is Active
-    {$IFDEF PRODUCTION}$17000000{$ELSE}$08000000{$ENDIF};
+    {$IFDEF PRODUCTION}$16000000{$ELSE}$08000000{$ENDIF};
   {$ENDIF}
 
 
@@ -109,20 +109,20 @@ Const
   CT_PROTOCOL_2 = 2;
   CT_PROTOCOL_3 = 3;
   CT_PROTOCOL_4 = 4;
-  CT_BUILD_PROTOCOL = CT_PROTOCOL_3;
+  CT_BUILD_PROTOCOL = CT_PROTOCOL_4;
 
   CT_BlockChain_Protocol_Available: Word = 4; // Protocol 4 flag
   CT_Protocol_Upgrade_v2_MinBlock = {$IFDEF PRODUCTION}115000{$ELSE}50{$ENDIF};
   CT_Protocol_Upgrade_v3_MinBlock = {$IFDEF PRODUCTION}210000{$ELSE}250{$ENDIF};
-  CT_Protocol_Upgrade_v4_MinBlock = {$IFDEF PRODUCTION}99999999{$ELSE}400{$ENDIF}; // NOTE: Upgrade to V4 not decided!   TODO!
+  CT_Protocol_Upgrade_v4_MinBlock = {$IFDEF PRODUCTION}260000{$ELSE}400{$ENDIF};
 
 
   CT_MagicNetIdentification = {$IFDEF PRODUCTION}$0A043580{$ELSE}$04000000{$ENDIF}; // Unix timestamp 168048000 ... It's Albert birthdate!
 
-  CT_NetProtocol_Version: Word = $0007; // Version 3.0.2 only allows net protocol 7 (Introduced on 3.0.0)
+  CT_NetProtocol_Version: Word = $0007;
   // IMPORTANT NOTE!!!
   // NetProtocol_Available MUST BE always >= NetProtocol_version
-  CT_NetProtocol_Available: Word = {$IFDEF PRODUCTION}$0007{$ELSE}$0008{$ENDIF};  // Remember, >= NetProtocol_version !!!
+  CT_NetProtocol_Available: Word = {$IFDEF PRODUCTION}$0008{$ELSE}$0008{$ENDIF};  // Version 4.0.0 will start accepting protocol 8
 
   CT_MaxAccountOperationsPerBlockWithoutFee = 1;
 
@@ -173,14 +173,15 @@ Const
   CT_OpSubtype_Data_Signer                = 103;
   CT_OpSubtype_Data_Receiver              = 104;
 
-  CT_ClientAppVersion : AnsiString = {$IFDEF PRODUCTION}'3.0.2'{$ELSE}{$IFDEF TESTNET}'TESTNET 3.0.6'{$ELSE}{$ENDIF}{$ENDIF};
+  CT_ClientAppVersion : AnsiString = {$IFDEF PRODUCTION}'4.0.0'{$ELSE}{$IFDEF TESTNET}'TESTNET 4.0.0'{$ELSE}{$ENDIF}{$ENDIF};
 
-  CT_Discover_IPs = 'bpascal1.dynamic-dns.net;bpascal2.dynamic-dns.net;pascalcoin1.dynamic-dns.net;pascalcoin2.dynamic-dns.net;pascalcoin1.dns1.us;pascalcoin2.dns1.us;pascalcoin1.dns2.us;pascalcoin2.dns2.us'{$IFDEF TESTNET}+';99.254.181.147;159.89.12.242;18.236.158.185'{$ENDIF};
+  CT_Discover_IPs = {$IFDEF PRODUCTION}'bpascal1.dynamic-dns.net;bpascal2.dynamic-dns.net;pascalcoin1.dynamic-dns.net;pascalcoin2.dynamic-dns.net;pascalcoin1.dns1.us;pascalcoin2.dns1.us;pascalcoin1.dns2.us;pascalcoin2.dns2.us'
+                    {$ELSE}'pascaltestnet1.dynamic-dns.net;pascaltestnet2.dynamic-dns.net;pascaltestnet1.dns1.us;pascaltestnet2.dns1.us'{$ENDIF};
 
   CT_TRUE_FALSE : Array[Boolean] Of AnsiString = ('FALSE','TRUE');
 
   CT_MAX_0_fee_operations_per_block_by_miner = {$IFDEF PRODUCTION}2000{$ELSE}{$IFDEF TESTNET}2000{$ELSE}{$ENDIF}{$ENDIF};
-  CT_MAX_Operations_per_block_by_miner =  {$IFDEF PRODUCTION}10000{$ELSE}{$IFDEF TESTNET}50000{$ELSE}{$ENDIF}{$ENDIF};
+  CT_MAX_Operations_per_block_by_miner =  {$IFDEF PRODUCTION}20000{$ELSE}{$IFDEF TESTNET}50000{$ELSE}{$ENDIF}{$ENDIF};
 
   CT_MAX_MultiOperation_Senders = 100;
   CT_MAX_MultiOperation_Receivers = 1000;

+ 0 - 1
src/core/UCrypto.pas

@@ -30,7 +30,6 @@ uses
 Type
   ECryptoException = Class(Exception);
 
-  // TRawBytes = AnsiString; XXXXXXXX Definded at UBaseTypes
   PRawBytes = ^TRawBytes;
 
   TECDSA_SIG = record

+ 0 - 2
src/core/UNetProtocol.pas

@@ -1162,7 +1162,6 @@ begin
   SetLength(FFixedServers,0);
   FMaxRemoteOperationBlock := CT_OperationBlock_NUL;
   FNetStatistics := CT_TNetStatistics_NUL;
-  //FOnConnectivityChanged := TNotifyEventToMany.Create; //xxxxxxxxxxxxxxxxxx HS - removed TNotifyEventMany auto-collected
   FOnStatisticsChanged := Nil;
   FOnNetConnectionsUpdated := Nil;
   FOnNodeServersUpdated := Nil;
@@ -4247,7 +4246,6 @@ begin
     try
       request_id := TNetData.NetData.NewRequestId;
       if (FNetProtocolVersion.protocol_available = CT_NetProtocol_Available)
-        and (pos(CT_ClientAppVersion,FClientAppVersion)>0) // XXXXXXXXXXXX Albert: ONLY FOR TESTING PURPOSE, NOT NEEDED ON PRODUCTION, TODO REMOVE
         then begin
         // Will send a FAST PROPAGATION BLOCK as described at PIP-0015
         netOp := CT_NetOp_NewBlock_Fast_Propagation;

+ 3 - 1
src/gui-classic/UFRMWallet.pas

@@ -915,7 +915,9 @@ end;
 procedure TFRMWallet.InitMenuForTesting;
 var mi : TMenuItem;
 begin
-  miAbout.AddSeparator;
+  mi := TMenuItem.Create(MainMenu);
+  mi.Caption:='-';
+  miAbout.Add(mi);
   mi := TMenuItem.Create(MainMenu);
   mi.Caption:='Create a block';
   mi.OnClick:=Test_CreateABlock;