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!: add committee management utxo #3835

Merged
merged 17 commits into from
Feb 18, 2022

Conversation

delta1
Copy link
Contributor

@delta1 delta1 commented Feb 14, 2022

Description

  • adds the ability to submit committee definition transactions/UTXOs to the base layer for managing sidechain committees
  • adds committee definition features to output features
  • bumps the output features version to V1 (this is a hard fork as older software won’t accept the new version) edit: keep V0 as current output features version and add mempool validation and consensus rules for versions
  • clean up some wallet client code in collectibles
  • bump the default clippy too many args to 12 and remove individual allows
  • hardcode more of the genesis block instead of using defaults that might change
  • impl Display for MmrRoots

update: 16 feb
specific changes: d34af75

  • not a hard fork until we opt in to new output features version number (keep V0 for now)
  • adds acceptable versions to consensus constants
  • adds mempool validation for acceptable versions in transactions
  • fixes a bug where UnblindedOutput would use the current_version instead of the given utxo version

@delta1 delta1 added the W-consensus_breaking Warn - A change requiring a hard fork to be activated label Feb 14, 2022
sdbondi
sdbondi previously approved these changes Feb 15, 2022
Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

Very nice! Think 100 FPG is a quite high for the checkpoint

base_layer/core/tests/helpers/nodes.rs Outdated Show resolved Hide resolved
base_layer/wallet/src/assets/asset_manager.rs Outdated Show resolved Hide resolved
stringhandler
stringhandler previously approved these changes Feb 15, 2022
Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

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

Happy, just would prefer a better name to committee_checkpoint. Checkpoint is used for the sidechain to checkpoint it's data to the base layer. Having two terms for checkpoint will probably be confusing.

I suggested committee_management but it's not great either. Open to other suggestions

base_layer/core/src/proto/transaction.rs Outdated Show resolved Hide resolved
@delta1 delta1 dismissed stale reviews from stringhandler and sdbondi via c91c7ce February 15, 2022 12:44
@delta1 delta1 removed the W-consensus_breaking Warn - A change requiring a hard fork to be activated label Feb 16, 2022
@@ -17,7 +17,7 @@ pub enum OutputFeaturesVersion {

impl OutputFeaturesVersion {
pub fn get_current_version() -> Self {
Self::V1
Self::V0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

keep V0 for now until we opt in

#[repr(u8)]
pub enum TransactionInputVersion {
V0 = 0,
V1 = 1,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was added for testing and is unused for now

@@ -196,7 +196,8 @@ impl UnblindedOutput {
));
}
let commitment = factories.commitment.commit(&self.spending_key, &self.value.into());
let output = TransactionOutput::new_current_version(
let output = TransactionOutput::new(
self.version.clone(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this was a bug, as calling these functions would overwrite the given utxo version with whatever get_current_version would return

@@ -242,7 +243,8 @@ impl UnblindedOutput {
.map_err(|_| TransactionError::RangeProofError(RangeProofError::ProofConstructionError))?
};

let output = TransactionOutput::new_current_version(
let output = TransactionOutput::new(
self.version.clone(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this was a bug, as calling these functions would overwrite the given utxo version with whatever get_current_version would return

@delta1
Copy link
Contributor Author

delta1 commented Feb 17, 2022

Just need to update some tests after the change back to V0

Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

Not tested but looking good

@aviator-app aviator-app bot merged commit 50fe421 into tari-project:development Feb 18, 2022
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