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

XRPL NFT Bridging #896

Merged
merged 14 commits into from
Nov 6, 2024
Merged

XRPL NFT Bridging #896

merged 14 commits into from
Nov 6, 2024

Conversation

surangap
Copy link
Contributor

@surangap surangap commented Oct 21, 2024

Description

  • Add support for Non Fungible Token(NFT) bridging between XRPL and TRN bidirectional.
  • Add a new pallet pallet-migration to support multiblock migration

Context & Background

  • TRN supports XLS20 compatible NFTs. This PR will enable bridging those NFTs between TRN and XRPL. Also This will support bridging XRPL originated NFTs to TRN as well.

Notes & Additional Information

Related Issues


Release Notes

Key Changes

Type of Change

  • Runtime Changes
  • Client Changes

API Changes

Storage Changes

Added

  • Migration: MigrationEnabled
  • Migration: Status
  • Migration: LastKey
  • Migration: BlockDelay
  • Migration: BlockLimit
  • Xls20: CollectionMapping

Changed

  • XRPLBridge: DoorTicketSequence, change to StorageMap type
  • XRPLBridge: DoorTicketSequenceParams, change to StorageMap type
  • XRPLBridge: DoorTicketSequenceParamsNext, change to StorageMap type
  • XRPLBridge: TicketSequenceThresholdReachedEmitted, change to StorageMap type
  • XRPLBridge: DoorTxFee, change to StorageMap type
  • XRPLBridge: DoorAddress, change to StorageMap type

Removed

Extrinsic Changes

Added

  • Migration: enable_migration
  • Migration: set_block_delay
  • Migration: set_block_limit
  • Xls20: set_collection_mappings
  • XRPLBridge: generate_nft_accept_offer
  • XRPLBridge: withdraw_nft

Changed

  • XRPLBridge: set_door_tx_fee, add param door_type
  • XRPLBridge: set_door_address, add param door_account
  • XRPLBridge: set_ticket_sequence_next_allocation, add param door_account
  • XRPLBridge: set_ticket_sequence_current_allocation, add param door_account

Removed

Event Changes

Added

  • Migration: MigrationEnabled
  • Migration: MigrationDisabled
  • Migration: MigrationComplete
  • Migration: MigrationStarted
  • Migration: BlockDelaySet
  • Migration: BlockLimitSet
  • Xls20: Xls20CollectionMappingsSet
  • Xls20: CouldNotDecodeXls20Token
  • Xls20: CannotBridgeBurnableToken
  • XRPLBridge: XrplTxSignRequest

Changed

  • EthBridge: XrplAuthoritySetChange, Update event_proof_id to a vector of event ids
  • XRPLBridge: DoorAddressSet, add params door_account, address
  • XRPLBridge: DoorNextTicketSequenceParamSet, add param door_account
  • XRPLBridge: DoorTicketSequenceParamSet, add param door_account
  • XRPLBridge: TicketSequenceThresholdReached, add params door_account, current_ticket

Removed

Error Messages

Added

  • Migration: MigrationInProgress
  • Migration: InvalidBlockDelay
  • Migration: InvalidBlockLimit
  • Nft: CannotUpdateMetadata
  • XRPLBridge: Xls20Incompatible
  • XRPLBridge: Xls20TokenIDNotFound

Changed

Removed

Storage Migrations

Added

  • XRPLBridge: Runtime migration to migrate DoorTicketSequence, DoorTicketSequenceParams, DoorTicketSequenceParamsNext, TicketSequenceThresholdReachedEmitted, DoorTxFee, DoorAddress to StorageMap type
  • Xls20: Multiblock migration to migrate Xls20TokenId from [u8;64] to [u8;32]

Removed


surangap and others added 9 commits November 5, 2024 11:13
* Add XRPLDoorAccount enum type.

* Update DoorAddress to a map type.

* Update set_door_address() extrinsic.

