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

Commit

Permalink
Merge pull request #530 from omgnetwork/develop
Browse files Browse the repository at this point in the history
update master for 003 release!
  • Loading branch information
InoMurko authored Sep 24, 2021
2 parents 120fa06 + 86b0248 commit d543371
Show file tree
Hide file tree
Showing 75 changed files with 1,633 additions and 1,253 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/omgx-publish-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ jobs:
username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- uses: actions/checkout@v2

- name: Get yarn cache directory path
Expand Down Expand Up @@ -57,3 +64,9 @@ jobs:
echo "$1"
docker push "$i"
done
- name: Build and push docker images to AWS
working-directory: ./ops_omgx
run: |
rm -rf cloudformation/deployer-rinkeby.yaml cloudformation/dummy-transaction.yaml cloudformation/omgx-monitor.yaml cloudformation/blockexplorer-blockscout.yaml cloudformation/transaction-monitor.yaml
./cfn-devenv.sh push2aws --from-tag ${{ steps.tag.outputs.VERSION }} --deploy-tag ${{ steps.tag.outputs.VERSION }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ generated
packages/omgx/subgraph/L1/yarn.lock
packages/omgx/subgraph/L2/yarn.lock
packages/omgx/subgraph/L1/bin
packages/omgx/subgraph/L2/bin
packages/omgx/subgraph/L2/bin
10 changes: 0 additions & 10 deletions ops_omgx/api/watcher-api/env-mainnet.yml

This file was deleted.

10 changes: 0 additions & 10 deletions ops_omgx/api/watcher-api/env-rinkeby.yml

This file was deleted.

4 changes: 2 additions & 2 deletions ops_omgx/api/watcher-api/watcher_getL2CrossDomainMessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def watcher_getL2CrossDomainMessage(event, context):
crossDomainMessageSendTime = transactionDataRaw[8]
fastRelay = transactionDataRaw[11]
if fastRelay == True:
# Estimate time is 5 minutes
crossDomainMessageEstimateFinalizedTime = int(crossDomainMessageSendTime) + 60 * 5
# Estimate time
crossDomainMessageEstimateFinalizedTime = int(crossDomainMessageSendTime) + int(config.get('ESTIMATE_FINIALIZED_TIME'))
else:
# Estimate time is 7 days
crossDomainMessageEstimateFinalizedTime = int(crossDomainMessageSendTime) + 60 * 60 * 24 * 7
Expand Down
4 changes: 2 additions & 2 deletions ops_omgx/api/watcher-api/watcher_getL2Transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def watcher_getL2Transactions(event, context):
crossDomainMessageSendTime = transactionDataRaw[8]
fastRelay = transactionDataRaw[11]
if fastRelay == True:
# Estimate time is 5 minutes
crossDomainMessageEstimateFinalizedTime = int(crossDomainMessageSendTime) + 60 * 5
# Estimate time
crossDomainMessageEstimateFinalizedTime = int(crossDomainMessageSendTime) + int(config.get('ESTIMATE_FINIALIZED_TIME'))
else:
# Estimate time is 7 days
crossDomainMessageEstimateFinalizedTime = int(crossDomainMessageSendTime) + 60 * 60 * 24 * 7
Expand Down
33 changes: 9 additions & 24 deletions ops_omgx/cloudformation/blockexplorer-blockscout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ Resources:
BlockscoutLBTargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
Port: 80
Port: 4000
Protocol: HTTP
VpcId:
Fn::ImportValue: !Sub "${InfrastructureStackName}:VpcId"
TargetGroupAttributes:
- Key: deregistration_delay.timeout_seconds
Value: 30
HealthCheckIntervalSeconds: 20
HealthCheckPath: /health
HealthCheckPath: /
HealthCheckProtocol: HTTP # TODO Implement proper healthcheck
HealthCheckTimeoutSeconds: 5
HealthyThresholdCount: 2
Expand Down Expand Up @@ -213,6 +213,8 @@ Resources:
Value: ETH
- Name: NETWORK
Value: Boba
- Name: PORT
Value: 4000
- Name: SUBNETWORK
Value: Rinkeby
- Name: MIX_ENV
Expand All @@ -223,14 +225,14 @@ Resources:
Value: /images/boba_logo.svg
- Name: SUPPORTED_CHAINS
Value: '[{"title":"Boba Mainnet","url":"https://blockexplorer.boba.network","hide_in_dropdown?": false},{"title":"Boba Rinkeby","url":"https://blockexplorer.rinkeby.boba.network","test_net?":true},{"title":"Boba Rinkeby Integration","url":"https://blockexplorer.rinkeby-integration.boba.network","test_net?":true,"hide_in_dropdown?": true}]'
- Name: ETHEREUM_JSONRPC_HTTP_URL
- Name: ETHEREUM_JSONRPC_TRACE_URL
Value: !Sub
- "http://${EndpointAddress}:8545/rpc"
- "http://${EndpointAddress}:8545/"
- EndpointAddress:
Fn::ImportValue: !Sub "${InfrastructureStackName}:LoadBalancerReplica:DNSName"
- Name: ETHEREUM_JSONRPC_WS_URL
Value: !Sub
- "ws://${EndpointAddress}:8545/ws"
- "ws://${EndpointAddress}:8545/ws/"
- EndpointAddress:
Fn::ImportValue: !Sub "${InfrastructureStackName}:LoadBalancerReplica:DNSName"
- Name: BLOCKSCOUT_VERSION
Expand All @@ -243,23 +245,6 @@ Resources:
com.datadoghq.ad.logs: '[{"source": "blockscout", "service": "blockscout"}]'
Essential: true
Memory: "512"
- Image: 942431445534.dkr.ecr.us-east-1.amazonaws.com/omgx/nginx-eth-proxy:blockscout
Name: nginx-blockscout
PortMappings:
- ContainerPort: 80
HostPort: 0
Command:
- "nginx-debug"
- "-g"
- "daemon off;"
DockerLabels:
com.datadoghq.ad.check_names: '["nginx-blockscout"]'
com.datadoghq.ad.init_configs: '[{}]'
com.datadoghq.ad.logs: '[{"source": "nginx-blockscout", "service": "nginx-blockscout"}]'
Essential: true
Memory: "128"
Links:
- blockscout
NetworkMode: bridge
TaskRoleArn: !GetAtt TaskRole.Arn
Family: !Sub "blockscout-${EnvironmentName}"
Expand All @@ -270,8 +255,8 @@ Resources:
Cluster:
Fn::ImportValue: !Sub "${InfrastructureStackName}:EcsClusterReplica"
LoadBalancers:
- ContainerName: nginx-blockscout
ContainerPort: 80
- ContainerName: blockscout
ContainerPort: 4000
TargetGroupArn: !Ref BlockscoutLBTargetGroup
DesiredCount: !Ref ServiceCount
LaunchType: EC2
Expand Down
3 changes: 2 additions & 1 deletion ops_omgx/cloudformation/replica-l2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Resources:
ContainerDefinitions:
- Image: !Sub "${ECRRegistry}/${DockerPrefix}/${ReplicaL2Image}:${ImageTag}"
Name: geth_l2
Hostname: geth-l2
PortMappings:
- ContainerPort: 8545
HostPort: 0
Expand Down Expand Up @@ -175,7 +176,7 @@ Resources:
- EndpointAddress:
Fn::ImportValue: !Sub "${InfrastructureStackName}:DomainName"
- Name: RPC_ADDR
Value: "0.0.0.0"
Value: "geth-l2"
- Name: ROLLUP_ENABLE_L2_GAS_POLLING
Value: true
- Name: ROLLUP_ENFORCE_FEES
Expand Down
5 changes: 3 additions & 2 deletions ops_omgx/docker/blockexplorer-blockscout/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ DATABASE_USER=`/opt/secret2env -name $SECRETNAME|grep -w postgres_user|sed 's/po
DATABASE_PASS=`/opt/secret2env -name $SECRETNAME|grep -w postgres_pass|sed 's/postgres_pass=//g'`
DATABASE_HOST=`/opt/secret2env -name $SECRETNAME|grep -w postgres_host|sed 's/postgres_host=//g'`
export DATABASE_URL="postgresql://${DATABASE_USER}:${DATABASE_PASS}@${DATABASE_HOST}:5432/${DATABASE_NAME}?ssl=false"

mix do ecto.create, ecto.migrate; mix phx.server
printenv
mix do ecto.create, ecto.migrate
mix phx.server
2 changes: 1 addition & 1 deletion ops_omgx/docker/l2geth/geth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ curl \
--retry $RETRIES \
--retry-delay 1 \
$ROLLUP_CLIENT_HTTP

rm -rf /root/.ethereum/geth/LOCK
exec geth --verbosity="$VERBOSITY" "$@"
14 changes: 9 additions & 5 deletions ops_omgx/monitor/transaction-monitor/services/blockMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,15 @@ class BlockMonitorService extends OptimismEnv {

// gets list of addresses whose messages may finalize fast
async getWhitelist(){
let response = await fetch(this.filterEndpoint);
const filter = await response.json();
const filterSelect = [ filter.Proxy__L1LiquidityPool, filter.L1Message ]
this.whitelist = filterSelect
this.logger.info('Found the filter', { filterSelect })
try {
let response = await fetch(this.filterEndpoint);
const filter = await response.json();
const filterSelect = [ filter.Proxy__L1LiquidityPool, filter.L1Message ]
this.whitelist = filterSelect
this.logger.info('Found the filter', { filterSelect })
} catch {
this.logger.error('CRITICAL ERROR: Failed to fetch the Filter')
}
}

// checks to see if its time to look for L1 finalization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class DatabaseService extends OptimismEnv{
const crossDomainMessage = await query(`SELECT * FROM receipt
WHERE crossDomainMessage=${true}
AND crossDomainMessageFinalize=${false}
AND UNIX_TIMESTAMP() > crossDomainMessageEstimateFinalizedTime
AND ((UNIX_TIMESTAMP() > crossDomainMessageEstimateFinalizedTime AND fastRelay is null) OR fastRelay=true)
`);
con.end();
return crossDomainMessage;
Expand All @@ -257,7 +257,6 @@ class DatabaseService extends OptimismEnv{
on depositL2.hash = l1Bridge.hash
WHERE crossDomainMessage=${true}
AND depositL2.status='pending'
AND UNIX_TIMESTAMP() > crossDomainMessageEstimateFinalizedTime
`);
con.end();
return crossDomainMessage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ const OVM_L2_CROSS_DOMAIN_MESSENGER = "0x420000000000000000000000000000000000000

