Skip to content

Commit

Permalink
Merge branch 'feat/update-last-indexed-scribe' into feat/devnet-load-…
Browse files Browse the repository at this point in the history
…script
  • Loading branch information
dwasse committed Oct 9, 2023
2 parents 0433dfa + 4cd1efd commit c1bf0f6
Show file tree
Hide file tree
Showing 68 changed files with 3,323 additions and 1,986 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/close-stale.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Close stale issues and PRs'
name: 'Close stale issues, branches and PRs'
on:
schedule:
- cron: '30 1 * * *'
Expand All @@ -8,7 +8,7 @@ on:
- '.github/workflows/close-stale.yml'

jobs:
stale:
stale-prs:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
Expand All @@ -19,3 +19,13 @@ jobs:
days-before-pr-stale: 14
days-before-close: 5
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-branches:
name: Remove Stale Branches
runs-on: ubuntu-latest
steps:
- uses: fpicalausa/remove-stale-branches@v1
with:
operations-per-run: 50
days-before-branch-delete: 3
# yamllint disable-line
stale-branch-message: "@{author} Your branch [{branchName}]({branchUrl}) hasn't been updated in the last 60 days and is marked as stale. It will be removed in a week. If a pull request is open on this branch, you can ignore this message, you can always restore your branch on the pull request link. \r\nIf you want to keep this branch around, delete this comment or add new commits to this branch. "
18 changes: 17 additions & 1 deletion agents/agents/executor/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Executor
The Executor is an agent responsible for executing messages on the `Destination.sol` contract. It verifies that the message has been accepted by verifying a merkle proof, as well as the message's optimistic period.
The Executor is an agent responsible for executing messages on the `Destination.sol` contracts. It verifies that the message has been accepted by verifying a merkle proof, as well as the message's optimistic period.

## Components
The Executor operates with four main components:
Expand All @@ -10,6 +10,22 @@ The Executor operates with four main components:
<br /> <br > `setMinimumTime` sets the minimum unix time for a message before it has passed the optimistic period and can be executed. It works by going through all messages in the database that haven't been set, and checks for attestations to set each message's time.
<br /> <br > `executeExecutable` is the function that executes messages. It looks through all messages that have a time set from `setMinimumTime` and executes them if the minimum time is past the current time.

### Message Lifecycle
As a message gets sent by a user on an Origin chain, there are a few important variables with the message that guide its execution.
* `Origin`: The chain ID of the chain the message is originating from
* `Nonce`: The nonce of the message for all messages sent on this origin (if 5 other messages by other users were sent before on this origin, the nonce would be 6)
* `Destination`: The chain ID of the chain the message is targeting
* `OptimisticSeconds`: How many seconds should be allocated for fraud catching before the message is able to be executed on the `Destination`

Once a message is constructed with all of these fields and is dispatched via the `SendBaseMessage` function on the `Origin`'s Origin.sol contract, the message starts its lifecycle in the SIN. Let's say this message has nonce `N`.
1. A <a href="../guard/README.md">Guard</a> captures a State of the Origin with a nonce of `N`. So messages from 1 to N are all included in this State.
2. The Guard collects different States across various chains and submits them all in a Snapshot to the SynChain.
3. A <a href="../notary/README.md">Notary</a> looks at all States that Guards have submitted to the SynChain, and creates a Snapshot with the new states. So a Notary sees the state that was caputred in step 1 and submits it in a Snapshot on SynChain.
4. After the Notary is submitted, a Snapshot Root, representing a Merkle Tree of all the data in the Snapshot has been saved. Now, the message is included in a Notary's Snapshot on SynChain and is ready to be delivered to the `Destination`.
5. A Notary (same or different than the one that performed step 3) now submits an Attestation to the `Destination`. Once this Attestation is accepted on the `Destination`, the message's `OptimisticSeconds` timer starts.

Now, it is the executors job to ensure that a message that it has seen on `Origin` has gone through the whole lifecycle, while proving inclusion at various steps, before it is able to wait for the message's optimistic period and execute the message.

