forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 7
Tx model refactor #191
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
Open
aguycalled
wants to merge
82
commits into
master
Choose a base branch
from
prevout-txout-hash
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Tx model refactor #191
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…d clean up SegWit test code by eliminating redundant hash calculations.
…mance and consistency
…e redundant transaction ID assignment in SegWit test.
… for improved performance
…0 and change worker type to 'noble'; add new COutPoint_old class and update transaction data in various test files for consistency.
… 'small' and 'medium'; modify mempool tests to use InsecureRand256 for predicate generation for improved randomness and consistency.
…actions.cpp for prevout hash randomness
… randomness; update MineBlock function to return output hash instead of transaction hash
…ut management; update staking tests to validate minimum stake requirements and enhance verbose output handling in BLSCT wallet operations.
…ed transitions from the minimum difficulty limit; update consensus parameters for genesis block and improve wallet transaction handling by removing debug output and ensuring proper input selection. Additionally, modify tests to reflect changes in difficulty calculations and consensus limits.
…ove code cleanliness and maintain consistency across the codebase.
… RPC and wallet functions to reflect changes in output management and fix tests
… for predicate parsing in various components, ensuring robustness against invalid data. Update memory usage calculations in transaction management and fix test cases
…r skipping descendant limits during block updates; enhance the UpdateTransactionsFromBlock function to improve efficiency and maintain consistency in handling transaction states. Additionally, introduce a new RPC command to retrieve transactions by output hash, improving wallet functionality and fix tests
…tion to clear replaced_by_txid; enhance the create_tx method in BIP66Test for better output management; add new functional test for gettxfromoutputhash RPC command; update test runner to include the new test; adjust wallet_bumpfee tests for output validation and fee rate calculations.
…action retrieval; update send_to_witness calls in SegWitTest to use the new getutxo signature; enhance error handling in blocktools.py for transaction signing process.
…sistently formatted with zero-padding; refactor getutxo function to improve transaction retrieval; update output handling in ImportRescanTest for better transaction identification.
…d_vout_for_address with find_outid_for_address for improved output identification; update transaction retrieval methods to ensure consistency across functional tests.
…output hash identification; update GetTransactionAncestry to locate transactions via output hashes, enhancing consistency in ancestor calculations. Modify fee calculation logic in MiniMiner to only include ancestors needing fee bumps, improving efficiency. Additionally, update various tests to ensure compatibility with new output handling methods.
… 'gettxfromoutputhash'; remove 'vout' parameter from relevant RPC documentation and tests for improved clarity and consistency. Update wallet balance retrieval to account for wallet reuse avoidance. Refactor transaction input handling in tests to eliminate unnecessary 'vout' references, ensuring compatibility with recent changes.
…es in p2p_headers_sync_with_minchainwork.py, adjust byte count in p2p_ibd_stalling.py due to added predicate data, comment out test_chain_listunspent call in wallet_basic.py, and correct serialized transaction size assertion in invalid_txs.py.
This commit introduces the `GETOUTPUTDATA` message type, allowing peers to request transactions by output hash. It includes the implementation of `ProcessGetOutputData`, `FindTxByOutputHash`, and `AddOutputHashAnnouncement` methods in `PeerManagerImpl`. Additionally, a new class `COutputHashRequest` is defined for handling output hash requests. The changes also update the protocol definitions and enhance the message handling framework to accommodate this new functionality, ensuring compatibility with existing transaction processing logic.
…es instead of output points. Update related test cases to ensure consistency in transaction identification and improve clarity in output handling.
…istency. Simplify conditional statements and enhance code structure in AddToWallet and RecursiveUpdateTxState functions. Update error handling in Create method for better clarity on wallet loading issues.
…ove unused exception variables
…o prevout-txout-hash
…rdering and improve encryption key checks
… Ensure BlockUntilSyncedToCurrentChain is called without holding cs_main lock in gettxfromoutputhash
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces a major refactoring of the transaction model to reference prevout's using transaction output hashes instead of pairs of transaction hashes and output indexes, along with new BLS signature opcodes for enhanced support of BLS signature verification inside of the scripting language.
The primary motivation for this change is to support transaction pre-generation and pre-signing in Navio's block aggregation model. Navio aggregates all transactions in a block into a single aggregated transaction during block construction. This aggregation process changes the transaction hash of the original transactions, which invalidates any pre-signed transactions that referenced outputs using the traditional (transaction hash, output index) format.
By using output hashes instead of transaction hash + output index pairs, transactions can now be:
This is because output hashes are derived from the output content itself (scriptPubKey, value, etc.) and remain static regardless of how the transaction is aggregated or what its final transaction hash becomes.
The introduction of the OP_BLSCHECKSIG op code, removes the reliance on the spendingKey parameter of the output for the creation of spending rules based on proving private key knowledge, therefor allowing the use of BLS Keys in complex spending paths like atomic swaps. The spendingKey of an output is allowed to be zero'ed, leaving all the spending flow to the script of the output. Following this logic, the following two outputs are meant to be spent under the same conditions:
Output1:
Output2: