Skip to content

Commit 5d807a9

Browse files
authored
Merge pull request #155 from gnosischain/develop
fix: SG post-upgrade
2 parents 5c3747c + 46bb948 commit 5d807a9

32 files changed

Lines changed: 4898 additions & 3833 deletions

.github/workflows/oicd-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
"NEXT_PUBLIC_WALLET_CONNECT_DAPP_URL=${{ secrets.WALLET_CONNECT_URL }}"
137137
"NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }}"
138138
"NEXT_PUBLIC_SUBGRAPH_ENVIRONMENT=production"
139-
"NEXT_PUBLIC_SUBGRAPH_ACCESS_ID=${{ secrets.GRAPH_API_KEY }}"
139+
"NEXT_PUBLIC_SUBGRAPH_ACCESS_ID=${{ secrets.THEGRAPH_READ_API_KEY }}"
140140
"NEXT_PUBLIC_SUBGRAPH_CHAINS_RESOURCE_IDS=100:2ths6FTZhCBggnyakh7PL5KH91zjRv8xPNfzaCRKogJ,1:9W7Ye5xFfefNYDxXD4StqAuj7TU8eLq5PLmuPUnhFbeQ"
141141
"NEXT_PUBLIC_ALCHEMY_API_KEY=${{ secrets.DEV_NEXT_PUBLIC_ALCHEMY_API_KEY }}"
142142

