Giter Club home page Giter Club logo

manta's Introduction

github-banner

License: GPL v3 Tests on manta Twitter Discord Forum Telegram Medium

Manta is the privacy layer for Web 3. Manta's goal is to protect Web 3 users' fundamental privacy from the first principle.

Disclaimer: The code currently hasn't been properly security audited (work in progress), use it at your own risk.

๐Ÿ‘‰ Learn more about Manta Network.
๐Ÿ‘‰ Check out our technical documentation.
๐Ÿ‘‰ Get involved in Manta Community.

Manta/Calamari

This is the mono-repo for Manta/Calamari nodes.

  • Manta: Manta's Polkadot parachain network
  • Calamari: Manta's canary network on Kusama
  • Dolphin: Manta's testnet

Build Manta/Calamari Node

  1. Setup environment
chmod u+x ./scripts/init.sh
./scripts/init.sh
  1. Build node binary in production setting
cargo b --profile production

Tips: The binary will be generated under target/production/manta. For less performance critical build, cargo build --release is recommended for faster build time.

  1. Run standalone dev chain, useful for local development
cargo run -- --chain=calamari-localdev --alice --tmp

Tip: The chain only produces blocks when you submit extrinsics

Semantic Versioning

Manta/Calamari's version number: v<x>.<y>.<z>

where:

  • <x> is the major version, i.e. major product release.
  • <y> is the middle version, i.e. adding major features.
  • <z> is the minor version, i.e. performance improvement and bug fixes.

Contributing

  • please submit your code through PR.
  • please run cargo +nightly fmt before pushing your code.

Minimum supported rust compiler

This project's MSRV is rustc 1.74

manta's People

Contributors

anaye1997 avatar apokalip avatar bhgomes avatar boyuanfeng avatar codecarrier1 avatar danielzhangreal avatar dengjianping avatar dependabot[bot] avatar dziabko avatar ferrell-code avatar flame4 avatar ghzlatarev avatar grenade avatar rishabhfsd avatar stechu avatar supremough avatar xialovexia avatar xiaolou86 avatar xiaoxianboy avatar zhenfeizhang avatar zqhxuyuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

manta's Issues

Genesis Error

docker run mantanetwork/manta:latest --chain manta-testnet --name "ILoveManta"

Error Message:

2021-05-11 17:03:59 Manta Node    
2021-05-11 17:03:59 โœŒ๏ธ  version 3.0.0-a4f9599-x86_64-linux-gnu    
2021-05-11 17:03:59 โค๏ธ  by Manta Network, 2020-2021    
2021-05-11 17:03:59 ๐Ÿ“‹ Chain specification: Manta Testnet    
2021-05-11 17:03:59 ๐Ÿท Node name: ILoveManta    
2021-05-11 17:03:59 ๐Ÿ‘ค Role: FULL    
2021-05-11 17:03:59 ๐Ÿ’พ Database: RocksDb at /manta/.local/share/manta/chains/manta_testnet/db    
2021-05-11 17:03:59 โ›“  Native runtime: manta-node-1 (manta-node-1.tx1.au1)    
2021-05-11 17:03:59 ๐Ÿ’ธ Chain does not have enough staking candidates to operate. Era Some(0).    
2021-05-11 17:03:59 ๐Ÿ’ธ Chain does not have enough staking candidates to operate. Era Some(1).    
2021-05-11 17:03:59 ๐Ÿ”จ Initializing Genesis block/state (state: 0xf33fโ€ฆcf5e, header-hash: 0xcf48โ€ฆ5fac)    
2021-05-11 17:03:59 ๐Ÿ‘ด Loading GRANDPA authority set from genesis on what appears to be first startup.    
2021-05-11 17:04:00 โฑ  Loaded block-time = 6000 milliseconds from genesis on first-launch    
2021-05-11 17:04:00 ๐Ÿ‘ถ Creating empty BABE epoch changes on what appears to be first startup.    
2021-05-11 17:04:00 ๐Ÿท Local node identity is: 12D3KooWFThfD6abhgSVwPquvj589GVwD8EuCpy5p9ZuFrC21844    
2021-05-11 17:04:00 ๐Ÿ“ฆ Highest known block at #0    
2021-05-11 17:04:00 ใ€ฝ๏ธ Prometheus server started at 127.0.0.1:9615    
2021-05-11 17:04:00 Listening for new connections on 127.0.0.1:9944.    
2021-05-11 17:04:00 ๐Ÿ” Discovered new external address for our node: /ip4/184.189.221.18/tcp/30333/p2p/12D3KooWFThfD6abhgSVwPquvj589GVwD8EuCpy5p9ZuFrC21844    
2021-05-11 17:04:00 Bootnode with peer id `12D3KooWSBpCHCHi4jmwJTkdMmb7vWBBjPJnoGsRE1VwERMTgvVD` is on a different chain (our genesis: 0xcf48โ€ฆ5fac theirs: 0xbad0โ€ฆ128d)    
2021-05-11 17:04:00 Bootnode with peer id `12D3KooWBV7qb2LshmqCr74edBk5h4Fi1Zt71fhpvdyi8ah3KzAa` is on a different chain (our genesis: 0xcf48โ€ฆ5fac theirs: 0xbad0โ€ฆ128d)    
2021-05-11 17:04:00 Bootnode with peer id `12D3KooWBGhNQyzkKEpN7QQnP94BhM8wyhpJwsZ58wbr1r3Pi6gV` is on a different chain (our genesis: 0xcf48โ€ฆ5fac theirs: 0xbad0โ€ฆ128d)    
2021-05-11 17:04:01 Bootnode with peer id `12D3KooWNkupfxbGwPLBhkXLV7c9P2cGHm8JbGadSXQG854F2nrM` is on a different chain (our genesis: 0xcf48โ€ฆ5fac theirs: 0xbad0โ€ฆ128d)

