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

Add KIP-10 Transaction Introspection Opcodes, 8-byte arithmetic and Hard Fork Support #487

Merged
merged 99 commits into from
Nov 12, 2024

Commits on Jun 16, 2024

  1. implement new opcodes

    biryukovmaxim committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    0e6e748 View commit details
    Browse the repository at this point in the history
  2. example of mutual tx

    biryukovmaxim committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    2076757 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    50fd953 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7afb955 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    993e91e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a0be8af View commit details
    Browse the repository at this point in the history
  7. implement new opcodes

    biryukovmaxim committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    f1eed92 View commit details
    Browse the repository at this point in the history
  8. example of mutual tx

    biryukovmaxim committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    7b02bb2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a679525 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2e61b44 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f7a3f77 View commit details
    Browse the repository at this point in the history
  12. remove unused feature

    biryukovmaxim committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    4afb1dc View commit details
    Browse the repository at this point in the history
  13. fmt

    biryukovmaxim committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    cd5c169 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    96cfd54 View commit details
    Browse the repository at this point in the history
  15. feature gate test

    biryukovmaxim committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    399fcd7 View commit details
    Browse the repository at this point in the history
  16. change test set based on feature

    add ci cd test
    biryukovmaxim committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    8cff7fe View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    c882d32 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    1c19ae1 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    4147473 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    c32c34b View commit details
    Browse the repository at this point in the history
  21. suppress clippy lint

    biryukovmaxim committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    915b5d3 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2024

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

Commits on Sep 28, 2024

  1. Merge branch 'master' into kip-10-mutual-tx

    # Conflicts:
    #	consensus/src/processes/transaction_validator/transaction_validator_populated.rs
    #	crypto/txscript/Cargo.toml
    biryukovmaxim committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    3c4e029 View commit details
    Browse the repository at this point in the history
  2. fix clippy

    biryukovmaxim committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    8b4d0be View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2024

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