.github/workflows/publish-ecr-image-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ jobs:
100100
"NEXT_PUBLIC_WALLET_CONNECT_DAPP_URL=${{ secrets.WALLET_CONNECT_URL }}"
101101
"NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }}"
102102
"NEXT_PUBLIC_SUBGRAPH_ENVIRONMENT=production"
103-
"NEXT_PUBLIC_SUBGRAPH_ACCESS_ID=${{ secrets.GRAPH_API_KEY }}"
103+
"NEXT_PUBLIC_SUBGRAPH_ACCESS_ID=${{ secrets.THEGRAPH_READ_API_KEY }}"
104104
"NEXT_PUBLIC_SUBGRAPH_CHAINS_RESOURCE_IDS=100:2ths6FTZhCBggnyakh7PL5KH91zjRv8xPNfzaCRKogJ,1:9W7Ye5xFfefNYDxXD4StqAuj7TU8eLq5PLmuPUnhFbeQ"
105105
"NEXT_PUBLIC_ALCHEMY_API_KEY=${{ secrets.PROD_NEXT_PUBLIC_ALCHEMY_API_KEY }}"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Slack Notify Release
2+
on:
3+
workflow_call:
4+
secrets:
5+
RELEASES_SLACK_WEBHOOK_URL:
6+
required: true
7+
inputs:
8+
environment:
9+
type: string
10+
required: true
11+
message:
12+
type: string
13+
required: true
14+
service:
15+
type: string
16+
required: true
17+
success:
18+
type: boolean
19+
required: true
20+
21+
jobs:
22+
notify:
23+
name: Notify ${{ inputs.service }} release in ${{ inputs.environment }}
24+
runs-on: ubuntu-latest
25+
environment: ${{ inputs.environment }}
26+
steps:
27+
- name: Extract branch name
28+
shell: bash
29+
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
30+
id: extract_branch
31+
32+
- name: Extract commit
33+
id: commit
34+
uses: prompt/actions-commit-hash@v3
35+
36+
- name: Get current date
37+
id: date
38+
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')"
39+
40+
- id: slack
41+
uses: slackapi/slack-github-action@v1.27.0
42+
with:
43+
payload: "{\"username\":\"Releases\",\"icon_url\":\"https://avatars3.githubusercontent.com/u/134083290\",\"text\":\"${{ inputs.message }} - ${{ github.event.head_commit.message }}\",\"attachments\":[{\"text\":\"\",\"color\":\"${{ inputs.success == true && '#36a64f' || '#FF3131' }}\",\"author_name\":\"${{ inputs.service }}\",\"title\":\"\",\"fields\":[{\"title\":\"Environment\",\"short\":true,\"value\":\"`${{ inputs.environment }}`\"},{\"title\":\"Branch\",\"short\":true,\"value\":\"${{ steps.extract_branch.outputs.branch }}\"},{\"title\":\"Commit\",\"short\":true,\"value\":\"${{ steps.commit.outputs.short }}\"},{\"title\":\"Status\",\"short\":true,\"value\":\"${{ inputs.success == true && '🟢 SUCCEEDED' || '🔴 FAILED' }}\"},{\"title\":\"Time\",\"short\":true,\"value\":\"${{ steps.date.outputs.date }}\"}]}]}"
44+
env:
45+
SLACK_WEBHOOK_URL: ${{ secrets.RELEASES_SLACK_WEBHOOK_URL }}
46+
SLACK_WEBHOOK_TYPE: "INCOMING_WEBHOOK"
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: The Graph - Manual Deployment to Dev
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
network:
7+
description: "Network for Subgraph deployment - Ethereum or Gnosis Chain"
8+
required: true
9+
options:
10+
- Ethereum
11+
- Gnosis Chain
12+
type: choice
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
deploy:
20+
name: Deployment
21+
runs-on: ubuntu-latest
22+
outputs:
23+
random_id: ${{ steps.random_id.outputs.random_id }}
24+
env:
25+
DEPLOY_API_KEY: ${{ secrets.THEGRAPH_DEPLOY_API_KEY }}
26+
DEBUG: true
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- uses: actions/cache@v4
31+
with:
32+
path: '**/node_modules'
33+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
34+
35+
- name: Check for excluded branches
36+
if: startsWith(github.ref, 'refs/heads/main')
37+
run: |
38+
echo "This branch is excluded from workflow dispatch."
39+
exit 1
40+
41+
- name: Setup Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version-file: '.nvmrc'
45+
46+
- name: Install dependencies
47+
run: |
48+
cd subgraph
49+
yarn install
50+
51+
- name: Generate Random ID
52+
id: random_id
53+
run: |
54+
echo "random_id=$(openssl rand -hex 4)" >> $GITHUB_OUTPUT
55+
56+
- name: Build & Deploy Subgraph for ETH mainnet
57+
if: ${{ inputs.network == 'Ethereum' }}
58+
env:
59+
SUBGRAPH_LABELS: "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
60+
TYPE: foreign
61+
DEBUG: true
62+
SUBGRAPH_NAME: gbc-bridge-mainnet
63+
NETWORK: mainnet
64+
run: |
65+
cd subgraph
66+
yarn build
67+
yarn deploy
68+
69+
- name: Build & Deploy Subgraph for Gnosis Chain
70+
if: ${{ inputs.network == 'Gnosis Chain' }}
71+
env:
72+
SUBGRAPH_LABELS: "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
73+
TYPE: home
74+
DEBUG: true
75+
SUBGRAPH_NAME: gbc-bridge-gnosis
76+
NETWORK: gnosis
77+
run: |
78+
cd subgraph
79+
yarn build
80+
yarn deploy
81+
82+
notify:
83+
uses: ./.github/workflows/slack_release_notification.yml
84+
if: ${{ always() }}
85+
needs: deploy
86+
secrets:
87+
RELEASES_SLACK_WEBHOOK_URL: ${{ secrets.RELEASES_SLACK_WEBHOOK_URL }}
88+
with:
89+
environment: Development
90+
service: Bridge Monitor SubGraph
91+
success: ${{ contains(join(needs.*.result, ','), 'success') }}
92+
message: "deploy service `Bridge Monitor SubGraph` version `${{ github.ref_name }}-${{ needs.deploy.outputs.random_id }}`. Triggered by `${{ github.actor }}`."
93+
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: The Graph - Manual Deployment to Prod
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Release version to deploy"
8+
required: true
9+
type: string
10+
network:
11+
description: "Network for Subgraph deployment - (Gnosis Chain or Ethereum)"
12+
required: true
13+
options:
14+
- Ethereum
15+
- Gnosis Chain
16+
type: choice
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
deploy:
24+
name: Deployment
25+
runs-on: ubuntu-latest
26+
env:
27+
DEPLOY_API_KEY: ${{ secrets.THEGRAPH_DEPLOY_API_KEY }}
28+
DEBUG: true
29+
if: github.ref == 'refs/heads/main'
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- uses: actions/cache@v4
36+
with:
37+
path: '**/node_modules'
38+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
39+
40+
- name: Check version tag exists
41+
id: release_tag
42+
run: |
43+
TAG_EXISTS=$(git tag -l "${{ inputs.version }}")
44+
if [ -z "$TAG_EXISTS" ]; then
45+
echo "Version ${{ inputs.version }} does not exist."
46+
exit 1
47+
else
48+
echo "tag=$TAG_EXISTS" >> $GITHUB_OUTPUT
49+
fi
50+
51+
- name: Setup Node.js
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version-file: '.nvmrc'
55+
56+
- name: Install dependencies
57+
run: |
58+
cd subgraph
59+
yarn install
60+
61+
- name: Generate Random ID for buildcode
62+
id: random_id
63+
run: |
64+
echo "random_id=$(openssl rand -hex 4)" >> $GITHUB_OUTPUT
65+
66+
- name: Build & Deploy Subgraph for ETH mainnet
67+
if: ${{ inputs.network == 'Ethereum' }}
68+
env:
69+
SUBGRAPH_LABELS: "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
70+
TYPE: foreign
71+
DEBUG: true
72+
SUBGRAPH_NAME: gbc-bridge-mainnet
73+
NETWORK: mainnet
74+
run: |
75+
cd subgraph
76+
yarn build
77+
yarn deploy
78+
79+
- name: Build & Deploy Subgraph for Gnosis Chain
80+
if: ${{ inputs.network == 'Gnosis Chain' }}
81+
env:
82+
SUBGRAPH_LABELS: "${{ steps.release_tag.outputs.tag }}-${{ steps.random_id.outputs.random_id }}"
83+
TYPE: home
84+
DEBUG: true
85+
SUBGRAPH_NAME: gbc-bridge-gnosis
86+
NETWORK: gnosis
87+
run: |
88+
cd subgraph
89+
yarn build
90+
yarn deploy
91+
92+
notify:
93+
uses: ./.github/workflows/slack_release_notification.yml
94+
if: ${{ always() }}
95+
needs: deploy
96+
secrets:
97+
RELEASES_SLACK_WEBHOOK_URL: ${{ secrets.RELEASES_SLACK_WEBHOOK_URL }}
98+
with:
99+
environment: Production
100+
service: Bridge Monitor SubGraph
101+
success: ${{ contains(join(needs.*.result, ','), 'success') }}
102+
message: "deploy service `Bridge Monitor SubGraph` version `${{ inputs.version }}`. Triggered by `${{ github.actor }}`."
103+

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.11.0

