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

feat: covenants implementation #3656

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Dec 13, 2021

Description

  • Implementation of Covenants as per RFC-0250
  • Implement consensus encoding for some common types
  • remove wrapper for consensus encoding tari script, just implement on the type
  • add consensus encoding impl for some common types

Motivation and Context

let covenant = covenant!(and(
    field_eq(
        @field::commitment, 
        @commitment(x),
    ), 
    fields_preserved(
        @fields(@field::features_unique_id, @field::features_parent_public_key)
    ))
);
covenant.execute(...)?;

Adding Covenants to inputs/outputs structs and validation is left for another PR - this is not a breaking change.

How Has This Been Tested?

Many new unit tests

@sdbondi sdbondi force-pushed the core-covenants-initial-impl branch 2 times, most recently from d9ab86f to cf0a720 Compare December 13, 2021 14:32
@sdbondi sdbondi changed the title feat: mimblewimble covenants implementation feat: covenants implementation Dec 13, 2021
@sdbondi sdbondi force-pushed the core-covenants-initial-impl branch from 83c2279 to 35fe579 Compare January 4, 2022 07:15
Copy link
Contributor

@delta1 delta1 left a comment

Choose a reason for hiding this comment

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

Nice looks really great, just one possible off-by-1 in the range otherwise LGTM

base_layer/core/src/covenants/byte_codes.rs Outdated Show resolved Hide resolved
base_layer/core/src/covenants/covenant.rs Outdated Show resolved Hide resolved
base_layer/core/src/covenants/fields.rs Show resolved Hide resolved
delta1
delta1 previously approved these changes Jan 6, 2022
@delta1
Copy link
Contributor

delta1 commented Jan 6, 2022

🖇

* development:
  feat: dibbler new genesis block with faucet utxos (tari-project#3688)
  ci: fix clippy warning on generated proto module (tari-project#3690)
  test: fix metadata signature cucumber (tari-project#3687)
  refactor!: clean up #testnet reset TODOs (tari-project#3682)
  feat(comms)!: add signature to peer identity to allow third party identity updates (tari-project#3629)
  chore: remove moving lock.mdb (tari-project#3674)
  chore: merge weatherwax
  v0.22.1.1
  v0.22.1
  ci: add build step (tari-project#3678)
  fix: edge cases causing bans during header/block sync (tari-project#3661)
  fix: end stale outbound queue immediately on disconnect, retry outbound messages (tari-project#3664)
  feat: add search by commitment to explorer (tari-project#3668)
  feat: tari launchpad (tari-project#3671)
  feat: base_node switching for console_wallet when status is offline (tari-project#3639)
  feat: improve wallet recovery and scanning handling of reorgs (tari-project#3655)
  feat: add GRPC call to search for utxo via commitment hex (tari-project#3666)
  feat: custom_base_node in config (tari-project#3651)
  fix: return correct index for include_pruned_utxos = false (tari-project#3663)
@aviator-app aviator-app bot merged commit 8dfcf3a into tari-project:development Jan 11, 2022
sdbondi added a commit to sdbondi/tari that referenced this pull request Jan 11, 2022
* development:
  feat: covenants implementation (tari-project#3656)
  ci: add tor script to binaries bundle (tari-project#3689)
sdbondi added a commit to sdbondi/tari that referenced this pull request Jan 11, 2022
* development: (28 commits)
  feat: covenants implementation (tari-project#3656)
  ci: add tor script to binaries bundle (tari-project#3689)
  chore: remove testnet reset todo in wallet (tari-project#3685)
  feat: dibbler new genesis block with faucet utxos (tari-project#3688)
  ci: fix clippy warning on generated proto module (tari-project#3690)
  test: fix metadata signature cucumber (tari-project#3687)
  refactor!: clean up #testnet reset TODOs (tari-project#3682)
  feat(comms)!: add signature to peer identity to allow third party identity updates (tari-project#3629)
  chore: remove moving lock.mdb (tari-project#3674)
  chore: merge weatherwax
  feat!: provide a compact form of TransactionInput (tari-project#3460)
  fix: allow 0-conf in blockchain db (tari-project#3680)
  v0.22.1.1
  v0.22.1
  ci: add build step (tari-project#3678)
  test: fix cucumber WalletQuery.feature (tari-project#3677)
  test: fix `wait for` step (tari-project#3673)
  fix: edge cases causing bans during header/block sync (tari-project#3661)
  perf(comms)!: optimise connection establishment (tari-project#3658)
  fix: end stale outbound queue immediately on disconnect, retry outbound messages (tari-project#3664)
  ...
aviator-app bot pushed a commit that referenced this pull request Jan 13, 2022
## Description
- add covenants to txos
- validate covenants for transactions and blocks
 
## Motivation and Context

Based on #3656

## How Has This Been Tested?
New unit test
Manually on dibbler, mined a few blocks and a sent transaction (empty covenant)
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.

3 participants