class OptimismEnv {
constructor() {
this.L1Provider = new ethers.providers.JsonRpcProvider(L1_NODE_WEB3_URL);
this.L2Provider = new ethers.providers.JsonRpcProvider(L2_NODE_WEB3_URL);
this.L1Provider = new ethers.providers.StaticJsonRpcProvider(L1_NODE_WEB3_URL);
this.L2Provider = new ethers.providers.StaticJsonRpcProvider(L2_NODE_WEB3_URL);

this.MySQLHostURL = MYSQL_HOST_URL;
this.MySQLPort = MYSQL_PORT;
Expand Down
4 changes: 2 additions & 2 deletions packages/batch-submitter/src/transaction-chain-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export class CanonicalTransactionChainContract extends Contract {
from: await this.signer.getAddress(),
data,
})

const safeGasLimit = gasLimit.mul(ethers.BigNumber.from(11)).div(ethers.BigNumber.from(10))
return {
nonce,
to,
data,
gasLimit,
gasLimit: safeGasLimit,
}
},
}
Expand Down
1 change: 0 additions & 1 deletion packages/message-relayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"bcfg": "^0.1.6",
"dotenv": "^8.2.0",
"ethers": "^5.4.5",
"lodash": "^4.17.21",
"merkletreejs": "^0.2.18",
"node-fetch": "^2.6.1",
"rlp": "^2.2.6"
Expand Down
13 changes: 1 addition & 12 deletions packages/message-relayer/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Contract, ethers, Wallet, BigNumber, providers } from 'ethers'
import * as rlp from 'rlp'
import { MerkleTree } from 'merkletreejs'
import fetch from 'node-fetch';
import { isEqual } from 'lodash';