app/src/pagePartials/bridge/bridgeForm/index.tsx

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import { UnifiedBridgeButton } from './button/UnifiedBridgeButton'
4848
import { useRouter } from 'next/router'
4949
import { useSanitizedQuery } from '@/src/hooks/useSanitizedQuery'
5050
import { isBlockedToken } from '@/src/utils/blockedTokens'
51-
import { XdaiWarning } from './warnings/xDaiWarning'
5251

5352
const Title = styled.h2`
5453
align-items: center;
@@ -122,14 +121,6 @@ const AmountInput = styled(AmountTokenInput)`
122121
margin-right: calc(var(--theme-common-space) * -1);
123122
`
124123

125-
// const sanitizeAmount = (amount: string, decimals: number) => {
126-
// if (!amount.includes('.')) return amount
127-
128-
// const parts = amount.split('.')
129-
// const decimalPart = parts[1].slice(0, decimals) // Keep only allowed decimal places
130-
// return `${parts[0]}.${decimalPart}`
131-
// }
132-
133124
const SkeletonCommon: React.FC = () => (
134125
<Wrapper>
135126
<FormWrapper>
@@ -254,15 +245,6 @@ const Main = () => {
254245
? true
255246
: false
256247

257-
// console.log('tokenIn', formState.token)
258-
// console.log('tokenOut', tokenOut)
259-
260-
const isXdai =
261-
(formState.fromChainId === Chains.mainnet &&
262-
isSameString(formState.token?.address || '', '0x6B175474E89094C44Da98b954EedeAC495271d0F')) ||
263-
(formState.fromChainId === Chains.gnosis &&
264-
isSameString(formState.token?.address || '', '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'))
265-
266248
return (
267249
<Wrapper>
268250
<FormWrapper>
@@ -303,7 +285,6 @@ const Main = () => {
303285
</InnerCardFrom>
304286
<InnerCard>
305287
<Title>Transfer to</Title>
306-
{isXdai && <XdaiWarning />}
307288
{isUsdcEth && <UsdcEthWarning />}
308289
{isUsdceGC && <UsdcEGcWarning />}
309290
{unwrapFirst && <UnwrapFirst symbol={formState.token?.symbol} />}
@@ -314,7 +295,7 @@ const Main = () => {
314295
<NotBridgedERC20Warning />
315296
)}
316297

317-
{!unwrapFirst && !sendToExternalBridge && !isNotBridgedErc20 && !isXdai && (
298+
{!unwrapFirst && !sendToExternalBridge && !isNotBridgedErc20 && (
318299
<>
319300
<OnChainInfo>
320301
<Chain chainId={formState.toChainId} />
@@ -349,8 +330,7 @@ const Main = () => {
349330
formState.token &&
350331
tokenOut &&
351332
address &&
352-
walletChainId == formState.fromChainId &&
353-
!isXdai && (
333+
walletChainId == formState.fromChainId && (
354334
<BridgeSummary
355335
amount={amountBN}
356336
fromChainId={formState.fromChainId}
@@ -363,20 +343,18 @@ const Main = () => {
363343
/>
364344
)}
365345
</FormCards>
366-
{!isXdai && (
367-
<UnifiedBridgeButton
368-
amount={amountBN}
369-
fromChainId={formState.fromChainId}
370-
fromToken={formState.token}
371-
isUsdceGC={isUsdceGC}
372-
receiveNativeToken={formState.receiveNativeToken}
373-
recipient={formState.recipient}
374-
sendToExternalBridge={sendToExternalBridge}
375-
toChainId={formState.toChainId}
376-
toToken={tokenOut}
377-
userAddress={address}
378-
/>
379-
)}
346+
<UnifiedBridgeButton
347+
amount={amountBN}
348+
fromChainId={formState.fromChainId}
349+
fromToken={formState.token}
350+
isUsdceGC={isUsdceGC}
351+
receiveNativeToken={formState.receiveNativeToken}
352+
recipient={formState.recipient}
353+
sendToExternalBridge={sendToExternalBridge}
354+
toChainId={formState.toChainId}
355+
toToken={tokenOut}
356+
userAddress={address}
357+
/>
380358
</Form>
381359
</FormWrapper>
382360
</Wrapper>

app/src/pagePartials/bridgeExplorer/latestTransactions/ClaimButton.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,15 @@ export const ClaimButton = ({
145145
if (transaction.bridgeName.toUpperCase() === 'XDAI') {
146146
// XDAI Bridge
147147
// recover message and signatures
148+
// console.log('transaction', transaction)
149+
const modifiedId = transaction.id.startsWith('0x00000064')
150+
? '0x00000000' + transaction.id.substring(10)
151+
: transaction.transactionHash
152+
148153
const messageHash = await erc20ToNativeBridgeHelper.getMessageHash(
149154
transaction.receiver,
150155
transaction.receiverAmount,
151-
transaction.transactionHash,
156+
modifiedId,
152157
)
153158
const [message, signatures] = await Promise.all([
154159
erc20ToNativeBridgeHelper.getMessage(messageHash),

app/src/pagePartials/bridgeExplorer/transaction/Validations.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ interface Props {
1717
}
1818

1919
export const Validations: React.FC<Props> = ({ fetchValidatorName, validations }) => {
20-
console.log('validations', validations)
2120
return (
2221
<Wrapper>
2322
{validations.map((validation: TransactionValidation, index) => {

subgraph/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ src/config/*.ts
1515

1616
# npm
1717
node_modules
18+
19+
subgraph_eth.yaml
20+
subgraph_gc.yaml
21+
deploy-test.sh

0 commit comments

Comments
 (0)