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

[testnet-reset] Merge tari-script branch into development #3064

Merged
merged 219 commits into from
Jul 7, 2021

Conversation

delta1
Copy link
Contributor

@delta1 delta1 commented Jul 6, 2021

Description

Merges the tari-script branch into the development branch to build new releases for the new Weatherwax network.

Includes #3062
Generated new faucet utxos
Reset genesis block timestamp

still todo:

  • branch from current development into a new stibbons branch for posterity

Motivation and Context

#testnetreset

How Has This Been Tested?

In progress:

  • CI
  • cargo build
  • cargo test
  • integration tests
  • ran a node, wallet, and miner

Checklist:

  • I'm merging against the development branch.
  • I have squashed my commits into a single commit.

hansieodendaal and others added 30 commits March 18, 2021 09:32
Added tari script transaction data structures as per RFC-0201
<https://rfc.tari.com/RFC-0201_TariScript.html>, used default
tari script values everywhere. Also updated comms wire mode
to keep this network seperate.
TODO:
- Fix all unit tests
- Migrate tari script into all transaction protocols

wip
…ructures

Add tari script transaction data structures
Updated `/// Sum of script offsets for all kernels in this block.`
…sactions

This PR includes the work of @SWvheerden@hansieodendaal and myself to implement the foundations of TariScript support in the Tari base node and wallets.

The goal of this PR is to add all the data required for TariScripts while building transactions and also to validate the TariScripts by base nodes. 

On the wallet side of things this PR updates the wallet Sql database to store all the elements that the wallet needs to remember to spend an output with a script and updates the Transaction Negotiation Protocols to work with TariScripts. The updates are able to support general TariScripts but in the Wallet the current assumption is that all outputs will have the “Default” Nop script for now.

This PR also adds the fields to the headers required for script validation and the base node validation has been updated to also check the script elements for individual transactions and the accumulated offset for  constructed blocks and the blockchain.

One last feature that is included in this PR as it was easy to add in during the Transaction Protocol refactor is that the Coin Split function in the Wallet now produces outputs that are rewindable and thus can be recovered by a wallet recovery.
…dation and default scripts in transactions

Implement TariScript base node validation and default scripts in transactions
Added tari script transaction data structures as per RFC-0201
<https://rfc.tari.com/RFC-0201_TariScript.html>, used default
tari script values everywhere. Also updated comms wire mode
to keep this network seperate.
TODO:
- Fix all unit tests
- Migrate tari script into all transaction protocols

wip
Implement TariScript base node validation and default scripts in transactions

This PR includes the work of @SWvheerden@hansieodendaal and myself to implement the foundations of TariScript support in the Tari base node and wallets.

The goal of this PR is to add all the data required for TariScripts while building transactions and also to validate the TariScripts by base nodes. 

On the wallet side of things this PR updates the wallet Sql database to store all the elements that the wallet needs to remember to spend an output with a script and updates the Transaction Negotiation Protocols to work with TariScripts. The updates are able to support general TariScripts but in the Wallet the current assumption is that all outputs will have the “Default” Nop script for now.

This PR also adds the fields to the headers required for script validation and the base node validation has been updated to also check the script elements for individual transactions and the accumulated offset for  constructed blocks and the blockchain.

One last feature that is included in this PR as it was easy to add in during the Transaction Protocol refactor is that the Coin Split function in the Wallet now produces outputs that are rewindable and thus can be recovered by a wallet recovery.

fix unit tests

Some code review comments
- Fixed error "Cannot add a NOT NULL column with default value NULL" with
  `outputs` table; cannot add a `NOT NULL` column after the table has been
  created.
- Date integrity: Changed `commitment` and `hash` default `NULL` columns in
  `outputs` table to `NOT NULL`.
- Superfluous constraints: Changed all `NULL DEFAULT NULL` coulmns to `NULL`
  because `NULL` columns are `NULL` by default.
… tari-script

Fix sqlite3 database migrations for tari-script
fix build of wallet_ffi

Update integration_tests/features/Propagation.feature

Co-authored-by: Mike the Tike <[email protected]>
update name 

fix naming
… miner

fix cucumber tests to use standalone miner
Added one-sided to other payment transaction to the
transaction sending protocols. Consecutive PRs must
extend the wiring into the user interfaces. Added
unit tests.
Added one sided transaction sending to the command line
interface.
This PR adds an enum to the PaymentRecipient Protocol struct that is used with the Transfer method to allow the user to specify if a payment is made using the traditional Mimblewimble method or as a One-sided payment.