/* Imports: Internal */
import { fromHexString, sleep } from '@eth-optimism/core-utils'
Expand Down Expand Up @@ -406,13 +405,6 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
selectedEvent.blockNumber,
selectedEvent.blockNumber
)
// alert if two SCC events are not the same
if (!isEqual(selectedEvent, SCCEvent[0])) {
this.logger.warn('Found inconsistent SCC event', {
prevSCCEvent: selectedEvent,
newSCCEvent: SCCEvent
})
}
return SCCEvent[0]
}

Expand Down Expand Up @@ -737,12 +729,9 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
this.state.filter = filterSelect
this.logger.info('Found the filter', { filterSelect })
}
} else {
this.state.filter = [];
}
} catch {
this.logger.info('Failed to fetch the filter')
this.state.filter = [];
this.logger.error('CRITICAL ERROR: Failed to fetch the Filter')
}
}
}
12 changes: 6 additions & 6 deletions packages/omgx/contracts/deployment/mainnet/addressess.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"L2": "0xeDB79B0FD84c81E870b2fCB1D3CcF366179bA6D2"
}
},
"OVM_L1CrossDomainMessengerFast": "0x68ac1623ACf9eB9F88b65B5F229fE3e2c0d5789e",
"Proxy__OVM_L1CrossDomainMessengerFast": "0x841979bbC06Be7BFE28d9FadDac1A73e1Fb495C1",
"L2LiquidityPool": "0x9C133903F299f083F2ba4A7DAeb142643Fe1864D",
"L1LiquidityPool": "0x87b6C838486c836a1fb16716Df25D8E023fd541C",
"Proxy__L1LiquidityPool": "0x3256BD6Fc8b5fA48DB95914d0dF314465F3F7879",
"Proxy__L2LiquidityPool": "0x02fc14bC0dF6452FCC36496244eE2D043401582F",
"OVM_L1CrossDomainMessengerFast": "0xb7E757633857C2E6Ec7aab362c17E7a5913B4855",
"Proxy__OVM_L1CrossDomainMessengerFast": "0xD05b8fD53614e1569cAC01c6D8d41416d0a7257E",
"L2LiquidityPool": "0xB1a1B698E4c67c242441749C22575FA02B14D645",
"L1LiquidityPool": "0x3d95bE575576F813B9b18eE14ba041d3E013eC25",
"Proxy__L1LiquidityPool": "0x1A26ef6575B7BBB864d984D9255C069F6c361a14",
"Proxy__L2LiquidityPool": "0x3A92cA39476fF84Dc579C868D4D7dE125513B034",
"L2ERC721": "0xe7dc303281a6B69D86578EB596741cA1B8EFcD93",
"L2ERC721Reg": "0x967c403E64A316d0Cb04c97334F967a37d58d82f"
}
Loading

0 comments on commit d543371

Please sign in to comment.