Giter Site home page Giter Site logo

connext / monorepo Goto Github PK

View Code? Open in Web Editor NEW
286.0 21.0 163.0 147.98 MB

Connext is a modular stack for trust-minimized, generalized communication between blockchains.

Home Page: https://docs.connext.network

License: MIT License

TypeScript 97.75% Solidity 1.82% JavaScript 0.01% Dockerfile 0.04% Shell 0.02% HCL 0.31% Smarty 0.01% Makefile 0.01% Nix 0.01% PLpgSQL 0.05%
ethereum interoperability crosschain protocol blockchain connext

monorepo's People

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

monorepo's Issues

[sdk] Don't expose direct connections to nats/auth when initializing sdk

Instead of these:

  • natsUrl: Optional. Override NATS URL otherwise connect to the main, global NATS cluster.
  • authUrl: Optional. Override auth URL otherwise connect to the main, global auth server.

We should just have a simple:

  • network: Optional. testnet or mainnet - defaults to mainnet.

Exposing nats/auth will not be backwards compatible when we move to more decentralized messaging and is unnecessary cognitive overhead for the developer.

[integration] Cleanup Task

At the end of all concurrency tasks there should be a process where the agents return the funds to the megalodon mnemonic

Blocked by #124

[sdk] Historical data

Expose a method to get historical data. This method should grab fulfilled transactions out of the subgraph. Need to apply filtering here as well.

[router] Config Unit Test

  describe.skip("getEnvConfig", () => {
    it("should read config from default filepath", () => {});
    it("should read config from specified filepath", () => {});
    it("should read config config env var", () => {});
    it("should read individual env vars", () => {});
    it("should preserve the order of specificity (individual env vars > env var config > specified config path > default config path", () => {});
  });
  describe.skip("getConfig", () => {
    it("should getEnvConfig", () => {});
    it("should return from cache", () => {});
  });
});```

[txservice] Signer passed into txservice can be used outside of NonceManager wrapped instance.

Currently, in order to instantiate TransactionService, it is required to pass in a signer of type string | Signer.

Assuming that a Signer instance is passed in, one could potentially use that instance to do sign / send transactions outside of TransactionService. This would amount to the instance being used outside of the instance inside of TransactionService, which is wrapped in a NonceManager (from ethers docs: NonceManager). See packages/txservice/src/provider.ts for details on NonceManager use case.

This potential vulnerability could cause the nonce to become out of sync, as NonceManager would be unaware of the sent transaction, and fail to increment the cached nonce. While this is generally unlikely since nonce manager seems to always compare its cache to the nonce on-chain, it's still possible for it to cause issues, as this edge case would render NonceManager ineffective at what it does best: keep an accurate cache of the nonce.

Potential solutions:
1: Enforce ethers Signer class is not used anywhere in NXTP, and only private key strings are passed into TransactionService - the only place where Signers should actually be instantiated.
2: Create a "fake" Signer class in utils that behaves like a Signer, holds private key, etc; but is unable to connect to a provider or sign / send transactions. This fake Signer would be used everywhere in NXTP (potentially even implemented in the case of HSM, etc) and passed into TransactionService on init, where it would be "remade" into a real Signer wrapped by a NonceManager.
3: Embrace this vulnerability and expose an interface for manually incrementing the nonce. (Politely) ask user of class to call this method whenever operations are done using the Signer outside of TransactionService.

[txservice] Load testing local chain

Load tests for txservice should basically execute as many (simple) tx's as possible on a live test chain, and give us a metric to see how many tx's we can manage at once.

[integration] Funding config

Should be easier to track a single mnemonic that will add routers/assets and hold all testnet funds.

Each person can have their own funder mnemonic that pulls from this megalodon mnemonic

[router] Contract Unit test

  describe.skip("class TransactionManager", () => {
    it("happy: constructor", () => {});
    it("happy: constructor with optional config param", () => {});

    describe.skip("prepare", () => {
      it("should error if chainId is not supported in config", () => {});

      describe("should error if function encoding fails", () => {
        it("invalid user", () => {});
        it("invalid router", () => {});
        it("invalid sendingChainId", () => {});
        it("invalid sendingAssetId", () => {});
        it("invalid receivingChainId", () => {});
        it("invalid receivingAssetId", () => {});
        it("invalid sendingChainFallback", () => {});
        it("invalid callTo", () => {});
        // receivingAddress
        // callDataHash
        // transactionId
        // amount
        // expiry
        // encryptedCallData
        // encodedBid
        // bidSignature
      });

      it("should error if transaction fails", () => {});
      it("happy case: prepare erc20", () => {});
      it("happy case: prepare native", () => {});
    });

    describe.skip("fulfill", () => {
      it("should error if chainId is not supported in config", () => {});
      describe("should error if function encoding fails", () => {});
      it("should error if transaction fails", () => {});
      it("happy case: fulfill erc20", () => {});
      it("happy case: fulfill native", () => {});
    });
    describe.skip("cancel", () => {
      it("should error if chainId is not supported in config", () => {});
      describe("should error if function encoding fails", () => {});
      it("should error if transaction fails", () => {});
      it("happy case: cancel erc20", () => {});
      it("happy case: cancel native", () => {});
    });
    describe.skip("removeLiquidity", () => {
      it("should error if chainId is not supported in config", () => {});
      describe("should error if function encoding fails", () => {});
      it("should error if transaction fails", () => {});
      it("happy case: removeLiquidity erc20", () => {});
      it("happy case: removeLiquidity native", () => {});
    });
    describe.skip("getRouterBalance", () => {
      it("should error if chainId is not supported in config", () => {});
      describe("should error if function encoding fails", () => {});
      it("should error if read transaction fails", () => {});
      it("happy case: getRouterBalance erc20", () => {});
      it("happy case: getRouterBalance native", () => {});
    });
  });
});

[contracts] Test TODOs

  • Transaction manager reentrant/rebasing cases
  • Calldata assertion on reverts for fulfill helper

[txservice] Confirmations not accepted in config

Txservice seems to hardcode the confirmations to wait to 1. This should be a configurable option, per chain. The router already has a config option for confirmations, so this should be passed through to the tx service.

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.