* Update EthyToXrplBridgeAdapter to return multiple event proof ids.

* Update Ethy and Xrpl Bridge to support multiple proof generation for multi door addresses when authority set changes.

* Update DoorTxFee to support multi addresses.

* Update the code to support ticket sequencing for multiple door accounts.

* Fix tests

* Update benchmarking

* minor

* Add migrations.

* Remove redundant code.

* Remove previous migrations.

* review suggestions.
…on. (#888)

* Add migrations.

* Add XrplTransaction, NFTokenAcceptOfferTransaction types.

* Introduce submit_xrpl_tx_for_signing() path and implement for nft_accept_offer tx.

* Add generate_nft_accept_offer() extrinsic

* Update code with multi door changes.

* Add tests.

* Add benchmarks.

* review suggestions.

* Update benchmarking to support CI testing.
* Add decode_xls20_token function

* Refactors and basic structure

* Add submit_transaction flow, refactor xrpl and fix build errors

* fmt

* Fix xrpl-bridge tests

* Fix xls20 tests

* Fix xls20 benchmarks

* Update Ext trait

* Add benchmarks for xrpl and xls20 for deposit

* Add collection mappings extrinsic + tests for xls20 and nft pallets

* Add test for XRPL pallet

* Update tests to use NFTBuilder

* Add continue to failed route in process_xrp_tx

* Remove transfer flow from deposit

---------

Co-authored-by: JasonTulp <[email protected]>
Co-authored-by: JasonT <[email protected]>
* Initial migration pallet

* Update migration pallet, link up on_idle() and on_runtime_upgrade()

* fix panic bug, comment out weights returned from on_runtime_upgrade

* Updates to weight management in on_idle

* Add benchmarks

* Add verify to benchmark and fix mock

* Random tests

* Add extra log

* Add block delay for migrations

* Add proper conversion + tidy up test code

* Add migration tests

* Tidy ups

* Remove unused try-runtime code

* Add unit tests

* Remove TODO

* Add block delay check

* fmt

* Fix benchmarks

* Address PR Comments

* Update benchmarks for pallet-migration on fix/xls20-migration

* Fix benchmarks

* Remove convert fn from trait and fix xls20 tests

* Fix xls20 benchmarks

---------

Co-authored-by: GitHub Action <[email protected]>
* Add decode_xls20_token function

* Refactors and basic structure

* Add submit_transaction flow, refactor xrpl and fix build errors

* fmt

* Fix xrpl-bridge tests

* Fix xls20 tests

* Fix xls20 benchmarks

* Update Ext trait

* Add benchmarks for xrpl and xls20 for deposit

* Add collection mappings extrinsic + tests for xls20 and nft pallets

* Add test for XRPL pallet

* Update tests to use NFTBuilder

* Add continue to failed route in process_xrp_tx

* Remove transfer flow from deposit

* Fix merge issues
* Add do_burn(), get_cross_chain_compatibility() to NFTExt

* Fix CrossChainCompatibility move effects.

* Add NFTExt to XrplBridge pallet config.

* Add withdraw_nft().

* Move pallet-nft to dev deps.

* Add Xls20Ext trait.

* Add Xls20Ext to XrplBridge Pallet config.

* Define NFTokenCreateOffer types.

* Complete do_nft_withdrawal().

* Add tests.

* Add benchmark helper fn set_xls20_token_id() to Xls20Ext

* Add benchmarks

* Review suggestions.

* Review suggestions.

* Fix the build.

* Review suggestions

* Add MBM check to get_xls20_token_id()

* fmt

* minor

* minor
@surangap surangap marked this pull request as ready for review November 5, 2024 23:38
@surangap surangap merged commit 770f9ae into main Nov 6, 2024
2 checks passed
@surangap surangap deleted the feat/xrpl-nft-bridging branch November 6, 2024 21:45
@surangap surangap mentioned this pull request Nov 6, 2024
4 tasks
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