Skip to content

Commit

Permalink
Merge branch 'main' into mmuftic/update-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MakMuftic authored Oct 16, 2023
2 parents 72a7549 + 17300a3 commit cc97108
Show file tree
Hide file tree
Showing 11 changed files with 268 additions and 358 deletions.
75 changes: 69 additions & 6 deletions .github/workflows/deploy_mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ on:


env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
ENVIRONMENT: 'MAINNET'
REGISTRY: 'ghcr.io'
AWS_MAINNET: '${{ secrets.AWS_MAINNET }}'

jobs:
deploy:
######################## region 1 ########################
deploy_region_1:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
relayer_id: [0, 1, 2]
relayer_id: [0, 1]

permissions:
contents: read
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
variables: |
relayerId=${{ matrix.relayer_id }}
awsAccountId=${{ env.AWS_MAINNET }}
awsRegion=${{ env.AWS_REGION }}
awsRegion=${{ secrets.AWS_REGION }}
imageTag=${{ inputs.release_tag }}
awsEnv=${{ env.ENVIRONMENT }}
awsEfs=${{ secrets.MAINNET_EFS_1 }}
Expand All @@ -75,7 +75,7 @@ jobs:
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ env.AWS_MAINNET }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
aws-region: ${{ env.AWS_REGION }}
aws-region: ${{ secrets.AWS_REGION }}
role-session-name: GithubActions

- name: deploy task definition
Expand All @@ -84,4 +84,67 @@ jobs:
task-definition: 'relayers/ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json'
service: 'relayer-${{ matrix.relayer_id }}-service-${{ env.ENVIRONMENT }}'
cluster: 'relayer-${{ env.ENVIRONMENT }}'
wait-for-service-stability: true
wait-for-service-stability: true

######################## region 3 ########################
deploy_region_3:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
relayer_id: [2]

permissions:
contents: read
id-token: write

steps:
- name: Authentication
id: auth
run: |
if [ "${{ secrets.AUTH_TOKEN }}" != "${{ github.event.inputs.TOKEN }}" ]; then
echo "Authentcation failed. Exiting..."
exit 1
fi
- name: Continue
if: steps.auth.outcome == 'success'
run: |
echo 'Authentication Succeeded!!!'
- name: checkout the source code
uses: actions/checkout@v3

- name: checkout ecs repo
uses: actions/checkout@v3
with:
repository: sygmaprotocol/devops
token: ${{ secrets.GHCR_TOKEN }}

- name: render jinja2 templates to task definition json files
uses: cuchi/jinja2-action@v1.2.0
with:
template: 'relayers/ecs/task_definition-${{ env.ENVIRONMENT }}.j2'
output_file: 'relayers/ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json'
data_format: json
variables: |
relayerId=${{ matrix.relayer_id }}
awsAccountId=${{ env.AWS_MAINNET }}
awsRegion=${{ secrets.AWS_REGION_3 }}
imageTag=${{ inputs.release_tag }}
awsEnv=${{ env.ENVIRONMENT }}
awsEfs=${{ secrets.MAINNET_EFS_3 }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ env.AWS_MAINNET }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
aws-region: ${{ secrets.AWS_REGION_3 }}
role-session-name: GithubActions

- name: deploy task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: 'relayers/ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json'
service: 'relayer-${{ matrix.relayer_id }}-service-${{ env.ENVIRONMENT }}'
cluster: 'relayer-${{ env.ENVIRONMENT }}'
wait-for-service-stability: true
4 changes: 2 additions & 2 deletions .github/workflows/deploy_stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ jobs:
variables: |
relayerId=${{ matrix.relayer_id }}
awsAccountId=${{ env.AWS_STAGE }}
awsRegion=${{ secrets.DEVNET_REGION_2 }}
awsRegion=${{ secrets.AWS_REGION_2 }}
awsEfs=${{ secrets.DEVNET_EFS_2 }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ env.AWS_STAGE }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
aws-region: ${{ secrets.DEVNET_REGION_2 }}
aws-region: ${{ secrets.AWS_REGION_2 }}
role-session-name: GithubActions

