Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Commit

Permalink
Deploy indra-7.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Sethuram committed Aug 24, 2020
2 parents 8eb86b6 + fca3b53 commit 1168a9d
Show file tree
Hide file tree
Showing 158 changed files with 2,563 additions and 1,568 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ test-tps: bot
bash ops/test/tps.sh 5 0 10

test-tps-prod:
bash ops/test/tps.sh 5 0 10
INDRA_ENV=prod bash ops/test/tps.sh 3 0 10

test-integration: test-runner
bash ops/test/integration.sh
Expand Down Expand Up @@ -269,7 +269,7 @@ apps: types utils contracts cf-core $(shell find modules/apps $(find_options))
$(docker_run) "cd modules/apps && npm run build"
$(log_finish) && mv -f $(totalTime) .flags/$@

client: types utils channel-provider messaging store contracts cf-core apps $(shell find modules/client $(find_options))
client: types utils channel-provider messaging store contracts cf-core apps watcher $(shell find modules/client $(find_options))
$(log_start)
$(docker_run) "cd modules/client && npm run build"
$(log_finish) && mv -f $(totalTime) .flags/$@
Expand All @@ -289,7 +289,7 @@ bot-bundle: types utils channel-provider messaging store contracts cf-core apps
$(docker_run) "cd modules/bot && npm run build"
$(log_finish) && mv -f $(totalTime) .flags/$@

