1. 13 Apr, 2020 2 commits
    • Tom Zander's avatar
      Replace SigOps with SigChecks · 2aa462f8
      Tom Zander authored
      This is part of the protocol upgrade for 2020-05-15, and in general it
      seems to go the direction of "we did this before, lets do this again".
      
      The spec is clear enough, but there is still a lack of questioning and
      testing. The problem this attempts to fix has been neutered for years[1].
      
      The spec states:
      > The essential idea of SigChecks is to perform counting solely in the
      > spending transaction, and count actual executed signature check
      > operations.
      
      This, however nobel and logical, ignores that the
      check-for-being-too-costly just pulled in a UTXO lookup and the loading
      of the output script from the historical chain.
      The goal that we protect against CPU over-use may be reached, but the
      price is a total system slowdown. You can have multiple CPUs, but the
      bus to permanent storage has one, max 2 parallel pipes.
      
      To ensure theHub stays the number one scalable node, I didn't blindly
      follow the spec, while making sure that the Hub is correctly going to
      follow/reject consensus violations of newly mined blocks.
      
      As a result the implementation in Flowee the Hub:
      
      * does not check sigcheck-counts on historical blocks (more than 1000
        blocks in the past).
      
        This may increase the risk of chain-splits ever so slightly, but the cost
        of disk-IO would be too high.
      
      * No longer stores the value in the mempool, nor uses it for the
        CPU-miner.
      
      * Ties the sigcheck-limits to the user-set block-size-accept-limit.
      
        This is contrary to the spec which mistakenly thinks that BCH has a
        max block-size in the consensus rules. The effect is the same, though.
      
      * The per-intput standardness suggestion is not implemented because
        standardness checks don't currently fetch the previous outputs and
        that would be too expensive to add.
      
      * Standardness rules for the whole transaction are moved to the
        mempool-acceptance logic instead. The cost would be too great
        otherwise, similar to the previous point.
        Again, the effect is the same as likely intented.
      
      ---
      1) since the intro of the CachingTransactionSignatureChecker
      2aa462f8
    • Tom Zander's avatar
      Inline CScriptCheck · 0386f38c
      Tom Zander authored
      It was only called twice, and in very close proximity. The class didn't
      add anything.
      This improves readability and with the new state its easier to write
      too.
      0386f38c
  2. 12 Apr, 2020 1 commit
    • Tom Zander's avatar
      Refactor ScriptEval/ScriptVerify calls · e101591f
      Tom Zander authored
      Feeling cute, may update this API later.
      
      namespace Script {
      struct State {
          State() = default;
          State(uint32_t flags) : flags(flags) {}
          uint32_t flags = SCRIPT_VERIFY_NONE; // validation flags
          ScriptError error = SCRIPT_ERR_OK;
      
          const char* errorString() const;
      };
      
      bool eval(std::vector<std::vector<unsigned char> > &stack, const CScript
          &script, const BaseSignatureChecker checker, Script::State &state);
      bool verify(const CScript& scriptSig, const CScript& scriptPubKey, const
          BaseSignatureChecker& checker, Script::State &state);
      bool checkTransactionSignatureEncoding(const std::vector<unsigned char>
          &vchSig, State &state);
      }
      
      More of the same.
      e101591f
  3. 11 Apr, 2020 1 commit
  4. 27 Feb, 2020 1 commit
    • Tom Zander's avatar
      Move nStatus of blockindex into the UTXO · 489a9a48
      Tom Zander authored
      To allow the UTXO to actually use the power of checkpoints we need to
      make sure that the block-validation state is not stored separately from
      it.
      The goal is that when we have some curruption we can just go back to an
      earlier state of the UTXO and re-validate the blocks to get to the
      current tip. The often seen problem is that corruption will instead
      leave the block-index (leveldb) with an incorrect state so the replay
      fails.
      
      This change solves that by no longer reading the block-validation-state
      and no longer writing it on a state change.
      489a9a48
  5. 13 Nov, 2019 1 commit
    • Tom Zander's avatar
      Refactor: move files · 175096b2
      Tom Zander authored
      Move some files back to the server "library".
      Merge the 'console' lib with server, as it doesn't really make sense with
      just one file and nobody exclusively linking to it.
      
      The server "libary" is not really a library, its the place we put all
      the files shared by hub-qt hub-cli and hub.
      We no longer depend on these files from other places (mostly due to
      moving to the new logging framework) and as such we can move the files
      back.
      175096b2
  6. 14 Oct, 2019 1 commit
  7. 27 May, 2019 1 commit
  8. 22 Apr, 2019 2 commits
    • Tom Zander's avatar
      Remove obsolete code. · a7f9b9fe
      Tom Zander authored
      Remove txIndex option, its move to Flowee Indexer
      
      Also remove the GUI option for setting the amount
      of "script validator threads". :D
      
      Remove DBCash command line option too, equally obsolete.
      a7f9b9fe
    • Tom Zander's avatar
      Cleanup; block-pruning · d20dd6d7
      Tom Zander authored
      This has been commented out code for some time and its probably best to
      remove dead code so as to avoid it rotting.
      d20dd6d7
  9. 10 Apr, 2019 1 commit
  10. 30 Dec, 2018 1 commit
    • Tom Zander's avatar
      Remove dead code · 898cb1fc
      Tom Zander authored
      As the miners have started using the block-version bits for their
      own purposes this means that BIP9 checks are rather irrelevant.
      Signalling using version bits is rather silly anyway.
      
      In Flowee there will no longer be warnings generated based on
      these now outdated assumptions.
      And this means less code :)
      898cb1fc
  11. 05 Oct, 2018 1 commit
    • Tom Zander's avatar
      Simplify · a2928b91
      Tom Zander authored
      On all mature operating systems and filesystems creation of a 1GB file
      will not actually use that data, only when we start using blocks does
      the disk space get used.
      As such this is a premature optimization that Core added and I ported to
      Flowee which this commit removes.
      
      Additionally, increase the block file size to 1GiB
      a2928b91
  12. 17 Aug, 2018 1 commit
  13. 23 Jul, 2018 1 commit
    • Tom Zander's avatar
      Updates to and start using the UnspentOutputDB · 1600086e
      Tom Zander authored
      The new UnspentOutputDatabase classes are only very loosly a database, we
      purely register and store unspent outputs there. But unline a DB we don't
      allow modification (just insert and delete).
      
      This replaces the coin-db (which was based on leveldb) and as first goal
      this gives us a higher level of stability. The level-database was known
      to give corruption issues.
      
      Notice that users will need to do a manual reindex on first update.
      1600086e
  14. 16 Feb, 2018 1 commit
    • Tom Zander's avatar
      Cleanup ValidationInterface · 33fe0fcc
      Tom Zander authored
      Get rid of the weird boost signals setup
      Move it to a new library 'interfaces' which is
      for stuff that has no dependencies and can avoid
      creating inter-library or cicular dependencies.
      33fe0fcc
  15. 13 Feb, 2018 1 commit
  16. 12 Feb, 2018 1 commit
    • Tom Zander's avatar
      Refactor default settings for modularity · df642d37
      Tom Zander authored
      Make all configurable options have their default in one place to avoid
      one file (allowed_args) to link to all parts of the app which totally
      breaks modularity
      df642d37
  17. 30 Jan, 2018 1 commit
  18. 19 Jan, 2018 2 commits
  19. 09 Nov, 2017 1 commit
  20. 04 Sep, 2017 1 commit
    • Tom Zander's avatar
      Add writing of FastBlock · d20e686c
      Tom Zander authored
      this introduces the Blocks::DB::writeBlock() method
      which appends the block to the last known file.
      
      We keep the features that files are enlarged in chunks (at least on non-
      win32 platforms) and we only open the last file in read/write mode so
      sysadmins can move old files to a read-only filesystem.
      d20e686c
  21. 30 Aug, 2017 1 commit
  22. 18 Aug, 2017 1 commit
  23. 03 May, 2017 2 commits
  24. 09 Mar, 2017 2 commits
  25. 18 Feb, 2017 3 commits
  26. 09 Feb, 2017 1 commit
    • Tom Zander's avatar
      Make startup faster. · d196ae08
      Tom Zander authored
      It doesn't really make sense to check your historical blocks, if anyone
      wanted to change data, they'd change the utxo, not the blocks we never
      use again...
      d196ae08
  27. 19 Jan, 2017 1 commit
  28. 21 Nov, 2016 1 commit
    • Tom Zander's avatar
      Implement block-size market based equilibrium. · 5c132f0a
      Tom Zander authored
      This removes BIP109, 2MB blocksize proposal.
      In its pace I insert the concept of market equilibrium based blocksizing.
      Technically this means;
      
      * We remove from the consensus rules the max-block-size.
      * We introduce a command-line-argument that defines the max-block-size it
        will accept from other nodes.
      
      Classic chose to use -blocksizeacceptlimit as a descriptive name, but for
      compatibility with BU has an alias for its -excessiveblocksize.
      Values are in whole megabytes, but floating point values are accepted with
      an accuracy up to 100KB.  So, you can have "3.5" as blocksizeacceptlimit.
      This value will be put in the coinbase-comment as "EB3.5" in this example.
      
      In short;
      Miners can continue to use the -blockmaxsize argument or bitcoin.conf
      setting to limit the size of blocks they generate!  All nodes can also use
      the `-blocksizeacceptlimit` option to limit the size of the blocks accepted
      from (other) miners.
      5c132f0a
  29. 07 Nov, 2016 1 commit
  30. 19 Sep, 2016 1 commit
  31. 16 Sep, 2016 1 commit
    • BtcDrak's avatar
      Remove p2p alert handling · a76a1b53
      BtcDrak authored
      Remove -alerts option
      Remove alert keys
      protocol.h/cpp: Removes NetMsgType::ALERT
      a76a1b53
  32. 16 Jun, 2016 2 commits