### Execute
`Execute` works in 3 parts.
1. Verify that the optimistic period for the message has passed. This is done by checking the timestamp that the attestation was accepted on the Destination, then checking the timestamp of the last block.
Expand Down
8 changes: 4 additions & 4 deletions charts/agents/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ dependencies:
version: 9.3.2
- name: omnirpc
repository: file://../omnirpc/
version: 0.2.7
version: 0.2.9
- name: scribe
repository: file://../scribe/
version: 0.2.12
version: 0.2.14
- name: jaeger
repository: https://jaegertracing.github.io/helm-charts
version: 0.69.1
digest: sha256:a8a1765796d6723e457bda17b02aecf0c5bcaac34cd60d0e851febd186217e77
generated: "2023-08-02T03:07:07.884124+03:00"
digest: sha256:f1c664b6e52c04911d6915e92341991ea2ad0e11235b4ccd72ea0ddb63284f55
generated: "2023-10-06T17:12:41.202122-07:00"
6 changes: 3 additions & 3 deletions charts/agents/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.26
version: 0.1.28

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -29,11 +29,11 @@ dependencies:
repository: "https://charts.bitnami.com/bitnami"
condition: mysql.enabled
- name: omnirpc
version: "0.2.7"
version: "0.2.9"
repository: "file://../omnirpc/"
condition: omnirpc.enabled
- name: scribe
version: "0.2.12"
version: "0.2.14"
repository: "file://../scribe/"
condition: scribe.enabled
- name: jaeger
Expand Down
2 changes: 1 addition & 1 deletion charts/cctp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0
version: 0.2.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
10 changes: 7 additions & 3 deletions charts/cctp/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "cctp.fullname" . }}
Expand All @@ -17,12 +17,16 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/explorer/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: omnirpc
repository: file://../omnirpc/
version: 0.2.7
version: 0.2.9
- name: clickhouse
repository: https://sentry-kubernetes.github.io/charts
version: 3.1.3
digest: sha256:1dc2ef92672513a91b6a285960084789bf4096b0ccc2e7df45be2c3e972b6e25
generated: "2023-08-02T02:16:29.734171+03:00"
digest: sha256:c0948876356a232aae14d7835389505acacf60a6c78796b04a156502600684df
generated: "2023-10-06T17:11:59.552604-07:00"
4 changes: 2 additions & 2 deletions charts/explorer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.11
version: 0.2.14

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -25,7 +25,7 @@ appVersion: "1.16.0"

dependencies:
- name: omnirpc
version: "0.2.7"
version: "0.2.9"
repository: "file://../omnirpc/"
condition: omnirpc.enabled
- name: clickhouse
Expand Down
2 changes: 1 addition & 1 deletion charts/explorer/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ toYaml .Values.files | indent 2 }}
{{ tpl (toYaml .Values.files) . | indent 2 }}
{{- end }}
10 changes: 7 additions & 3 deletions charts/explorer/templates/server_hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.server.enabled }}
{{- if .Values.server.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "explorer.fullname" . }}
Expand All @@ -18,13 +18,17 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.server.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.server.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.server.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.server.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.server.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
24 changes: 13 additions & 11 deletions charts/explorer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ clickhouse:
storage: "30Gi"

