connext / monorepo Goto Github PK
View Code? Open in Web Editor NEWConnext is a modular stack for trust-minimized, generalized communication between blockchains.
Home Page: https://docs.connext.network
License: MIT License
Connext is a modular stack for trust-minimized, generalized communication between blockchains.
Home Page: https://docs.connext.network
License: MIT License
Figure out how to handle receiver side cancellations if there is never a fulfill
prepare
handlerfulfill
handlerError comes back as "execution reverted: #p:013", handle this properly by cancelling sender side.
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.
We shouldn't require that users need to plug this in. Should default to something sane.
Potentially solved via #137 bid validation
swapPool
includes all assets/chains in swap.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
Need to:
Expose a method to get historical data. This method should grab fulfilled transactions out of the subgraph. Need to apply filtering here as well.
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", () => {});
});
});```
Track auction amounts offchain
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.
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.
May not be great formatting, but investigate using TSDoc to add API-level documentation
Auctions need to have expiries.
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
Keeping naming consistent is important.
Fix declare const ethereum
typing (should the sdk be usable in a node-only env)
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", () => {});
});
});
});
Modules to be documented (in priority order):
As part of our launch goals, we have to bring this package's unit tests up to at least 70% code coverage (% Lines).
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.
Need a UI to provide router liquidity easily.
Error is P:015.
Blocked by #102
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.