Skip to content

Commit

Permalink
Merge branch 'main' into p1sar/add-traces
Browse files Browse the repository at this point in the history
  • Loading branch information
P1sar authored Sep 8, 2023
2 parents ddc7eb9 + 3fbe29d commit 74e6e61
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy_mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
awsRegion=${{ env.AWS_REGION }}
imageTag=${{ inputs.release_tag }}
awsEnv=${{ env.ENVIRONMENT }}
awsEfs=${{ secrets.MAINNET_EFS_1 }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
relayerId=${{ matrix.relayer_id }}
awsAccountId=${{ env.AWS_STAGE }}
awsRegion=${{ env.AWS_REGION }}
awsEfs=${{ secrets.DEVNET_EFS_1 }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy_testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
relayerId=${{ matrix.relayer_id }}
awsAccountId=${{ env.AWS_TESTNET }}
awsRegion=${{ env.AWS_REGION }}
awsEfs=${{ secrets.TESTNET_EFS_1 }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -101,4 +102,4 @@ 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
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

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


### Bug Fixes

* fixed efs id ([#212](https://github.com/sygmaprotocol/sygma-relayer/issues/212)) ([c3ad702](https://github.com/sygmaprotocol/sygma-relayer/commit/c3ad702f38038f83213be5a2c74ddb8d5195b53c))


### Miscellaneous

* added efs interpolation ([#214](https://github.com/sygmaprotocol/sygma-relayer/issues/214)) ([f723b4d](https://github.com/sygmaprotocol/sygma-relayer/commit/f723b4d550d7cc592e0a87dd310f675cda9e6386))
* fix typo ([#215](https://github.com/sygmaprotocol/sygma-relayer/issues/215)) ([1410b08](https://github.com/sygmaprotocol/sygma-relayer/commit/1410b08822fba93d8cda7e8053f7a208698e08d0))

## [1.9.0](https://github.com/sygmaprotocol/sygma-relayer/compare/v1.8.1...v1.9.0) (2023-09-01)


### Features

* calculate gas based on proposal count ([#202](https://github.com/sygmaprotocol/sygma-relayer/issues/202)) ([3da4977](https://github.com/sygmaprotocol/sygma-relayer/commit/3da4977a812bae442f765796182a8b3c8fd67e86))


### Bug Fixes

* fix-bug-with-locked-keystore ([#211](https://github.com/sygmaprotocol/sygma-relayer/issues/211)) ([abffaf4](https://github.com/sygmaprotocol/sygma-relayer/commit/abffaf4f0ec480c6bf428599ee4fb3568b08adcc))


### Miscellaneous

* multi regional deployment ([#208](https://github.com/sygmaprotocol/sygma-relayer/issues/208)) ([c24c540](https://github.com/sygmaprotocol/sygma-relayer/commit/c24c540439ed107e4aba21b04a1d9add1a4e6bd0))
* percentage fee strategy docs ([#206](https://github.com/sygmaprotocol/sygma-relayer/issues/206)) ([800cddf](https://github.com/sygmaprotocol/sygma-relayer/commit/800cddfdf077a7c915448c00ffebffa7bb344dd3))
* revert changes to 1980918 ([#209](https://github.com/sygmaprotocol/sygma-relayer/issues/209)) ([5900dca](https://github.com/sygmaprotocol/sygma-relayer/commit/5900dca2f0bf323a48c3af88b14ff060fba7b110))

## [1.8.1](https://github.com/sygmaprotocol/sygma-relayer/compare/v1.8.0...v1.8.1) (2023-06-28)


Expand Down
4 changes: 4 additions & 0 deletions chains/evm/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
"go.opentelemetry.io/otel/attribute"
)

const TRANSFER_GAS_COST = 200000

var (
executionCheckPeriod = time.Minute
signingTimeout = 30 * time.Minute
Expand Down Expand Up @@ -195,6 +197,8 @@ func (e *Executor) executeProposal(ctx context.Context, proposals []*chains.Prop
l, ok := proposals[0].Metadata.Data["gasLimit"]
if ok {
gasLimit = l.(uint64)
} else {
gasLimit = uint64(TRANSFER_GAS_COST * len(proposals))
}

hash, err := e.bridge.ExecuteProposals(ctx, proposals, sig, transactor.TransactOptions{
Expand Down
27 changes: 23 additions & 4 deletions docs/general/Fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ every potential destination domain, with this mapping also outlining all potenti

Fee strategy defines a set of rules on how fees should be charged when executing deposits on the source chain.

### Static fee strategy
### Fixed fee strategy

This strategy always requires a predefined static fee amount per deposit. **It can only collect fees in the native
currency of the source chain**.
This strategy always requires a predefined fixed fee amount per deposit. **EVM imlementation can only collect fees in the native
currency of the source chain, while Substrate implementation allows for fee to be collected in any configured asset**.

*On the diagram below, we use [Sygma SDK](https://github.com/sygmaprotocol/sygma-sdk) for interaction with all services.*

Expand All @@ -26,7 +26,26 @@ currency of the source chain**.
2) Execute deposit
- Send the appropriate base currency amount based on the calculated final fee when executing the deposit.

### Dynamic fee strategy
### Percentage based fee strategy

This strategy calculates fee amount based on the amount of token being transferred.

It always collects fee in token that is being transferred, so it only makes sense for fungible token routes.

<img src="/docs/resources/percentage-formula-general.png" data-canonical-src="/docs/resources/percentage-formula-general.png" width="386" height="267" />

*On the diagram below, we use [Sygma SDK](https://github.com/sygmaprotocol/sygma-sdk) for interaction with all services.*

![](/docs/resources/percentage-fee-general.png)

#### Deposit flow

1) Calculate the final fee
- Based on resourceID, domainsID and amount, request a final fee amount that will be required to execute the deposit.
2) Execute deposit
- Send the appropriate token amount based on the calculated final fee when executing the deposit.

### Dynamic fee strategy (EVM only)

This strategy utilizes the [Sygma Fee Oracle service](https://github.com/sygmaprotocol/sygma-fee-oracle), which issues
fee estimates with details on the gas price for the destination chain. In addition, fee oracle can provide price
Expand Down
Binary file added docs/resources/percentage-fee-general.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/resources/percentage-formula-general.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func StartCommunicationHealthCheckJob(h host.Host, interval time.Duration, metri
healthComm := p2p.NewCommunication(h, "p2p/health")
for {
time.Sleep(interval)
log.Info().Msg("Starting communication health check")
log.Debug().Msg("Starting communication health check")

all := h.Peerstore().Peers()
unavailable := make(peer.IDSlice, 0)
Expand Down
2 changes: 2 additions & 0 deletions tss/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ func (c *Coordinator) Execute(ctx context.Context, tssProcess TssProcess, result
}

if !tssProcess.Retryable() {
tssProcess.Stop()
return observability.LogAndRecordErrorWithStatus(&logger, span, err, "Process is not retryable. Returning error")
}

}
observability.LogAndEvent(logger.Info(), span, "Retrying tssProcess")

Check failure on line 123 in tss/coordinator.go

View workflow job for this annotation

GitHub Actions / linter-check

syntax error: non-declaration statement outside function body (typecheck)

Check failure on line 123 in tss/coordinator.go

View workflow job for this annotation

GitHub Actions / linter-check

expected declaration, found observability (typecheck)

Check failure on line 123 in tss/coordinator.go

View workflow job for this annotation

GitHub Actions / linter-check

syntax error: non-declaration statement outside function body) (typecheck)

Check failure on line 123 in tss/coordinator.go

View workflow job for this annotation

GitHub Actions / linter-check

syntax error: non-declaration statement outside function body) (typecheck)

Check failure on line 123 in tss/coordinator.go

View workflow job for this annotation

GitHub Actions / test (1.19.x, ubuntu-latest)

syntax error: non-declaration statement outside function body
Expand Down

0 comments on commit 74e6e61

Please sign in to comment.