- name: deploy task definition
Expand Down
62 changes: 57 additions & 5 deletions .github/workflows/deploy_testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ on:
release:
types:
- published

env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
ENVIRONMENT: 'TESTNET'
REGISTRY: 'ghcr.io'
TAG: 'stable'
Expand Down Expand Up @@ -55,13 +54,14 @@ jobs:
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref_name }}

######################## region 1 ########################
deploy:
needs: push
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
relayer_id: [0, 1, 2]
relayer_id: [0, 1]

permissions:
contents: read
Expand All @@ -86,14 +86,66 @@ jobs:
variables: |
relayerId=${{ matrix.relayer_id }}
awsAccountId=${{ env.AWS_TESTNET }}
awsRegion=${{ env.AWS_REGION }}
awsRegion=${{ secrets.AWS_REGION }}
awsEfs=${{ secrets.TESTNET_EFS_1 }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ env.AWS_TESTNET }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
aws-region: ${{ env.AWS_REGION }}
aws-region: ${{ secrets.AWS_REGION }}
role-session-name: GithubActions

- name: deploy task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: 'relayers/ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json'
service: 'relayer-${{ matrix.relayer_id }}-service-${{ env.ENVIRONMENT }}'
cluster: 'relayer-${{ env.ENVIRONMENT }}'
wait-for-service-stability: true

######################## region 2 ########################

######################## region 3 ########################
deploy_reg_3:
needs: push
name: deploy region 3
runs-on: ubuntu-latest
strategy:
matrix:
relayer_id: [2]

permissions:
contents: read
id-token: write

steps:
- name: checkout the source code
uses: actions/checkout@v3

- name: checkout ecs repo
uses: actions/checkout@v3
with:
repository: sygmaprotocol/devops
token: ${{ secrets.GHCR_TOKEN }}