We need utility pallet

I found that we don't include utility pallet which is very useful for sending multiple transactions at one time.
We just need it.

XCM - Shawn - CannotReachDestination Error

Manta - https://github.com/Manta-Network/Manta/blob/ghzlatarev/manta-pc-xcm-1/pallets/manta-xassets/src/lib.rs#L77
Polkadot - 91626111136243164792067392b110d84a129145

https://github.com/Manta-Network/Manta/wiki/Manta-Parachain-with-XCMP

Message composition is on the front-end.
Trying to do a transfer via reserer from Alice on Parachain_A to Bob on Parachain_B in the following format:

Alice.WithdrawAsset {
 assets: [ ConcreteFungible { id: X1(Parent) ,amount: 123456 } ],
    effects: [ InitiateReserveWithdraw {
        assets: [All],
        reserve: X1(Parent),
        effects: [ DepositReserveAsset {
            assets: [All],
            dest:  X1(Parachain(PARACHAIN_B),
            effects: [ DepositAsset {
                dest: X1(AccountId32(BOB)),
                assets: [All],
            } ]
        } ]
    } ]
 }

Getting an error: CannotReachDestination(X1(AccountId32 { network: Any, id: BOB }))
Does the format look correct for the use-case ? It is very much like the example here - https://github.com/paritytech/xcm-format

Remove pallet-parachain-info from source dependency

Ideally, pallet-parachain-info should not be a source dependency, however, it is impossible to remove now since the the current cumulus and polkadot codebase is not compatible.

Should revisit once parity makes cumulus compatible with polkadot.

Code Refactor

  • move all the related constants to primitive crate.

XCM - Shawn - Transfer extracted but not received problem #88

Manta - https://github.com/Manta-Network/Manta/blob/manta-pc-jamie/pallets/manta-xassets/src/lib.rs#L99
Polkadot - 91626111136243164792067392b110d84a129145

https://github.com/Manta-Network/Manta/wiki/Manta-Parachain-with-XCMP

The message is defined in the call, attempting to send tokens from Alice on Parachain_A to Bob on Parachain_B
let xcm_outcome = T::XcmExecutor::execute_xcm_in_credit() returns Complete(2000000000)
Tokens get withdrawn from Alice on Parachain A, but Bob doesn't receive anything.

Manta Testnet Launch Tracking

Major Milestones

  • Testnet V1 (Internal): May 9
  • Testnet V2 (Internal Feature Ready): May 16
  • Testnet V3 (Public Alpha): May 25

Breakdowns

  • V1: Pallet-Asset configuration (#11) [Zhenfei]
  • V1: Vanilla manta node implementation (#10) [Shumo]
  • V1: SS58 registration, PR to substrate repo (paritytech/substrate#8706) [Shumo]
  • V1: Vanilla manta node unit test [Shumo, May 1]
  • V1: Testnet depolymnet
    • get shared secret mechanism for certification (possibly using AWS: I AM ROLE)
    • get toy network running on AWS including wss access point
    • Validator/Archieval Node (block explorer will have acess to the archieval node)
    • Staking: set session key
    • wss acess point and certificate (ws.testnet.manta.network)
  • V1: genesis configuration [Jamie, Shumo, Apr 30]
    • controller, stash, grandpa, babe keys for boot nodes
    • key store configuration
  • V1: Basic CI/CD [Georgi]
  • V2: show MA token symbol in polkadot.js APP
  • V2: a new website [Team figure out the idea, Kenny hire a external company]
  • V2: new document section in the website, should be generated from markdown file, and then host it at docs.manta.network [Rob]
  • V2: dockerize (#14) [Jamie]
  • V2: Subscan.io
    • business contact with subscan.io
    • provide type.json
    • RPC node, exposing wss port
  • V2: Integration/Deployment test [Everyone!, Rob lead on the deployment test]
    • deploy manta successfully on Cloud [Shumo, Georgi, Rob]
    • grow / shrink validators
    • validator nomination
    • network partition (pull off power of some node randomly)
  • V2: Vanilla manta node code internal audit [Everyone]
  • V2: dashboard to monitoring testnet status (Prometheus configuration)
  • V2: code auditors to schedule meeting [Zhenfei]
  • V2: Node configuration [Jamie, Shumo, Rob]
    • full node (just keep ~100 blocks)
    • validator node (running consensus)
    • archival node (connect to subscan.io)
  • V2: Cluster configuration (5 first, scale to 21) [Jamie, Shumo, Rob]
  • V2: Manta-Pay Integration
  • V2: Front-end/Client support for Manta-Pay
  • V2: Front end UX/UI [Kevin]
  • V2: Connect to a wallet

CollatorSelection Usage

For now, we just included that pallet collator-selection from statemint, but we didn't try to register a collator node by this pallet, and after the registration, this node should produce blocks.
Better write down a document which tells how to register a collator node.

Add pallet scheduler

This pallet is very essential for scheduling a call, especially like do runtime upgrade.

ORML Types

runtimes/manta-pc/primitives/src/lib.rs
pub type Amount = i128; should revisit.

CI/CD

Put CI/CD in the pipeline.

XCM - Shawn - Agenda

List of things we can discuss with Shawn during our meeting.

Suppose Manta para id is 6666.
The primary goal is to clarify the concepts. We can walk through the following examples:

  1. Relay chain user Alice sends Manta PC 10 DOT. And Manta PC give Alice 10 pDOT.
    Answer: The process is:
    a. Withdraw 10DOT from Alice at relaychain.(on relaychain)
    b. Deposit 10DOT to sovereign account which is represent as para id 6666.(on relaychain)
    c. ExchangeAsset DOT to pDOT
    d Send rest of dm(downward message) to Manta parachain.(on Manta)
    • DepositReserveAsset to holding account on destination chain
    • DepositAsset to actual account on destination chain
Xcm::WithdrawAsset {
 assets: vec![MultiAsset::ConcreteFungible {
   id: MultiLocation::X1(Junction::Parent)
   amount,
 }],
 effects: vec![
  Order::ExchangeAsset {
      give: vec![MultiAsset::All],
      receive: [pDOT],
  },
  Order::DepositReserveAsset {
   assets: vec![MultiAsset::All],
   dest: MultiLocation::X2(Junction::Parent, Junction::Parachain(6666)),
   effects: vec![
         Order::DepositAsset {
           assets: vec![MultiAsset::All],
           dest: X1(Junction::AccountId32(BOB)),
         }
      ],
  }],
};

Questions:
Q1: What is the real job for sovereign account?
Q2: If this account holds the DOT, is it safe? And this account is public? I mean whether user can query some information from this account.
Q3: Where to "deposit" DOT for Alice on parachain? pallet-assets? Or my own assets module?
Q4: Is the format this dm(downward message) correct? Is the use of ExchangeAsset order correct? Any other corrections?
Q5: What would be the actual format for this line receive: [pDOT],

  1. Relay chain user Alice claim 10 DOT from Manta PC (require Manta PC send 10 DOT from the pool to Alice).
    Answer: The process is:
    a. Withdraw 10 DOT from Alice at parachain.(on Manta)
    b. Send um(upward message) to relaychain, "withdraw" 10 DOT from sovereign account(6666).(on relaychain)
    c. Deposit 10 DOT for Alice.(on relaychain)
    Questions:
    Q1: What is the format of this um(upward message)?

  2. Acala PC user Aaron send 10 ACA to Manta PC's user Matt.
    Answer: The process is:
    a. Withdraw 10 ACA from Alice at Acala.(on Acala)
    b. Deposit 10 ACA to sovereign account which is represent as para id 6666.(on Acala)
    c. Send rest of xcm to Manta parachain.(on Acala)
    d. Deposit 10 ACA to the dest account on Manta.(on Manta)
    Questions:
    Q1: What is the format of this xcm?

How should we construct the XCM messages in these scenarios.

Some more detailed questions:

  1. Read and interpret examples in the guides to make sure we understand the concepts.
    1.1: https://hackmd.io/S4TZc1uTQH-vxEWv-QFapg#Polkadot-Messaging-Guide
    1.2: https://github.com/paritytech/xcm-format
    1.3: Interpret our own working format for sending DOT from Alice on Parachain 6666 to Bob on Parachain 7777

    Xcm::WithdrawAsset {
     assets: vec![MultiAsset::ConcreteFungible {
       id: MultiLocation::X2(Junction::Parent, Junction::Parachain(6666)),
       amount,
     }],
     effects: vec![Order::DepositReserveAsset {
       assets: vec![MultiAsset::All],
       dest: MultiLocation::X2(Junction::Parent, Junction::Parachain(u32::from(7777))),
             Order::DepositAsset {
               assets: vec![MultiAsset::All],
               dest: X1(Junction::AccountId32(BOB)),
             }
          ],
      }],
    };
    
  2. Clarify some concepts like - "holding" , "reserve accounts", "sovereign account" etc.
    In the context of DepositReserveAsset is reserve meant as sovereign account or as reserve currency ?

  3. Clarify the Invalid justification error we keep getting, which stalls block production on parachains, but then resumes.

  4. Demo #88
    Compose specific messages through the front end.
    Walk through the code on the back-end to make sure there are no configuration mistakes.

  5. Demo #89
    Why is message reported as complete when receiver gets nothing ?

  6. Are there better ways to debug XCM ?
    Debugger, attach to process ?

  7. TooExpensive issue.
    While add order BuyExecution in xcm, it will report error TooExpensive from front-end. Does it mean the weight of xcm is too heavy to execute on parachain. But after I remove this order, and implement trait ShouldExecute, it works with a proper weight I input. Is there any better way to handle the weight of xcm?

Set up integration tests

Can help with:

  • Breaking changes from pallets
  • Breaking changes from nightly rust
  • Prototype it for the runtime node then implement for the other repositories.

Equivocation Error

Error from testnet running log:

2021-05-10 05:36:18 Error reporting prevote equivocation: Safety("Refraining from sending equivocation report for our own equivocation.")

Setup CI/CD for manta-pc

For now, manta-pc branch is not capable of CI/CD.
The major reason is the excessive usage of disk space (40 GB).
We probably need a better CI/CD backend.

Test Coverage for all repos.

  • manta-node
    • service.rs
    • rpc.rs
    • command.rs
  • manta-app
  • manta-api
    • circuit.rs
    • payload.rs
    • gadget.rs
  • manta-subxt
  • manta-crypto
    • commitment.rs
    • checksum.rs
    • merkle_tree.rs
  • manta-error
    • lib.rs
  • manta-asset
    • processing.rs
    • serdes.rs
    • sanity.rs
  • manta-data
    • default.rs
    • metadata.rs
    • sanity.rs
    • serdes.rs
    • zkp.rs
  • manta-ledger
    • lib.rs

Automate the runtime benchmark process

  1. Run a build script
    2. Run the benchmark command
    3. Copy the fife

Some open questions:
Do we automate pushing into git? Can we automate for both the manta-runtime and manta-pay repositories simultaneously ?
Is this triggered when merging a branch?
Or do we run a single script manually, from scripts folder?

Remove clippy warnings

When I tried clippy check, there're some clippy warnings, we need to make clippy happy.

cargo +nightly clippy

And we might have a new convention that developers need do clippy check before push code.
And clippy can teach us how to write elegant code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.