Forum Home
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    [Dev] Feathercoin 0.9.6.2 * Maintenance fix, build & upgrade issues notes.

    Technical Development
    8
    153
    74793
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wrapper
      wrapper Moderators last edited by

      main.h

       static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
        /** Default for -maxorphanblocks, maximum number of orphan blocks kept in memory */
       -static const unsigned int DEFAULT_MAX_ORPHAN_BLOCKS = 750;
      
       +static const unsigned int DEFAULT_MAX_ORPHAN_BLOCKS = 7500;
      
        /** The maximum size of a blk?????.dat file (since 0.8) */
      

      Increased Max orphans default to 7500.

      Wellenreiter 1 Reply Last reply Reply Quote 0
      • Wellenreiter
        Wellenreiter Moderators @wrapper last edited by

        @wrapper

        too high. I’d try 1500.

        There is a reason to limit the max number of orphan blocks

        Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
        Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

        wrapper 1 Reply Last reply Reply Quote 0
        • wrapper
          wrapper Moderators @Wellenreiter last edited by wrapper

          @Wellenreiter said in [Dev] Feathercoin 0.9.6.2 * Maintenance fix, build & upgrade issues notes.:

          @wrapper

          too high. I’d try 1500.

          There is a reason to limit the max number of orphan blocks

          I’ve tested it at 10,000 and that is (7500) what Dogecoin raised it to. There is no point it being lower, it was set too low.

          Wellenreiter 1 Reply Last reply Reply Quote 0
          • Wellenreiter
            Wellenreiter Moderators @wrapper last edited by Wellenreiter

            @wrapper it’s a security measure against (D)DOS attacks to the BC, so it will work even when set to 10000000, but may stall the BC, if someone injects a high number of orphans. I’m not sure how many orphans an attacker could create, but…

            Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
            Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

            1 Reply Last reply Reply Quote 0
            • wrapper
              wrapper Moderators last edited by

              From the sync tests, we know there are already > 6000 ORHAN BLOCKS chains in the Blockchain already…

              1 Reply Last reply Reply Quote 0
              • wrapper
                wrapper Moderators last edited by wrapper

                https://github.com/FeatherCoin/Feathercoin/pull/216

                Debug.log io review - Resultant fixes / improvements:

                A large number of debug messages were only useful in development and have been commented out.

                A further large number of messages only indicate information in an error condition and have will now only write out if -debug is set.

                A small number of error messages are alerted during sync, because they are on an orphan chain, that is correct (to have the error). Further errors may need investigating so they were changed to write on -debug.

                Because the max ORPHAN BLOCKS in a chain exceeds the current temporary memory pool during sync, this caused stalling whilst the memory was reloaded. The memory can be increased with a switch -maxorphanblocks=10000 - This has been increased from 750 to 7500, as per Dogecoin fix, is being tested for sufficiency / memory issues.

                A number of LogPrintf() messages were reviewed and considered useful error messages to write to Debug.log that may help support in unusual circumstances. These were left unchainged.

                UTF-8 translations were backported from 0.11.2

                The Feathercoin client is now starting and stopping without creating a debug.log. When Debug is initiated the information is more succinct and relevant. The synchronization time is very significantly improved.

                1 Reply Last reply Reply Quote 0
                • wrapper
                  wrapper Moderators last edited by wrapper

                  Remaining Messages no Debug:

                  2017-08-13 13:48:40 partner xxx.xxx.xxx.xxx:9336 using obsolete version 60002; disconnecting
                  2017-08-13 13:48:40 ProcessMessage(version, 102 bytes) FAILED
                  2017-08-13 14:00:00 ERROR: CAlert::CheckSignature() : verify signature failed
                  2017-08-13 14:00:51 ERROR: CheckBlockHeader() : block with timestamp before last checkpoint
                  2017-08-13 14:00:51 ERROR: ProcessBlock() : CheckBlock FAILED
                  2017-08-13 14:00:51 ERROR: CheckBlockHeader() : block with timestamp before last checkpoint
                  2017-08-13 14:00:51 ERROR: ProcessBlock() : CheckBlock FAILED

                  Large block same message then :

                  2017-08-13 14:08:52 socket recv error Connection reset by peer (104)

                  ~Block 1145437

                  src/main.cpp - Line 2835
                  2017-08-13 14:00:51 ERROR: CheckBlockHeader() : block with timestamp before last checkpoint

                       if (deltaTime < 0)
                         {
                             return state.DoS(100, error("CheckBlockHeader() : block with timestamp before last checkpoint"),
                           REJECT_CHECKPOINT, "time-too-old");
                  

                  These are old rejected blocks, I assume, so not required on sync.

                  main.cpp - Updated code

                       {
                           if (fDebug)
                                LogPrintf("CheckBlockHeader() : block with timestamp before last checkpoint");
                           return state.DoS(100, NULL,
                                            REJECT_CHECKPOINT, "time-too-old");
                       }
                  

                  Code added

                  main.cpp Line 3199

                  if (!CheckBlock(*pblock, state, INT_MAX)) 
                  	  return error("ProcessBlock() : CheckBlock FAILED");
                  

                  Updated to :

                  if (!CheckBlock(*pblock, state, INT_MAX)) 
                            if (fDebug)
                                LogPrintf("ProcessBlock() : CheckBlock FAILED");
                  	  return true ;
                  

                  netbase.cpp

                  Update with Bitcoin bug fix to correct (104) error

                  https://github.com/bitcoin/bitcoin/issues/4552
                  https://github.com/bitcoin/bitcoin/commit/109849e204f91d8b04b0e57da87e45b461096b50

                  1 Reply Last reply Reply Quote 0
                  • wrapper
                    wrapper Moderators last edited by wrapper

                    Full sync from scratch Test, 0.9.6.2 in progress

                    So far : 2.5 years in 13 hours : 5 hrs P/Day. - estimate 20 hrs full sync time (~4pm).

                    Remaining Debug messages :

                    2017-08-13 18:12:10 socket recv error Connection reset by peer (104)
                    2017-08-13 18:25:03 socket recv error Connection timed out (110)

                    Recommendation :

                    The Debug.log testing has shown that a number of operation, which were envisioned as errors initially, have occurred in the blockchain. This has meant that certain settings, loop levels or error messages are repeated during re-syncronisation of the blockchain.

                    Where’as 0.11.2 version already contain some speed ups that effect Bitcoin, (secp256k1) the FTC block sync is considerably reduced, but at ~22 hrs (estimate), would still seem long.

                    ToDo.

                    Set up a script and chron job to pole feathercoin during a resync and write Blocknumber every minute. This will 1200 data points to identify any problem block chains. These may indicate further settings that can be tweaked.

                     feathercoind getinfo >> StallTest.txt
                    

                    Preliminary test show synchronization is running pretty consistently at :

                    BlocksPerHour
                    39750
                    BlocksPerMinute
                    662

                    Full sync took 29 Hours, with no special settings and 4 outputs to debug, about lost connections…

                    BlockSycTest

                    Get Block count was often delayed

                    BlockSycTest

                    Blocks per minute

                    BlockSycTest

                    Testable

                    -dbcache to a value around 4000

                    8 connections limitation

                    Give Higher CPU Priority to Bitcoin-Qt Process
                    The above approach of blockchain import should be faster than syncing the whole blockchain block by block. Give the process higher CPU priority might further help speeding up the blockchain import especially you have more CPU cycle at your disposal. If you’re using Mac OS X, and assuming the Process ID (PID) of Bitcoin-Qt is 2202, use the following command to give Bitcoin-Qt process hight CPU priority:

                    sudo renice -20 -p 2202
                    

                    *-20 is the nice value a value between -20 and +19. The lower the nice value, the higher priority the process gets.

                    1 Reply Last reply Reply Quote 0
                    • wrapper
                      wrapper Moderators last edited by wrapper

                      Results of Sync Speed Tests

                      Found very interesting Result from Sync speed Tests :::::

                      The sync speed dropped from ~710 Blocks per minute to ~670 Blocks per minute

                      After the synchronsiation passed the Hard Fork for : One minute Blocks, Neoscrypt and eHRC additional calculations.

                      This is actually impressive as we are processing 2.5 times the amount of blocks and re-targeting every block! It indicates that Neoscrypt is efficient. Thanks @Ghostlander.

                      Although it might also be effected by other factors, such as the increasing number of transactions, it mean that it would be worthwhile to do the Neoscrypt update :

                      https://github.com/ghostlander/Phoenixcoin/commit/ddbdbf6cbff4ca52f87268f28c60d588bf843344

                      I suggest we test that in 0.9.6.2 as the best version / (none alpha) we have at the moment.

                      1 Reply Last reply Reply Quote 0
                      • wrapper
                        wrapper Moderators last edited by

                        Results of dbcache test

                        Comparison shows a slight improvement with dbcache set to 3000, particularly as glitch in initial test associated with dropout, or network effect.

                        It may be worth while to increase default to 1000 from 300, minor downside of disk space / memory.

                        dbcache set to 3000

                        1 Reply Last reply Reply Quote 0
                        • wrapper
                          wrapper Moderators last edited by wrapper

                          Test changing max outbound connections

                          Test upping default from lowly 8 to more reasonable 30

                          net.cpp

                          static const int MAX_OUTBOUND_CONNECTIONS = 30;

                          1st test : slower only maintained 3 connections.

                          Up from 125 to 200:
                          int nMaxConnections = 200;

                          Wellenreiter 1 Reply Last reply Reply Quote 0
                          • Wellenreiter
                            Wellenreiter Moderators @wrapper last edited by wrapper

                            @wrapper

                            It takes some time to build up more connections, I usually have 8 connections and after one or more hours it goes up to 10-12.
                            The explorer hosts maintain given or taken ~ 100 peers after some days being online

                            Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                            Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                            1 Reply Last reply Reply Quote 1
                            • wrapper
                              wrapper Moderators last edited by wrapper

                              LTC also recommends 1000MB max dbcache. Testing increase min from 4 to 10.

                              src/txdb.h

                               // -dbcache default (MiB)
                              static const int64_t nDefaultDbCache = 100;
                              // max. -dbcache in (MiB)
                              static const int64_t nMaxDbCache = sizeof(void*) > 4 ? 4096 : 1024;
                               // min. -dbcache in (MiB)
                              static const int64_t nMinDbCache = 4;
                              
                              1 Reply Last reply Reply Quote 0
                              • wrapper
                                wrapper Moderators last edited by wrapper

                                stealth.cpp - 0.9.6.2

                                std::string CStealthAddress::Encoded() const
                                {
                                // https://wiki.unsystem.net/index.php/DarkWallet/Stealth#Address_format
                                // [version] [options] [scan_key] [N] ... [Nsigs] [prefix_length] ...
                                
                                data_chunk raw;
                                raw.push_back(stealth_version_byte);
                                
                                raw.push_back(options);
                                
                                raw.insert(raw.end(), scan_pubkey.begin(), scan_pubkey.end());
                                raw.push_back(1); // number of spend pubkeys
                                raw.insert(raw.end(), spend_pubkey.begin(), spend_pubkey.end());
                                raw.push_back(0); // number of signatures
                                raw.push_back(0); // ?
                                
                                AppendChecksum(raw);
                                
                                return EncodeBase58(raw);
                                };
                                

                                In this shadow coding why is raw.push_back(0); // ? called twice?

                                Wellenreiter 1 Reply Last reply Reply Quote 0
                                • wrapper
                                  wrapper Moderators last edited by wrapper

                                  [FAQ] How does the stealth keys work

                                  stealth.cpp

                                  int StealthSecret(ec_secret& secret, ec_point& pubkey, const ec_point& pkSpend, ec_secret& sharedSOut, ec_point& pkOut)
                                  {
                                      /* 
                                  send:
                                      secret = ephem_secret, pubkey = scan_pubkey
                                  
                                  receive:
                                      secret = scan_secret, pubkey = ephem_pubkey
                                      c = H(dP)
                                  
                                  Q = public scan key (EC point, 33 bytes)
                                  d = private scan key (integer, 32 bytes)
                                  R = public spend key
                                  f = private spend key
                                  
                                  Q = dG  // Single use private key
                                  R = fG
                                  
                                  Sender (has Q and R, not d or f):
                                  
                                  P = eG
                                  
                                  c = H(eQ) = H(dP)
                                  R' = R + cG
                                      
                                  Recipient gets R' and P
                                  test 0 and infinity?
                                  */
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • Wellenreiter
                                    Wellenreiter Moderators @wrapper last edited by

                                    @wrapper said in [Dev] Feathercoin 0.9.6.2 * Maintenance fix, build & upgrade issues notes.:

                                    In this shadow coding why is raw.push_back(0); // ? called twice?

                                    Raw is an array like data structure and you add two items to the array

                                    Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                                    Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                                    1 Reply Last reply Reply Quote 1
                                    • wrapper
                                      wrapper Moderators last edited by wrapper

                                      [FAQ] How do I create a file of the Feathercoin blockchain that I can import into other wallets?

                                      You can concatenate the FTC blocks into a bootstrap.dat file. This bootstrap.dat file can be copied into the .feathercoin or blockchain directory of the new wallet.

                                      When it starts the new wallet will recognize the bootstrap.dat and import the blockchain from disk, but will do all the normal synchronization validation checks in the process. Do not restart as it will rename the bootstrap.dat and proceed online.

                                      You can lelete the bootsrap.dat after the sync.

                                      Find your local blockchain:

                                      cd ~/.feathercoin/blocks
                                      

                                      Concatenate all your blkxxxxx.dat files and place the result in bootstrap.dat:

                                      cat blk* > bootstrap.dat
                                      

                                      In Windows :

                                      COPY /b blk0001.dat+blk0002.dat bootstrap.dat
                                      
                                      1 Reply Last reply Reply Quote 1
                                      • wrapper
                                        wrapper Moderators last edited by wrapper

                                        Sync speed test 0.9.6.2-dev using Bootstrap.dat

                                        Interesting points to note :

                                        Change over to Neoscrypt starts at 2:30 hrs or Hard Fork 4 - Block 432000

                                        Blocks processed against time

                                        0.9.6.1 sync speed test

                                        Block Rate per minute against blocks

                                        0.9.6.1 sync speed test

                                        1 Reply Last reply Reply Quote 0
                                        • wrapper
                                          wrapper Moderators last edited by

                                          Review if 0.9.x series Bitcoin Commits

                                          0.9.6.3.x

                                          1. Don’t poll showmyip.com, it doesn’t exist anymore

                                          Fixes #4679.

                                          This leaves us with only one candidate, checkip.dyndns.org.
                                          GetMyExternalIP should be phased out as soon as possible.

                                          https://github.com/bitcoin/bitcoin/commit/5332b0a429f42c49c4b70e71870f2202c0cfa844

                                          1 Reply Last reply Reply Quote 0
                                          • wrapper
                                            wrapper Moderators last edited by wrapper

                                            Testing @Bushstar fixes / regtest

                                            Console message :
                                            SSE2 unsupported, optimisations disabled

                                            init.cpp ~L480

                                            opt_flags = cpu_vec_exts();
                                                if(GetBoolArg("-sse2", true)) {
                                                    /* Verify hardware SSE2 support */
                                                    if(opt_flags & 0x00000020) {
                                                        printf("SSE2 optimisations enabled\n");
                                                        nNeoScryptOptions |= 0x1000;
                                                    } else {
                                                        printf("SSE2 unsupported, optimisations disabled\n");
                                                    }
                                                } else {
                                                    printf("SSE2 optimisations disabled\n");
                                                }
                                            

                                            Notes

                                            SSE2 stands for Streaming SIMD Extensions 2 which is a standard on processors for a long time. This will enhance the security of your hardware against malicious software attacks by viruses and other malware.

                                            These three are actually a hard core requirement for Windows 8 installation. If anyone of them is missing, Windows 8 will not install on your computer. So this has to be taken care even before you buy a new license of Windows 8.

                                            https://stackoverflow.com/questions/2403660/determine-processor-support-for-sse2

                                            Call CPUID with eax = 1 to load the feature flags in to edx. Bit 26 is set if SSE2 is available.

                                            https://gist.github.com/hi2p-perim/7855506

                                            I’ve output the value of opt_flags
                                            opt_flags : = 0 SSE2 optimisations disabled

                                            Putting -sse2=false or true seemed to work , so -sse2 is true

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post