Commits on Oct 15, 2024

  1. Configuration menu
    Copy the full SHA
    c86881f View commit details
    Browse the repository at this point in the history
  2. Implement one-time and two-times threshold borrowing scenarios

    - Add threshold_scenario_limited_one_time function
    - Add threshold_scenario_limited_2_times function
    - Create generate_limited_time_script for reusable script generation
    - Implement nested script structure for two-times borrowing
    - Update documentation for both scenarios
    - Add tests for owner spending, borrowing, and invalid attempts in both cases
    - Ensure consistent error handling and logging across scenarios
    - Refactor to use more generic script generation approach
    biryukovmaxim committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e5e8b64 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ef4e7ee View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2024

  1. Configuration menu
    Copy the full SHA
    7b6cf0d View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into kip-10-mutual-tx

    # Conflicts:
    #	consensus/src/processes/transaction_validator/transaction_validator_populated.rs
    #	crypto/txscript/src/lib.rs
    #	crypto/txscript/src/opcodes/mod.rs
    #	crypto/txscript/src/standard/multisig.rs
    #	wallet/pskt/src/pskt.rs
    biryukovmaxim committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    77f0719 View commit details
    Browse the repository at this point in the history
  3. style: fmt

    biryukovmaxim committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    cdb43ae View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2024

  1. Configuration menu
    Copy the full SHA
    e39a2db View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    730df36 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2024

  1. remove borrow scenario from tests.

    run tests against both kip1- enabled/disabled engine
    biryukovmaxim committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    a777a12 View commit details
    Browse the repository at this point in the history
  2. introduce method that converts spk to bytes.

    add tests covering new opcodes
    biryukovmaxim committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    c216370 View commit details
    Browse the repository at this point in the history
  3. return comment describing where invalid opcodes starts from.

    add comments describing why 2 files are used.
    biryukovmaxim committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    20a8df6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1a9c508 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2024

  1. Configuration menu
    Copy the full SHA
    164d044 View commit details
    Browse the repository at this point in the history
  2. test input spk

    biryukovmaxim committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    91298d5 View commit details
    Browse the repository at this point in the history
  3. test output spk

    biryukovmaxim committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    a117c0e View commit details
    Browse the repository at this point in the history
  4. tests refactor

    biryukovmaxim committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    3b2849f View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2024

  1. Configuration menu
    Copy the full SHA
    d1cb457 View commit details
    Browse the repository at this point in the history
  2. Standartize fork activation logic (kaspanet#588)

    * Use ForkActivation for all fork activations
    
    * Avoid using negation in some ifs
    
    * Add is_within_range_from_activation
    
    * Move 'is always' check inside is_within_range_from_activation
    
    * lints
    someone235 authored and biryukovmaxim committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    8069be5 View commit details
    Browse the repository at this point in the history
  3. Refactoring for cleaner pruning proof module (kaspanet#589)

    * Cleanup manual block level calc
    
    There were two areas in pruning proof mod that
    manually calculated block level.
    
    This replaces those with a call to calc_block_level
    
    * Refactor pruning proof build functions
    
    * Refactor apply pruning proof functions
    
    * Refactor validate pruning functions
    
    * Add comments for clarity
    coderofstuff authored and biryukovmaxim committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    dced99f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2974b97 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    186db46 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    96fb3df View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2810a88 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    246537b View commit details
    Browse the repository at this point in the history
  9. fix kip10 examples

    biryukovmaxim committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    a432e96 View commit details
    Browse the repository at this point in the history
  10. rename test

    biryukovmaxim committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    a09fdb7 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    372a7ad View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    7e81eb2 View commit details
    Browse the repository at this point in the history
  13. reseve opcodes

    reorder kip10 opcodes.
    reflect script tests
    biryukovmaxim committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    a30976d View commit details
    Browse the repository at this point in the history
  14. fix example

    biryukovmaxim committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    25243f5 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    66d6bad View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    2ba5d47 View commit details
    Browse the repository at this point in the history
  17. Merge branch 'master' into kip-10-mutual-tx

    # Conflicts:
    #	consensus/core/src/config/params.rs
    #	consensus/src/consensus/services.rs
    #	consensus/src/processes/transaction_validator/mod.rs
    #	testing/integration/src/consensus_integration_tests.rs
    biryukovmaxim committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    658782a View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2024

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

Commits on Nov 9, 2024

  1. Configuration menu
    Copy the full SHA
    8422331 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    046308f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    828a5bc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3259cc6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5f8351d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    955424c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5689ed5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e9829e2 View commit details
    Browse the repository at this point in the history
  9. fix comments

    biryukovmaxim committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    7705ba3 View commit details
    Browse the repository at this point in the history
  10. add input spk tests

    biryukovmaxim committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    1f38b64 View commit details
    Browse the repository at this point in the history
  11. refactor test cases

    biryukovmaxim committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    4a3a44b View commit details
    Browse the repository at this point in the history
  12. refactor(txscript): Enforce input index invariant via assertion

    Change TxScriptEngine::from_transaction_input to assert valid input index
    instead of returning Result. This better reflects that an invalid index is a
    caller's (transaction validation) error rather than a script engine error,
    since the input must be part of the transaction being validated.
    
    An invalid index signifies a mismatch between the transaction and the input being
    validated - this is a programming error in the transaction validator layer, not
    a script engine concern. The script engine should be able to assume it receives
    valid inputs from its caller.
    
    The change simplifies error handling by enforcing this invariant early,
    while maintaining identical behavior for valid inputs. The function is
    now documented to panic on malformed inputs.
    
    This is a breaking change for code that previously handled
    InvalidIndex errors, though such handling was likely incorrect
    as it indicated an inconsistency in transaction validation.
    biryukovmaxim committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    5a00231 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    df7c243 View commit details
    Browse the repository at this point in the history
  14. rename id to idx

    biryukovmaxim committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    523ee9a View commit details
    Browse the repository at this point in the history
  15. rename opcode

    biryukovmaxim committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    a5c6077 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2024

  1. Configuration menu
    Copy the full SHA
    da7d81b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4644179 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0fa920e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    83ad761 View commit details
    Browse the repository at this point in the history
  5. Update crypto/txscript/src/lib.rs

    refactor vector filling
    
    Co-authored-by: Michael Sutton <[email protected]>
    biryukovmaxim and michaelsutton authored Nov 10, 2024
    Configuration menu
    Copy the full SHA
    07b80dd View commit details
    Browse the repository at this point in the history
  6. rework assert

    biryukovmaxim committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    b50b7b3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    78f2291 View commit details
    Browse the repository at this point in the history
  8. verify that block is disqualified in case of it has tx which requires

    block that contains the tx with kip10 opcode is accepted after daa score has being reached
    biryukovmaxim committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    7fc9828 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4d79485 View commit details
    Browse the repository at this point in the history
  10. add doc comments

    biryukovmaxim committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    4fe40f8 View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2024

  1. Update crypto/txscript/src/opcodes/mod.rs

    Fallible conversion of output amount (usize -> i64)
    
    Co-authored-by: Michael Sutton <[email protected]>
    biryukovmaxim and michaelsutton authored Nov 11, 2024
    Configuration menu
    Copy the full SHA
    898a56a View commit details
    Browse the repository at this point in the history
  2. Update crypto/txscript/src/opcodes/mod.rs

    Fallible conversion of input amount (usize -> i64)
    
    Co-authored-by: Michael Sutton <[email protected]>
    biryukovmaxim and michaelsutton authored Nov 11, 2024
    Configuration menu
    Copy the full SHA
    3af28ed View commit details
    Browse the repository at this point in the history
  3. add required import

    biryukovmaxim committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    88399da View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    863a9a1 View commit details
    Browse the repository at this point in the history
  5. fix test description

    biryukovmaxim committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    103684e View commit details
    Browse the repository at this point in the history
  6. rework example

    biryukovmaxim committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    2db1df5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1e48ab4 View commit details
    Browse the repository at this point in the history
  8. add todo

    biryukovmaxim committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    aaeed6d View commit details
    Browse the repository at this point in the history
  9. rewrite todo

    biryukovmaxim committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    0befcaa View commit details
    Browse the repository at this point in the history
  10. remove redundant code

    biryukovmaxim committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    19a8c52 View commit details
    Browse the repository at this point in the history
  11. Merge pull request #6 from biryukovmaxim/fallible-serialization

    9 byte integers must fail to serialize
    biryukovmaxim authored Nov 11, 2024
    Configuration menu
    Copy the full SHA
    08d57c0 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2024

  1. remove redundant mut in example

    Co-authored-by: Michael Sutton <[email protected]>
    biryukovmaxim and michaelsutton authored Nov 12, 2024
    Configuration menu
    Copy the full SHA
    ca02b61 View commit details
    Browse the repository at this point in the history
  2. remove redundant mut in example

    Co-authored-by: Michael Sutton <[email protected]>
    biryukovmaxim and michaelsutton authored Nov 12, 2024
    Configuration menu
    Copy the full SHA
    3323e24 View commit details
    Browse the repository at this point in the history
  3. remove redundant mut in example

    Co-authored-by: Michael Sutton <[email protected]>
    biryukovmaxim and michaelsutton authored Nov 12, 2024
    Configuration menu
    Copy the full SHA
    83711f4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    74468e5 View commit details
    Browse the repository at this point in the history