indexer:
enabled: true
enabled: false
podAnnotations: {}
nodeSelector: {}
podSecurityContext: {}
Expand Down Expand Up @@ -176,9 +176,7 @@ server:
tolerations: []
args:
- server
- '--port=5080'
- '--scribe-url=https://scribe.interoperability.institute/graphql'
- '--address=tcp://default:clickhouse@{{ .Release.Namespace }}-clickhouse:9000'
- --config=/config/config.yaml
ports:
- name: http
containerPort: 5080
Expand Down Expand Up @@ -216,13 +214,17 @@ files:
refresh_rate: 1
scribe_url: https://scribe.interoperability.institute/graphql
rpc_url: https://rpc.interoperability.institute/confirmations/1/rpc/
http_port: 5080
db_address: tcp://default:clickhouse@{{ .Release.Namespace }}-clickhouse:9000
bridge_config_address: 0x5217c83ca75559B1f8a8803824E5b7ac233A12a1
bridge_config_chain_id: 1
chains:
- chain_id: 1
fetch_block_increment: 1000
max_goroutines: 10
contracts:
- contract_type: bridge
address: 0x2796317b0fF8538F253012862c06787Adfb8cEb6
start_block: 15930000
1:
chain_id: 1
avg_block_time: 13
get_logs_range: 256
get_logs_batch_amount: 1
fetch_block_increment: 1000
max_goroutines: 10
contracts:
bridge: 0x2796317b0fF8538F253012862c06787Adfb8cEb6
2 changes: 1 addition & 1 deletion charts/omnirpc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.7
version: 0.2.9

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
10 changes: 7 additions & 3 deletions charts/omnirpc/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "omnirpc.fullname" . }}
Expand All @@ -17,12 +17,16 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/scribe/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ dependencies:
version: 9.3.2
- name: omnirpc
repository: file://../omnirpc/
version: 0.2.7
digest: sha256:e4344cf16c3e5394ff7231fa8852881c0adb57511172865c9679655decb76524
generated: "2023-08-02T02:16:11.156893+03:00"
version: 0.2.9
digest: sha256:1b33f97f09cf2f3c56f95a6a466dfa00b09f41bcf57939864b75b29a053c49dc
generated: "2023-10-06T17:12:14.904732-07:00"
4 changes: 2 additions & 2 deletions charts/scribe/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.12
version: 0.2.14

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -29,6 +29,6 @@ dependencies:
repository: "https://charts.bitnami.com/bitnami"
condition: mysql.enabled
- name: omnirpc
version: "0.2.7"
version: "0.2.9"
repository: "file://../omnirpc/"
condition: omnirpc.enabled
10 changes: 7 additions & 3 deletions charts/scribe/templates/server_hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.server.enabled }}
{{- if .Values.server.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "scribe.fullname" . }}
Expand All @@ -18,13 +18,17 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.server.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.server.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.server.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.server.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.server.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions packages/explorer-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.1.20](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2023-10-02)

**Note:** Version bump only for package @synapsecns/explorer-ui





## [0.1.19](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2023-09-13)

**Note:** Version bump only for package @synapsecns/explorer-ui
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synapsecns/explorer-ui",
"version": "0.1.19",
"version": "0.1.20",
"private": true,
"engines": {
"node": ">=16.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/explorer-ui/pages/tx/[kappa].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function BridgeTransaction({ queryResult }) {
if (eventType == 10 || eventType == 11) {
return CHAIN_EXPLORER_URLS[chainID] + '/address/' + CCTP_CONTRACTS[chainID]
}
return CHAIN_EXPLORER_URLS[chainId] + '/address/' + BRIDGE_CONTRACTS[fromInfo.chainID]
return CHAIN_EXPLORER_URLS[chainID] + '/address/' + BRIDGE_CONTRACTS[chainID]
}
const transaction = queryResult.bridgeTransactions[0]
const { pending, fromInfo, toInfo } = transaction
Expand Down
8 changes: 8 additions & 0 deletions packages/rest-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.0.21](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2023-10-05)

**Note:** Version bump only for package @synapsecns/rest-api





## [1.0.20](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2023-09-12)

**Note:** Version bump only for package @synapsecns/rest-api
Expand Down
4 changes: 2 additions & 2 deletions packages/rest-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synapsecns/rest-api",
"version": "1.0.20",
"version": "1.0.21",
"private": "true",
"engines": {
"node": ">=16.0.0"
Expand All @@ -23,7 +23,7 @@
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@ethersproject/units": "5.7.0",
"@synapsecns/sdk-router": "^0.2.18",
"@synapsecns/sdk-router": "^0.2.19",
"bignumber": "^1.1.0",
"ethers": "5.7.2",
"express": "^4.18.2",
Expand Down
Loading

0 comments on commit c1bf0f6

Please sign in to comment.