Repository navigation
Dk with tcp - #28
Open
LiveLaughLove13 wants to merge 188 commits into
Open
Dk with tcp#28LiveLaughLove13 wants to merge 188 commits into
LiveLaughLove13 wants to merge 188 commits into
Conversation
* Limit element size on push to stack * Remove unused method * Implement opcodes * Implement kip 17 opcodes * Add EngineFlags to script engine constructors * Add script_tests_covenants.json * Add sanity tests and change substr variable order * Fix OpBlake2bWithKey arg order * Add tests to script_tests_covenants.json * intropsection tests * Fix error message * Add activation logic * covenants_activation_test * Fix serialization and hashing tests not to use illegal coinbase txs * Simplify tx id hashing * Add transaction_id_preimage * Add counter covenant example * clippy + fmt * Address review comments * Add push_limit_activation_test * Fix comments
* Adding testnet 12 * Add testnet12.md
Co-authored-by: IzioDev <9900846+IzioDev@users.noreply.github.com>
* Adding covenant info to outputs * New opcodes * Add OpNum2Bin, OpBin2Num and remove minimal encoding check on deserialize_i64 * Add tests for minimal encoding relaxation * Add NUM2BIN/BIN2NUM tests * Add an example with covenant id * Add random outputs * Complete TODO * External covenant context + Engine context refactor (kaspanet#11) * fix missing error propagation * covenants ctx for a single linear scan * todo * bunch of temp wallet compilation fixes * renames and docs * refactor cov ctx * refactor and introduce engine ctx * have only check_scripts + fluent api for ctx with upgrade fns * Op seq commit (kaspanet#8) * add blake3 support: integrate new keyed blake3 hasher * refactor merkle utilities: add support for custom hashers(particularly for SeqCommitmentMerkleBranchHash) and improve tests * impl OpChainblockSeqCommit, introduce interface passed into Vm * add covenants_activation support and enhance calc_accepted_id_merkle_root with activation logic * impl SeqCommit interface with MockSeqCommitAccessor, add covenants test cases into bitcoin tests file * pass finality_depth to SeqCommitAccessor constructor * replace pov_daa_score check with covenants_activation status in utxo_validation * fix usage of `try_is_chain_ancestor_of` inside SeqCommitAccessor rename method for clarity * Use `get_blue_score` method Co-authored-by: Michael Sutton * remove TODO comment Co-authored-by: Michael Sutton * fmt * fix comparison logic in `seq_commitment_within_depth` to use `blue_score` instead of `daa_score` * use conventional way to retrieve selected parent Co-authored-by: Michael Sutton fmt --------- Co-authored-by: Michael Sutton * engine ctx aliases + improved ergo `.new(..).with_reused(..)` * use or_default * use or_insert_with * cov ctx renames * renames and todo macros (wide rename) * move covenants ctx building to script engine * add output to ctxs only in the non genesis case * readability and control flow * fix tests * fix tx in isolation test --------- Co-authored-by: Maxim <59533214+biryukovmaxim@users.noreply.github.com> * Disable mainnet + minor changes * Fix bitcoind tests * patch some tests and address review comments * Fix covenant id example --------- Co-authored-by: Maxim <59533214+biryukovmaxim@users.noreply.github.com> Co-authored-by: Michael Sutton <msutton@cs.huji.ac.il>
… Bindings; Resolve Related TODOs (kaspanet#835) * Add `TryCastFromJs` implementation for `CovenantBinding` impl `TryCastFromJs` for `TransactionOutput` * Parse `covenant_id` in `UtxoEntry` and remove `todo!()` placeholder * Add covenant support to PSKT and enforce version compatibility rules * impl TryFrom<TransactionOutput> for Output * Add `covenant_id` support to `UtxoEntryWrapper` and JS serialization * Add `covenant_id` support to transaction generation and `create_batch_utxo_entry_reference` * Add covenant support to PaymentOutput and its JS bindings * fix `PaymentOutput` JS bindings. Remove the second constructor * add covenant binding in corresponding rpc models including grpc * fix ser/deser for optional output and entry * fix push_limit_activation_test * Add `covenant_id` support to `UtxoEntry` under prealloc feature * Rename `RpcOptionalCovenantBinding` to `RpcNullableCovenantBinding` across models, converters, and proto definitions. --------- Co-authored-by: Michael Sutton <msutton@cs.huji.ac.il>
* fmt * fmt * Implement more covenant id related opcodes * Fix tests * Add covenant_id_introspection_ops test * Remove duplicate import * Address review comments
…kaspanet#849) * introduce new method of calculation txid for transaction of version 1 * add serialization for v0 TxID preimage and update txid v1 encoding flags * remove assertion in txid function update payload handling in v1 encoding add todo for tests * fix test failing due to assumption v1 tx has the same hashing algo for txid as v0
…#848) * update covenant genesis hashing to include all auth outputs * doc * add comments * use write_* ext * allow genesis to originate from an input utxo belonging to an existing cov * allow genesis output grouping signaled by different cov ids * fix error * add cov genesis tests * simplify test helper
* enrich `VirtualState` that contains vec of payload digests, that are required to calculate ChainSeqCommitment. Migrate old state to new one * replace `hex-literal` usage with raw byte array for `ZERO_PAYLOAD_DIGEST`, remove `hex-literal` dependency * revert cargo.lock * replace `payload_digest` with `PayloadDigest::hash` in test for consistency * clippy * Replace `accepted_tx_ids` and `accepted_tx_payload_digests` with `accepted_tx_digests` * Add covenants activation condition for `accepted_tx_digests` in `VirtualState` fix tests * Refactor consensus tests to use `seq_commit_digest` * Standardize `OpSubstr` naming and refactor index conversions * Add `InvalidRange` error and refine `substring` validation logic * Remove unused `HASH_SINGLE_ENTRY` constant in `utxo_validation.rs`
…#851) * impl execute_and_return_stacks * refinement
* Expose TxScriptEngine fns * use `StackEntry` type alias for stack elements * fmt
… `EngineContext` (kaspanet#856)
* pre-purge * Pruned risc0 verifiers * Add op_zk_precompile * Revert derive_more to prevent breaking chg issue * Implement r0, groth16 precompiles - Increase MAX_SCRIPT_SIZE, MAX_SCRIPT_ELEMENT_SIZE, MAXIMUM_STANDARD_TRANSACTION_MASS - Implement OpZkPrecompile opcode * Add ZK precompile sigop cost and benchmarking Introduces sigop cost calculation for ZK precompiles in txscript, updates OpZkPrecompile to consume sigops based on verifier tag, and adds a benchmarking test comparing ZK proof verification and ECDSA signature verification. Also adds a sample STARK proof hex file and lowers MAX_SCRIPT_ELEMENT_SIZE to 250,000. * Improve errors, add benchmark proofs, remove anyhow, receipt claim This finalizes the PoC implementation of OP_ZK_PRECOMPILE. * Revert special opcode handling * Upgrade sigop count to u16 * Remove debug prints * Remove script * Update .gitignore * Add example scripts for usage * Update .gitignore * Fmt + test fix * Clippy * Add example proofs * Clippy * Add batch verification test * Revert u16 change * Add sigop count encoding * Use encoded sigop counts - If a sigop count is > 100 each sigop count value will be counted as 10 (everything above 100) * Update lock * Runtime sigop counter no longer an option * fmt * fix test * Update integration tests * Test refactor - Remove scriptpubkey size check, since we can have largerlocking scripts due to larger scripts (zk) - Allow larger than 520 bytes to be passed in script test - Update misc tests * Clippy * Refactor zk precompiles and add Groth16 support Reorganizes the zk_precompiles module by removing RISC0 Groth16 and succinct submodules, introducing a new Groth16 precompile using arkworks libraries, and centralizing error handling. Updates dependencies to include arkworks crates, adjusts trait and error types for modularity, and moves/renames benchmark files for clarity. The changes improve maintainability and add support for Groth16 proof verification. - In order to facilitate verification of arbitrary proofs we need to use the inner functionality that risc0 uses in order to verify g16 proofs. * Make succinct rcpt public & start g16 rewrite * Finalize r0 g16 generalization via arkworks * Add back test * Use vm-native numbers * Change opzk to be 0cb * Change opzk to be 0xcb * Revert "Change opzk to be 0xcb" This reverts commit 884051d. * Change opzk to be oxcb * Fix compilation error * Change opcode number * Fmt add back old opcode * Fix 0xc4 test * Disable test until max script size is set * ignore long bench test * Add constraint synthesizer + benchmark test * fix params (reverse mainnet and tn10, adjust tn12 and mainnet) * update tn12 genesis * remove re-added todo * remove unused sigop verification function (pre crescendo) * reverse TRANSIENT_BYTE_TO_MASS_FACTOR change * apply sigop decoding scheme only to tx v1 + impl encode helper * add // TODO(covpp-mainnet) over modified mempool consts * adjust ExceededSigOpLimit to u16 (fixes overflow) * use conventional i32 for num of inputs stack arg * disallow long zk tags (len > 1) * fix static sigop count and adjust zk modules visibility * use i64 in JS example * Add comments * Comment * Remove unused fields + add todo comment * add constructor * Update r0 proof to match struct * Refactor R0 proof deserialization and move zk benchmarks to Criterion * remove redundant check (hex) * cleanup --------- Co-authored-by: Michael Sutton <msutton@cs.huji.ac.il>
* Toccata Cleanup - Part 1 * Activate Toccata on devnet * Remove the fork activation logger and its log encoder * Remove the p2p activation countdown * Remove the IBD pre-activation pruning point guard and SMT stable workaround * Fix devnet fallout from Toccata activation * Build test headers with the configured block version instead of the constant * Regenerate the JSON DAG fixtures now that devnet is Toccata active
* Collapse consensus activation checks to their post-Toccata branch * Move transaction version and signature script checks back to isolation * Restore the context-free header version check * Drop the activation field from the transaction, coinbase, pruning proof, virtual and seq commit services * Stop generating DAGs that span the activation in simpa test pruning
Co-authored-by: IzioDev <9900846+IzioDev@users.noreply.github.com>
* Toccata Cleanup - Part 3 * Remove the covenants engine flag and make post-Toccata script rules unconditional * Drop the pre-Toccata script size, element size and opcode count limits * Remove the sigop counting resource meter in favor of script units * Bound pskt extraction by the input's committed script units * Replace the script test vectors with the covenant aware set * Drop the minimal encoding enforcement flag from script number deserialization * Enforce committed script units in pskt extract; restore exceeded-limit test * Explicitly discard unused covenantsEnabled value
* Toccata Cleanup - Part 4 * Drop the toccata activation argument from the mining manager and mempool * Remove the pre-Toccata standard transaction mass cap and its relaxation window * Make the relay fee floor unconditional and delete the legacy minimum relay fee * Drop the unused priority and DAA score arguments from the standardness checks * Reduce the transient mass activation tests to the durable template limit checks * Remove the mempool mass rejection error variants left without constructors * correct per-lane gas rationale in unreachable NonStandardError TODO
* Always advertise the current protocol version * Always require protocol 10 from peers * Always query the pruning SMT stable flag * Always perform the full SMT state sync * Always resolve the inactivity shortcut from the shortcut header * De-Toccata-ify the relay block header version guard
* Merge the prior/new block mass limit and signature script length params * Set BLOCK_VERSION to 2 and delete TOCCATA_BLOCK_VERSION * Collapse the forked block version and mass cofactor params to plain values * Drop the mempool mass activation delay and its DAA score plumbing * Delete Params::toccata_activation, keeping override params strict * Rewrite the DAG fixture override blobs for the merged params
* docs(consensus): correct post-Toccata cleanup comments * p2p: consolidate protocol flows under v10 * p2p: make body-only IBD requests unconditional * p2p: remove obsolete header format versioning
Covers changing dagknight registry numbers from 7X range to 8X range
This test deterministically replicates the invalid LKT frontier issue.
Zone filling is done by NCA (and thus tips in it). find_last_known_tips previously may find blocks that are not chain ancestors of current tips before this fix. Now, finding last known tips for committed search is based on only tips that have NCA as chain ancestors AND those tips' chain ancestry tree.
Instrumentation is too strict. This adds a test that replicates that strictness which doesn't align with expected behavior.
Always-on DK coloring picks a different selected parent than recorded goref headers, so bits/DAA fail. Honor enable_dagknight (default on) and turn it off only for json_test.
GHOSTDAG sink search pops a rejected candidate before walking to its parents. v2 left it in tip_set, so genesis looked like an ancestor of the current set and was never added. The loop retried the same invalid tip forever.
Keep our DAGKNIGHT consensus, DB prefixes 80/81, and CI. Take their TCP/libp2p stack. Adapt libp2p gRPC to tonic 0.14 and restore kaspad build-info/system-info imports.
The libp2p merge used std::io and std::hash, which breaks Check no_std on thumbv7em-none-eabi without default features.
The TCP merge pulled coderofstuff's singular-strong-group shortcut into protocol.rs. That can elect a long disqualified chain as the only strong group, so virtual never UTXO-validates the real tip and double_search_disqualified_test fails.
CI timed out because the test dialed the circuit before Identify/reservation and required a localhost hole-punch. Follow the official sequence and assert the relayed connection, which holds under nextest.
GHOSTDAG only heap-pops already-disqualified tips. DK was re-running the full algorithm on each one, which made test_concurrent_pipeline_random take minutes. Screen pending tips first, then walk an all-disqualified set to a valid ancestor. Keep disqualified anticone tips in the DK input so they can still be merged.
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
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.
No description provided.