Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Claim and enrollment TX verification fixes #696

Merged
merged 10 commits into from
Feb 27, 2020
Merged

Commits on Feb 21, 2020

  1. core: add validator public key into the list of hashes to verify

    That should be done for Enrollment transactions.
    roman-khimov committed Feb 21, 2020
    Configuration menu
    Copy the full SHA
    d5e6028 View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2020

  1. transaction: strip off a layer of redirection from ClaimTX.Claims

    We don't need a pointer here and this change makes this field compatible with
    Transaction.Inputs which is useful in many scenarios.
    roman-khimov committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    5c96815 View commit details
    Browse the repository at this point in the history
  2. core: put unspents get/put one loop above in storeBlock

    Everywhere in this code prevHash == input.PrevHash, thus we can easily move
    some common code out of the loop saving on DB accesses and
    serialization/deserialization.
    roman-khimov committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    36c6b6a View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2020

  1. core: move spent coin management out of the inner storeBlock loop

    prevHash == input.PrevHash, so make less DB accesses and more real work. Fix
    some bugs along the way:
     * spentCoins structure may already be present in the DB when persisting TX,
       there is nothing wrong with that and we shouldn't overwrite it
     * it's only used for NEO and only to check for claim validity. Thus, when
       processing claim tx the corresponding spentCoins should always be present
       in the DB
    roman-khimov committed Feb 25, 2020
    Configuration menu
    Copy the full SHA
    c258adb View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2020

  1. transaction: unbind GroupInputsByPrevHash from Transaction

    Which allows to use it for ClaimTX. Make it also a bit more efficient as maps
    are expensive.
    roman-khimov committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    80de208 View commit details
    Browse the repository at this point in the history
  2. core/transaction: use new transaction.InOut for References

    We don't need a map here, use simpler structures.
    roman-khimov committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    9f70185 View commit details
    Browse the repository at this point in the history
  3. core: drop GetScriptHashesForVerifyingClaim, fix Claim's ScriptHash g…

    …etter
    
    Claim transactions should _add_ claims scripthashes to the standard list, not
    replace them. And this code is actually very reusable.
    roman-khimov committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    9b1ad40 View commit details
    Browse the repository at this point in the history
  4. core: add duplicate Claim verification check

    Refactor HaveInputsDuplicate() out of the core and Blockchain, it doesn't
    depend on the Blockchain state. Make it more efficient.
    roman-khimov committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    29586f2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7bea6e0 View commit details
    Browse the repository at this point in the history
  6. core: fix NetworkFee calculation

    Add doesn't change the variable state. Thanks to GolangCI for catching this.
    roman-khimov committed Feb 27, 2020
    Configuration menu
    Copy the full SHA
    00d199e View commit details
    Browse the repository at this point in the history