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

Improved scheme for Conflicts attribute storing and pricing #2913

Merged
merged 15 commits into from
Nov 8, 2023

Commits on Sep 18, 2023

  1. Ledger: change conflict records storage scheme

    This commit is a part of neo-project#2907: it implements conflict records storage scheme discribed
    in neo-project#2907 (comment).
    
    The short scheme description:
    
    Do not store the list of conflicting signers in the Ledger's conflict record value.
    Instead, put each conflicting signer in the conflict record key so that the
    reculting key is: {Prefix_Transaction, <conflict hash>, <signer>}, and the value
    is {<block index>}.
    
    As an optimisation, for each conflict record store the dummy stub where the
    key is {Prefix_Transaction, <conflict hash>} and the value is {<block index>}. This optimisation
    allows to reduce DB read requests during newly-pooled transaction verification for
    those transactions that do not have any on-chained conflicts.
    
    Also, IsTraceableBlock check is added for on-chain conflicts verification. It is
    needed to avoid situations when untraceable on-chained conflict affects the
    newly-pooled transaction verification.
    
    Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
    AnnaShaleva committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    d6d3d47 View commit details
    Browse the repository at this point in the history
  2. UT_MemoryPool: remove unused test

    Malicious_OnChain_Conflict was constructed incorrectly (see the comment in the end of
    the test) and was replaced by the proper TestMaliciousOnChainConflict test in
    UT_Blockchain.cs way back ago in
    neo-project@0c06c91.
    
    Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
    AnnaShaleva committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    002e7bf View commit details
    Browse the repository at this point in the history
  3. Policy: introduce fee for Conflicts attribute

    This commit implements Conflicts attribute policy described in
    neo-project#2907 (comment).
    
    Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
    AnnaShaleva committed Sep 18, 2023
    Configuration menu
    Copy the full SHA
    cba97f1 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2023

  1. Configuration menu
    Copy the full SHA
    ffa7e8d View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. Merge branch 'master' of https://github.com/neo-project/neo into fix-…

    …conflicts
    
    Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
    AnnaShaleva committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    fff3129 View commit details
    Browse the repository at this point in the history
  2. *: remove remnants of ConflictsFee in native Policy

    ConflictsFee logic was replaced by the generic attribute fee mechanism
    implemented in neo-project#2916.
    
    Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
    AnnaShaleva committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    330cbea View commit details
    Browse the repository at this point in the history
  3. Native: do not remove malicious conflict records during OnPersist

    It's OK to keep them and save O(n) operations during OnPersist. The
    storage taken by these malicious conflict records is properly paid
    anyway. See the discussion under neo-project#2913 (comment).
    
    Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
    AnnaShaleva committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    024a82a View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2023

  1. Configuration menu
    Copy the full SHA
    51a51a1 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2023

  1. Configuration menu
    Copy the full SHA
    be19957 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2023

  1. Configuration menu
    Copy the full SHA
    25b7d1b View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2023

  1. Configuration menu
    Copy the full SHA
    2350393 View commit details
    Browse the repository at this point in the history
  2. Properly rewrite previously added malicious conflict if it's in the s…

    …torage
    
    `engine.Snapshot.Add` doesn't allow to rewrite storage entity if it's already exist.
    Thus, we firstly need to remove it and afterwards to add the updated entity.
    
    Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
    AnnaShaleva committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    c6105c0 View commit details
    Browse the repository at this point in the history
  3. Throw proper exception if TestMaliciousOnChainConflict fails

    Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
    AnnaShaleva committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    32d1341 View commit details
    Browse the repository at this point in the history
  4. Optimize conflicts records storing

    Use Snapshot.GetAndChange instead of subsequent calls to Delete and Add.
    Ref. neo-project#2913 (comment).
    
    Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
    AnnaShaleva committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    9845609 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2023

  1. Configuration menu
    Copy the full SHA
    fc455f4 View commit details
    Browse the repository at this point in the history