node-bundle: types utils messaging store contracts cf-core apps client $(shell find modules/node $(find_options))
node-bundle: types utils messaging store contracts cf-core apps watcher client $(shell find modules/node $(find_options))
$(log_start)
$(docker_run) "cd modules/node && npm run build && touch src/main.ts"
$(log_finish) && mv -f $(totalTime) .flags/$@
Expand Down
1 change: 0 additions & 1 deletion dev.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export INDRA_ADMIN_TOKEN="cxt1234"
export INDRA_LOG_LEVEL="3"
export INDRA_NATS_JWT_SIGNER_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----MIIEowIBAAKCAQEAqU/GXp8MqmugQyRk5FUFBvlJt1/h7L3Crzlz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HAcaHp2qI1qhIYOAWbov5zemvNegH5Vzrb5Yd40VPvd1s2c3csPfW0ryQ+PItFd8BkWvl8EQQEcf04KmNE3fF/QP2YFKvR30z3x5LKAT08yqEuYp9oC8QKBgQCfc9XqGU3bEya3Lg8ptt0gtt2ty6xiRwSvMoiKeZCkgdpbH6EWMQktjvBD/a5Q+7KjjgfD54SMfj/lEPR1R9QTk8/HeTUWXsaFaMVbtQ0zSEm/Xq1DLTrUo8U9qmJCK0gA10SZwe9dGctlF36k8DJMpWjd2QYkO2GVthBld4wV3wKBgC7S4q0wmcrQIjyDIFmISQNdOAJhR0pJXG8mK2jECbEXxbKkAJnLj73DJ+1OVBlx4HXx54PiEkV3M3iTinf5tBSi8nA2D3s829F65XKFli1RC4rJv+2ygH8PnXX9rQKhK/v6/jeelKquH8zy894hLZe7feSsWV9GMgb5l9p+UzWB-----END RSA PRIVATE KEY-----"
export INDRA_NATS_JWT_SIGNER_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqU/GXp8MqmugQyRk5FUFBvlJt1/h7L3Crzlzejz/OxriZdq/lBNQW9S1kzGc7qjXprZ1Kg3zP6irr6wmvP0WYBGltWs2cWUAmxh0PSxuKdT/OyL9w+rjKLh4yo3ex6DX3Ij0iP01Ej2POe5WrPDS8j6LT0s4HZ1FprL5h7RUQWV3cO4pF+1kl6HlBpNzEQzocW9ig4DNdSeUENARHWoCixE1gFYo9RXm7acqgqCk3ihdJRIbO4e/m1aZq2mvAFK+yHTIWBL0p5PF0Fe8zcWdNeEATYB+eRdNJ3jjS8447YrcbQcBQmhFjk8hbCnc3Rv3HvAapk8xDFhImdVF1ffDFwIDAQAB-----END PUBLIC KEY-----"
6 changes: 3 additions & 3 deletions modules/apps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/apps",
"version": "7.3.2",
"version": "7.3.7",
"description": "Connext Counterfactual Apps",
"main": "dist/index.js",
"module": "dist/index.esm.js",
Expand All @@ -19,8 +19,8 @@
},
"devDependencies": {
"@connext/contracts": "3.5.0",
"@connext/types": "7.3.2",
"@connext/utils": "7.3.2",
"@connext/types": "7.3.7",
"@connext/utils": "7.3.7",
"@rollup/plugin-json": "4.1.0",
"ethers": "5.0.8",
"rollup": "2.23.0",
Expand Down
8 changes: 4 additions & 4 deletions modules/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"author": "",
"license": "ISC",
"dependencies": {
"@connext/client": "7.3.2",
"@connext/client": "7.3.7",
"@connext/contracts": "3.5.0",
"@connext/store": "7.3.2",
"@connext/types": "7.3.2",
"@connext/utils": "7.3.2",
"@connext/store": "7.3.7",
"@connext/types": "7.3.7",
"@connext/utils": "7.3.7",
"axios": "0.19.2",
"body-parser": "1.19.0",
"ethers": "5.0.8",
Expand Down
2 changes: 1 addition & 1 deletion modules/bot/src/agents/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class Agent {
assetId: Address = AddressZero,
id: string = getRandomBytes32(),
type: ConditionalTransferTypes = ConditionalTransferTypes.GraphTransfer,
timeout: number = 10_000,
timeout: number = 15_000,
) {
const params = await this.getTransferParameters(
receiverIdentifier,
Expand Down
2 changes: 1 addition & 1 deletion modules/bot/src/agents/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const startBot = async (
txTimestamps: number[];
}> => {
const NAME = `Bot #${concurrencyIndex}`;
const log = new ColorfulLogger(NAME, logLevel, true, concurrencyIndex);
const log = new ColorfulLogger(NAME, 3, true, concurrencyIndex);
log.info(`Launched ${NAME}, paying in ${tokenAddress}`);
const TRANSFER_AMT = parseEther("0.001");
const DEPOSIT_AMT = parseEther("0.01"); // Note: max amount in signer address is 1 eth
Expand Down
8 changes: 4 additions & 4 deletions modules/cf-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/cf-core",
"version": "7.3.2",
"version": "7.3.7",
"main": "dist/index.js",
"iife": "dist/index.iife.js",
"types": "dist/index.d.ts",
Expand All @@ -20,8 +20,8 @@
"dependencies": {
"@connext/contracts": "3.5.0",
"@connext/pure-evm-wasm": "0.1.4",
"@connext/types": "7.3.2",
"@connext/utils": "7.3.2",
"@connext/types": "7.3.7",
"@connext/utils": "7.3.7",
"@openzeppelin/contracts": "3.0.2",
"async-mutex": "0.2.4",
"ethers": "5.0.8",
Expand All @@ -32,7 +32,7 @@
},
"devDependencies": {
"@babel/core": "7.11.1",
"@connext/store": "7.3.2",
"@connext/store": "7.3.7",
"@ethereum-waffle/chai": "3.0.2",
"@types/chai": "4.2.12",
"@types/chai-as-promised": "7.1.3",
Expand Down
8 changes: 4 additions & 4 deletions modules/cf-core/src/methods/app-instance/take-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
STATE_OBJECT_NOT_ENCODABLE,
NO_APP_INSTANCE_FOR_GIVEN_HASH,
NO_STATE_CHANNEL_FOR_APP_IDENTITY_HASH,
NO_APP_IDENTITY_HASH_IN_PARAMS,
NO_MULTISIG_IN_PARAMS,
} from "../../errors";
import { ProtocolRunner } from "../../machine";
import { StateChannel } from "../../models/state-channel";
Expand All @@ -37,10 +37,10 @@ export class TakeActionController extends MethodController {
requestHandler: RequestHandler,
params: MethodParams.TakeAction,
): Promise<string[]> {
if (!params.appIdentityHash) {
throw new Error(NO_APP_IDENTITY_HASH_IN_PARAMS(params));
if (!params.multisigAddress) {
throw new Error(NO_MULTISIG_IN_PARAMS(params));
}
return [params.appIdentityHash];
return [params.multisigAddress];
}

protected async beforeExecution(
Expand Down
8 changes: 7 additions & 1 deletion modules/cf-core/src/methods/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,13 @@ export abstract class MethodController {
},
preProtocolStateChannel,
);
log.debug(`Channel synced, retrying ${this.methodName} with ${channel.toJson()}`);
log.debug(
`Channel synced, retrying ${this.methodName} with ${stringify(
channel.toJson(),
true,
0,
)}`,
);
result = await this.beforeExecution(requestHandler, params, channel);
// if result exists, the operation is a no-op (i.e. already been done)
result =
Expand Down
4 changes: 2 additions & 2 deletions modules/channel-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/channel-provider",
"version": "7.3.2",
"version": "7.3.7",
"description": "Channel Provider module for Connext client",
"main": "dist/index.js",
"files": [
Expand All @@ -16,7 +16,7 @@
"test": "./node_modules/.bin/ts-mocha --watch"
},
"dependencies": {
"@connext/types": "7.3.2",
"@connext/types": "7.3.7",
"eventemitter3": "4.0.4"
},
"devDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions modules/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/client",
"version": "7.3.2",
"version": "7.3.7",
"description": "Client for Connext Network",
"main": "dist/index.js",
"files": [
Expand All @@ -16,14 +16,14 @@
},
"dependencies": {
"axios": "0.19.2",
"@connext/apps": "7.3.2",
"@connext/cf-core": "7.3.2",
"@connext/channel-provider": "7.3.2",
"@connext/utils": "7.3.2",
"@connext/apps": "7.3.7",
"@connext/cf-core": "7.3.7",
"@connext/channel-provider": "7.3.7",
"@connext/utils": "7.3.7",
"@connext/contracts": "3.5.0",
"@connext/messaging": "7.3.2",
"@connext/store": "7.3.2",
"@connext/types": "7.3.2",
"@connext/messaging": "7.3.7",
"@connext/store": "7.3.7",
"@connext/types": "7.3.7",
"core-js": "3.6.5",
"ethers": "5.0.8",
"evt": "1.8.4",
Expand Down
39 changes: 27 additions & 12 deletions modules/client/src/channelProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ import {
WalletDepositParams,
WithdrawalMonitorObject,
ConditionalTransactionCommitmentJSON,
ValidationMiddleware,
ProtocolName,
MiddlewareContext,
ProtocolNames,
ProposeMiddlewareContext,
UninstallMiddlewareContext,
InstallMiddlewareContext,
} from "@connext/types";
import {
deBigNumberifyJson,
Expand All @@ -46,6 +53,7 @@ export const createCFChannelProvider = async ({
logger,
store,
skipSync,
middlewareMap,
}: CFChannelProviderOptions): Promise<IChannelProvider> => {
let config: NodeResponses.GetConfig;
if (!node.config) {
Expand Down Expand Up @@ -97,20 +105,27 @@ export const createCFChannelProvider = async ({

const getLatestSwapRate = (from: string, to: string) => node.getLatestSwapRate(from, to);

// register any default middlewares
cfCore.injectMiddleware(
Opcode.OP_VALIDATE,
await generateValidationMiddleware(
{
[network.chainId]: {
contractAddresses,
provider: ethProvider,
},
const defaultMiddleware = await generateValidationMiddleware(
{
[network.chainId]: {
contractAddresses,
provider: ethProvider,
},
{ [network.chainId]: supportedTokenAddresses[network.chainId] },
getLatestSwapRate,
),
},
{ [network.chainId]: supportedTokenAddresses[network.chainId] },
getLatestSwapRate,
);
const validationMiddleware: ValidationMiddleware = async (
protocol: ProtocolName,
middlewareContext: MiddlewareContext,
) => {
await defaultMiddleware(protocol, middlewareContext);
if (middlewareMap) {
await middlewareMap[protocol](protocol, middlewareContext);
}
};
// register any default middlewares
cfCore.injectMiddleware(Opcode.OP_VALIDATE, validationMiddleware);

const connection = new CFCoreRpcConnection(cfCore, store, signer, node, logger);
const channelProvider = new ChannelProvider(connection);
Expand Down
6 changes: 3 additions & 3 deletions modules/client/src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const connect = async (
loggerService,
messagingUrl,
nodeUrl,
middlewareMap,
skipInitStore,
skipSync,
} = opts;
Expand Down Expand Up @@ -109,6 +110,7 @@ export const connect = async (
logger,
nodeUrl: channelProvider.config.nodeUrl,
channelProvider,
middlewareMap,
skipSync,
chainId,
});
Expand All @@ -120,9 +122,7 @@ export const connect = async (
}

signer =
typeof opts.signer === "string"
? new ChannelSigner(opts.signer, ethProvider)
: opts.signer;
typeof opts.signer === "string" ? new ChannelSigner(opts.signer, ethProvider) : opts.signer;

node = await NodeApiClient.init({
store,
Expand Down
4 changes: 3 additions & 1 deletion modules/client/src/controllers/CreateTransferController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
toBN,
stringify,
hashDomainSeparator,
getAddressFromAssetId,
getSignerAddressFromPublicIdentifier,
} from "@connext/utils";
import { constants, utils, BigNumber } from "ethers";
Expand All @@ -42,7 +43,8 @@ export class CreateTransferController extends AbstractController {
this.log.info(`conditionalTransfer started: ${stringify(params)}`);

const amount = toBN(params.amount);
const { meta, recipient, assetId } = params;
const { meta, recipient } = params;
const assetId = getAddressFromAssetId(params.assetId);
let conditionType = params.conditionType;

const submittedMeta = { ...(meta || {}) };
Expand Down
Loading

0 comments on commit 1168a9d

Please sign in to comment.