This was tested manually as the Cucumber tests seem broken in the TariScript branch currently.
libwallet-0.16.25
[Wallet] Persist transaction confirmations for complete transaction and expose via FFI
[base-node] Add rpc sessions to base node status line
[tests] Attempt to replicate sync issue in integration tests
Add wallet recovery cucumber test, seed words to file
Add reorg tests .GT. `orphan_storage_capacity`
Improve wallet recovery resiliency
Fix console wallet menu spacing
[base-node] Always output message when base node exits with an error
Add database concurrency check
Fix README installation artefacts path
Fixed cucumber tests
v0.8.8
[comms] Use grace period on client side handshake
Reduce checklist on PR template
[common] Fix key manager panic
[wallet] Leverage streaming for UTXO recovery
[Wallet] Fix wallet service API loop blocking
[chore] Fix clippy errors
sw_squash tari_script
Added the one-sided payment transaction sending functionality to
the console wallet TUI.
TODO: Receiver wallet scanning the blockchain for one-sided
      transactions.
…llet TUI

Add send one-sided tx to console wallet TUI
This PR aims to fix the broken cucumber tests in the TariScript branch. The PR contains the following:

- Implement the TariScript logic for producing coin bases and transactions in the cucumber support javascript. The updates add a no_op script to UTXO’s.
- Removed the `height` from TariScript signatures and validation
- Update tari_crypto’s WASM interface to allow for clients to do private key arithmetic
- Update the grpc client used by the cucumber tests to support the new fields in the transaction protobuf
- Fixed a bug that causes panics when displaying an TransactionOutput with a malformed range proof
- Remove a number of duplicate Cucumber step file entries from a bad merge.
This PR merges Development into the TariScript branch. The PR includes a few fixes to get the unit tests to pass.
…branch

Fix Cucumber tests in `TariScript` branch
…cript` branch

Merge `Development` into the `TariScript` branch
stringhandler and others added 23 commits July 4, 2021 17:01
BREAKING CHANGE!: This is a DB and network breaking change.
Implements software updates for base node

- Add general-purpose module for software update notifications,
  consisting of:
  - DNS Update checker - checks the configured hosts TXT record for software
    updates
  - Download SHA hash file (shasum) of the updates and validate that a
    known maintainer signed it (future improvements would require > 1 maintainer)
  - Actor/Service that periodically checks for updates and notifies any
    listeners, as well as providing a "handle" interface to the software
    updater.
- Base node uses this module to implement `check-for-updates` command
  and to display update notifications.
- Cucumber tests for valid and invalid update
- Extracted the DNS code from peer seeds so that it can be used for
  reading TXT records here
- Add autoupdate configuration
Co-Authored-By: Hansie Odendaal <[email protected]>
Co-authored-by: Stan Bondi <[email protected]>
- Implemented metadata comsig for the txn output
- Created new faucet
- Updated genesis block timestamp as this is a breakng change
- Added unit test

Co-Authored-By: SW van Heerden <[email protected]>
- Update crates `digest` `rand` and `sha3` to fix compilation errors
  (Ref tari-project/tari-crypto#49)
- NodeId::from_key is infallible
- This in turn meant that NodeIdentity::new and NodeIdentity::randoma are infallible
- This in turn meant that NodeIdentityError is unused, so it was removed
- Remove multiple copies of the random string test utility (all of which
  needed `rand` crate updates) in favour of using the one provided in tari_test_utils
Copy link
Contributor

@hansieodendaal hansieodendaal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

  • All unit tests succeed locally after actual time surpassed the genesis time stamp
  • System-level tests working properly
    • Hybrid mining with two base nodes
    • Normal transaction send (console wallet)
    • One-sided transaction send (console wallet)

@hansieodendaal
Copy link
Contributor

All critical and not critical cucumber tests passed locally:

~/@tari-project/integration_tests (tari-script-merge)$ npm test -- --tags "not @long-running and not @broken"
...
47 scenarios (47 passed)
671 steps (671 passed)
49m11.410s

@stringhandler stringhandler merged commit 266b5f1 into tari-project:development Jul 7, 2021
@delta1 delta1 deleted the tari-script-merge branch July 7, 2021 09:33
@stringhandler stringhandler mentioned this pull request Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants