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!: identity funding with asset lock special transactions #1510

Merged
merged 56 commits into from
Nov 1, 2023

Conversation

shumkov
Copy link
Member

@shumkov shumkov commented Oct 18, 2023

Issue being fixed or feature implemented

Currently, we are using normal transactions with OP_RETURN output to fund identities since it was a temporary solution to get the identity funding feature done earlier. Asset Lock validation logic was ported only partially from JS DPP and Drive.

What was done?

  • Updated Core to v20.0.0-rc.2
  • Switched to Asset Lock Special transactions instead of normal transactions for the identity funding
  • Implemented validation for Asset Lock Proofs
  • Implemented signature verification for Identity Create and Top Up transitions
  • Removed type from Asset Lock Proofs
  • Enabled/fixed Identity test suite tests
  • Fixed identity create transition balance validation
  • Fixed Transaction#getOutPointBuffer (JS)
  • Fixed consensus error messages

How Has This Been Tested?

  • With enabled tests in test suite
  • Manually

Breaking Changes

  • Consensus rules for Identity Create and TopUp are changed.
  • Asset Lock Proof structure is changed
  • Identity Create Transition balance validation requires correct amount (twice more)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@shumkov shumkov changed the title Feat/process asset locks feat: identity funding with asset lock special transactions Oct 19, 2023
@shumkov shumkov changed the title feat: identity funding with asset lock special transactions [WIP] feat: identity funding with asset lock special transactions Oct 19, 2023
@shumkov shumkov marked this pull request as ready for review October 19, 2023 19:17
# Conflicts:
#	.pnp.cjs
#	packages/dashmate/configs/getConfigFileMigrationsFactory.js
#	packages/js-dapi-client/package.json
#	packages/js-dpp/lib/test/fixtures/getChainAssetLockProofFixture.js
#	packages/js-dpp/lib/test/fixtures/getInstantAssetLockProofFixture.js
#	packages/js-dpp/package.json
#	packages/rs-drive-abci/tests/strategy_tests/verify_state_transitions.rs
#	packages/rs-platform-version/src/version/drive_abci_versions.rs
#	packages/rs-platform-version/src/version/mocks/v2_test.rs
#	packages/rs-platform-version/src/version/mocks/v3_test.rs
#	packages/rs-platform-version/src/version/v1.rs
#	packages/wasm-dpp/test/unit/identity/stateTransition/assetLockProof/ChainAssetLockProof.spec.js
#	packages/wasm-dpp/test/unit/identity/stateTransition/assetLockProof/InstantAssetLockProof.spec.js
#	yarn.lock
@shumkov shumkov force-pushed the feat/process-asset-locks branch from c11944d to b82c18f Compare October 30, 2023 12:19
@shumkov shumkov modified the milestones: v0.25.x, v1.0.0 Oct 30, 2023
@shumkov shumkov force-pushed the feat/process-asset-locks branch from 6d2dac6 to 6905a64 Compare October 31, 2023 14:25
# Conflicts:
#	packages/dashmate/configs/defaults/getBaseConfigFactory.js
#	packages/dashmate/configs/getConfigFileMigrationsFactory.js
#	packages/dashmate/src/config/configFile/migrateConfigFileFactory.js
#	packages/dashmate/test/unit/commands/config/configFile/migrateConfigFileFactory.spec.js
@shumkov shumkov merged commit 3323dd8 into v1.0-dev Nov 1, 2023
46 of 47 checks passed
@shumkov shumkov deleted the feat/process-asset-locks branch November 1, 2023 06:14
map.insert("outputIndex", self.output_index);
map.insert("transaction", transaction_buffer);
map.insert("instantLock", is_lock_buffer);

map.to_bytes()
.map_err(|e| ProtocolError::EncodingError(e.to_string()))
}

// TODO: Versioning
Copy link
Member

Choose a reason for hiding this comment

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

Really should be versioned now.

@@ -52,6 +53,8 @@ pub struct PlatformRef<'a, C> {
pub config: &'a PlatformConfig,
/// Core RPC Client
pub core_rpc: &'a C,
/// Block info
pub block_info: &'a BlockInfo,
Copy link
Member

Choose a reason for hiding this comment

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

No this is wrong, you don't add state information to the Platform Ref

@@ -27,7 +27,7 @@ bs58 = "0.4.0"
hex = "0.4.3"
indexmap = { version = "1.9.3", features = ["serde"] }
sha2 = "0.10.6"
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", tag = "v0.15.1" }
dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore-rpc", branch = "master" }
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't be targeting master, instead should be a tag.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I will release new version

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