- name: render jinja2 templates to task definition json files
uses: cuchi/jinja2-action@v1.2.0
with:
template: 'relayers/ecs/task_definition-${{ env.ENVIRONMENT }}.j2'
output_file: 'relayers/ecs/task_definition-${{ matrix.relayer_id }}_${{ env.ENVIRONMENT }}.json'
data_format: json
variables: |
relayerId=${{ matrix.relayer_id }}
awsAccountId=${{ env.AWS_TESTNET }}
awsRegion=${{ secrets.AWS_REGION_3 }}
awsEfs=${{ secrets.TESTNET_EFS_3 }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::${{ env.AWS_TESTNET }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
aws-region: ${{ secrets.AWS_REGION_3 }}
role-session-name: GithubActions

- name: deploy task definition
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [1.10.0](https://github.com/sygmaprotocol/sygma-relayer/compare/v1.9.1...v1.10.0) (2023-10-10)


### Features

* enable generic transaction batching ([#217](https://github.com/sygmaprotocol/sygma-relayer/issues/217)) ([67a5ae7](https://github.com/sygmaprotocol/sygma-relayer/commit/67a5ae78dcb4cf5986b74c634bc3e341fd5e3cef))


### Miscellaneous

* enabled region_1 pipeline ([#225](https://github.com/sygmaprotocol/sygma-relayer/issues/225)) ([fe2df97](https://github.com/sygmaprotocol/sygma-relayer/commit/fe2df979646002d2cd90800ef5bc7e2dbe613978))
* multi region deployment ([#219](https://github.com/sygmaprotocol/sygma-relayer/issues/219)) ([6b42706](https://github.com/sygmaprotocol/sygma-relayer/commit/6b427066b21b7b647476fb98f9c1c9162cbc371e))
* testing regional deployment ([#224](https://github.com/sygmaprotocol/sygma-relayer/issues/224)) ([ae91338](https://github.com/sygmaprotocol/sygma-relayer/commit/ae91338e07652f3c1a2b3a66356fd8f1e475cda2))
* testnet regional deployment ([#222](https://github.com/sygmaprotocol/sygma-relayer/issues/222)) ([d46d870](https://github.com/sygmaprotocol/sygma-relayer/commit/d46d870a720fd56c1d2ffed737cb24df0ddc3519))
* update aws region ([#221](https://github.com/sygmaprotocol/sygma-relayer/issues/221)) ([bc47380](https://github.com/sygmaprotocol/sygma-relayer/commit/bc47380923447c14a6302e0c92835eb360207af9))

## [1.9.1](https://github.com/sygmaprotocol/sygma-relayer/compare/v1.9.0...v1.9.1) (2023-09-04)


Expand Down
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ func Run() error {
tssListener := events.NewListener(client)
eventHandlers := make([]coreListener.EventHandler, 0)
l := log.With().Str("chain", fmt.Sprintf("%v", config.GeneralChainConfig.Name)).Uint8("domainID", *config.GeneralChainConfig.Id)
eventHandlers = append(eventHandlers, listener.NewDepositEventHandler(l, depositListener, depositHandler, bridgeAddress, *config.GeneralChainConfig.Id))
eventHandlers = append(eventHandlers, coreListener.NewDepositEventHandler(depositListener, depositHandler, bridgeAddress, *config.GeneralChainConfig.Id))
eventHandlers = append(eventHandlers, listener.NewKeygenEventHandler(l, tssListener, coordinator, host, communication, keyshareStore, bridgeAddress, networkTopology.Threshold))
eventHandlers = append(eventHandlers, listener.NewRefreshEventHandler(l, topologyProvider, topologyStore, tssListener, coordinator, host, communication, connectionGate, keyshareStore, bridgeAddress))
eventHandlers = append(eventHandlers, listener.NewRetryEventHandler(l, tssListener, depositHandler, bridgeAddress, *config.GeneralChainConfig.Id, config.BlockConfirmations))
evmListener := coreListener.NewEVMListener(client, eventHandlers, blockstore, sygmaMetrics, *config.GeneralChainConfig.Id, config.BlockRetryInterval, config.BlockConfirmations, config.BlockInterval)
executor := executor.NewExecutor(host, communication, coordinator, mh, bridgeContract, keyshareStore, exitLock)
executor := executor.NewExecutor(host, communication, coordinator, mh, bridgeContract, keyshareStore, exitLock, config.GasLimit.Uint64())

chain := evm.NewEVMChain(
client, evmListener, executor, blockstore, *config.GeneralChainConfig.Id, config.StartBlock,
Expand Down
2 changes: 1 addition & 1 deletion chains/evm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type RawEVMConfig struct {
MaxGasPrice int64 `mapstructure:"maxGasPrice" default:"500000000000"`
GasMultiplier float64 `mapstructure:"gasMultiplier" default:"1"`
GasIncreasePercentage int64 `mapstructure:"gasIncreasePercentage" default:"15"`
GasLimit int64 `mapstructure:"gasLimit" default:"2000000"`
GasLimit int64 `mapstructure:"gasLimit" default:"15000000"`
StartBlock int64 `mapstructure:"startBlock"`
BlockConfirmations int64 `mapstructure:"blockConfirmations" default:"10"`
BlockInterval int64 `mapstructure:"blockInterval" default:"5"`
Expand Down
2 changes: 1 addition & 1 deletion chains/evm/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (s *NewEVMConfigTestSuite) Test_ValidConfig() {
Id: id,
},
Bridge: "bridgeAddress",
GasLimit: big.NewInt(2000000),
GasLimit: big.NewInt(15000000),
MaxGasPrice: big.NewInt(500000000000),
GasMultiplier: big.NewFloat(1),
GasIncreasePercentage: big.NewInt(15),
Expand Down
Loading

0 comments on commit cc97108

Please sign in to comment.