integritee-network / parachain

Integritee parachain
GNU General Public License v3.0
10 stars 8 forks source link

enable TEER on Asset Hub and KSM on self #271

Closed brenzi closed 9 months ago

brenzi commented 9 months ago

closes #268 closes #272

this enables

strategy:

regression testing:

testing

zombienet

zombienet-linux-x64 spawn --provider native zombienet/rococo-local-with-integritee-and-asset-hub.toml
./scripts/hrmp-helper.sh 

send ROC between Relay <> Integritee

note preimage to register ROC as an asset on Integritee, set metadata and register its multilocation

execution should result in Events:

if testing with polkadot >= 1.7 binaries, need to downgrade safeXcmVersion to V3 on relaychain

  1. transfer 10.0 ROC from relay to itee
  2. send 2.0 ROC form Alice to Bob on itee
  3. send 0.1 ROC from Bob on itee to Bob_stash on relay

send TEER to Asset Hub

send 1 ROC to sovereign account 2015 on AH

note preimage to register TEER as foreign asset on Asset Hub

you should see these events on AH

teleport 1 TEER from Alice@Integritee to Alice@AH (and attach 1mROC to pay fees on AH)

this should result in events

what also works:

transfer 100mROC from Alice on Integritee to Alice on AH

send TEER back

send 10 TEER to AH sibling account on integritee to pay XCM fees

teleport 200mTEER from alice on AH to Charlie on Integritee

you should see balances.Endowedevent or, if the recipient exists, balances.Deposit (hidden in system events. check block!)

fees

Fees are quite complex to understand with XCM.

use ./scripts/dump-essential-balances.sh to compare pre/post balances

XCM 10 ROC from Alice on Rococo to Alice on Integritee

Alice ROC@Rococo: -10.000261339136 ROC Alice ROC@Integritee + 9.999650000000 ROC Parachain2015 ROC@Rococo + 10.0 ROC TotalIssuanceROC@Integritee + 9.999650000000 ROC fees: Alice pays

XCM 1 ROC from Alice on Integritee back to Alice on Rococo

TotalIssuanceTEER@Integritee: -165.755830 uTEER (burned fees 99%) TotalIssuanceROC@Integritee: -1.000000000000 ROC Treasury@Integritee: +1.674301 uTEER (fees 1% share) Alice ROC@Rococo: + 0.999989698944 ROC Alice TEER@Integritee: -167.430131 uTEER Alice ROC@Integritee: -1.0 ROC Parachain2015@Rococo: -1.0 ROC

fees: Alice pays:

Teleport 1 TEER from Alice on Integritee to Alice on Asset Hub

TotalIssuance@Integritee: -1.000176638369 TEER TotalIssuanceROC@Integritee: -1.0 mROC Treasury@Integritee: +1.784225 uTEER (which means ~1% of fee to treasury, 99% burned) Alice TEER@Integritee: -1000178422594 TEER Alice TEER@AssetHub: +1.0 TEER Alice ROC@AssetHub: + 0.964070016 mROC (refunded reminders after paying fee) Alice ROC@Integritee: -1.0 mROC Alice ROC@Rococo: +-0.0 Parachain2015@AssetHub: -1.0mROC

fees: Alice pays 178uTEER (on Integritee) + 36uROC (on AH)

Integritee Sovereign plays the broker and must balance its SovereinAccount manually! Send 1mROC from Integritee to AssetHub.

Teleport 200 mTEER from Alice on Asset Hub to Alice on Integritee

TotalIssuance@Integritee: + 200.0 mTEER Alice ROC@AssetHub: - 145.180672 uROC Alice TEER@AssetHub: -200mTEER Alice TEER@Integritee: +199.650000000mTEER Treasury@Integritee: + 350.0uTEER (fee burning not (yet) applied for XCM. all to treasury)

fees: Alice pays: 145uROC + 350uTEER

brenzi commented 9 months ago

regression testing with chopsticks:

start chopsticks xcm npx @acala-network/chopsticks@latest xcm --p=karura --p=../../chopsticks/configs/integritee-kusama.yml where that yml file overrides wasm to local build

  1. send 10 TEER to Karura (verify spec version is 48)
  2. send 1 TEER back from Karura

:+1: