Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/labstack/ec…
Browse files Browse the repository at this point in the history
…ho-contrib-0.17.1
  • Loading branch information
dantaik authored Apr 24, 2024
2 parents daae677 + 6c7ce17 commit a74d793
Show file tree
Hide file tree
Showing 17 changed files with 940 additions and 67 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/blobstorage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Login to GCR
- name: Login to GAR
uses: docker/login-action@v3
with:
registry: gcr.io
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
password: ${{ secrets.GAR_JSON_KEY }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -63,7 +63,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
gcr.io/evmchain/blobstorage
us-docker.pkg.dev/evmchain/images/blobstorage
tags: |
type=ref,event=branch
type=ref,event=pr
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/eventindexer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Login to GCR
- name: Login to GAR
uses: docker/login-action@v3
with:
registry: gcr.io
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
password: ${{ secrets.GAR_JSON_KEY }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -82,7 +82,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
gcr.io/evmchain/eventindexer
us-docker.pkg.dev/evmchain/images/eventindexer
tags: |
type=ref,event=branch
type=ref,event=pr
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/guardianproverhealthcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Login to GCR
- name: Login to GAR
uses: docker/login-action@v3
with:
registry: gcr.io
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
password: ${{ secrets.GAR_JSON_KEY }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -82,7 +82,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
gcr.io/evmchain/guardian-prover-health-check
us-docker.pkg.dev/evmchain/images/guardian-prover-health-check
tags: |
type=ref,event=branch
type=ref,event=pr
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/relayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Login to GCR
- name: Login to GAR
uses: docker/login-action@v3
with:
registry: gcr.io
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
password: ${{ secrets.GAR_JSON_KEY }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -82,7 +82,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
gcr.io/evmchain/relayer
us-docker.pkg.dev/evmchain/images/relayer
tags: |
type=ref,event=branch
type=ref,event=pr
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/testcontainers/testcontainers-go v0.30.0
github.com/urfave/cli/v2 v2.27.1
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/sync v0.6.0
golang.org/x/sync v0.7.0
gopkg.in/go-playground/assert.v1 v1.2.1
gopkg.in/yaml.v3 v3.0.1
gorm.io/datatypes v1.2.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.2",
"svelte": "^4.2.12",
"svelte-check": "^3.6.6",
"svelte-check": "^3.6.9",
"tailwindcss": "^3.4.3",
"ts-morph": "^19.0.0",
"tslib": "^2.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import { classNames } from '$libs/util/classNames';
import { truncateString } from '$libs/util/truncateString';
import { uid } from '$libs/util/uid';
import { account } from '$stores';
export let value: Maybe<Chain> | null = null;
export let label = '';
Expand All @@ -34,6 +35,8 @@
modalOpen = true;
}
};
$: disabled = !$account || !$account.isConnected || readOnly;
</script>

<div class={classes}>
Expand All @@ -44,7 +47,7 @@
<button
id={buttonId}
type="button"
disabled={readOnly}
{disabled}
aria-haspopup="dialog"
aria-controls={dialogId}
aria-expanded={modalOpen}
Expand Down
2 changes: 1 addition & 1 deletion packages/guardian-prover-health-check-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.2",
"svelte": "^4.2.13",
"svelte-check": "^3.6.6",
"svelte-check": "^3.6.9",
"tailwindcss": "^3.4.3",
"tslib": "^2.6.2",
"typescript": "^5.4.3",
Expand Down
55 changes: 55 additions & 0 deletions packages/protocol/script/SetupUSDCBridging.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import "../test/DeployCapability.sol";
import "../contracts/tokenvault/ERC20Vault.sol";

/// @dev This script shall be run on Taiko chain to hook up a native USDC deployment and the USDC
/// deployed on layer 1.
///
/// To deploy a native USDC contract on L2, run:
/// https://github.com/taikoxyz/USDC/blob/main/script/DeployUSDC.s.sol
contract SetupUSDCBridging is DeployCapability {
address public constant USDC_ON_ETHEREUM = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;

uint256 public privateKey = vm.envUint("PRIVATE_KEY");
address public erc20VaultOnL2 = vm.envAddress("ERC20_VAULT_ON_L2");

// These are FiatTokenProxy addresses of the USDC coin.
address public usdcOnL1 = vm.envAddress("USDC_ADDRESS_ON_L1");
address public usdcOnL2 = vm.envAddress("USDC_ADDRESS_ON_L2");

function run() external {
require(erc20VaultOnL2 != address(0) && usdcOnL2 != address(0), "invalid params");

if (usdcOnL1 == address(0)) {
usdcOnL1 = USDC_ON_ETHEREUM;
}

ERC20Vault vault = ERC20Vault(erc20VaultOnL2);

address currBridgedtoken = vault.canonicalToBridged(1, usdcOnL1);
console2.log("current btoken for usdc:", currBridgedtoken);

vm.startBroadcast(privateKey);
vault.changeBridgedToken(
ERC20Vault.CanonicalERC20({
chainId: 1,
addr: usdcOnL1,
decimals: 6,
symbol: "USDC",
name: "USD Coin"
}),
usdcOnL2
);
if (vault.paused()) {
vault.unpause();
}
vm.stopBroadcast();

address newBridgedToken = vault.canonicalToBridged(1, usdcOnL1);
console2.log("new btoken for usdc:", newBridgedToken);

require(usdcOnL2 == newBridgedToken, "unexpected result");
}
}
124 changes: 111 additions & 13 deletions packages/protocol/script/config_dcap_sgx_verifier.sh

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ contract AutomataDcapV3AttestationTest is Test, AttestationBase {
function testParsedQuoteBinAttestation() public {
vm.prank(user);
bytes memory v3QuoteBytes = sampleQuote;
V3Struct.ParsedV3QuoteStruct memory v3quote = _testParsedQuoteAttestation(v3QuoteBytes);
V3Struct.ParsedV3QuoteStruct memory v3quote = parsedQuoteAttestation(v3QuoteBytes);
address parsedInstanceAddr =
address(bytes20(Bytes.slice(v3quote.localEnclaveReport.reportData, 0, 20)));
// console.log("[log] parsed instance addr = %s", parsedInstanceAddr);
Expand All @@ -49,7 +49,7 @@ contract AutomataDcapV3AttestationTest is Test, AttestationBase {
string memory v3QuoteB64Str =
"AwACAAAAAAAKAA8Ak5pyM/ecTKmUCg2zlX8GBxLOavHkqB4OzaxCe5m7ApUAAAAACwsQD///AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAADnAAAAAAAAADAx1Y7sROJljY0p6/ptbdwC841C1n7aq7S/qjSGeOa6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdPSuOeKkIHE14ZQJvmEsmUZdpbf5KBZii0O8HZPcA9QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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XpqMENBUVlJS29aSXpqMERBUWNEUWdBRUM2bkV3TURJWVpPai9pUFdzQ3phRUtpNwoxT2lPU0xSRmhXR2pibkJWSmZWbmtZNHUzSWprRFlZTDBNeE80bXFzeVlqbEJhbFRWWXhGUDJzSkJLNXpsS09CCnV6Q0J1REFmQmdOVkhTTUVHREFXZ0JRaVpReldXcDAwaWZPRHRKVlN2MUFiT1NjR3JEQlNCZ05WSFI4RVN6QkoKTUVlZ1JhQkRoa0ZvZEhSd2N6b3ZMMk5sY25ScFptbGpZWFJsY3k1MGNuVnpkR1ZrYzJWeWRtbGpaWE11YVc1MApaV3d1WTI5dEwwbHVkR1ZzVTBkWVVtOXZkRU5CTG1SbGNqQWRCZ05WSFE0RUZnUVVJbVVNMWxxZE5JbnpnN1NWClVyOVFHemtuQnF3d0RnWURWUjBQQVFIL0JBUURBZ0VHTUJJR0ExVWRFd0VCL3dRSU1BWUJBZjhDQVFFd0NnWUkKS29aSXpqMEVBd0lEU1FBd1JnSWhBT1cvNVFrUitTOUNpU0RjTm9vd0x1UFJMc1dHZi9ZaTdHU1g5NEJnd1R3ZwpBaUVBNEowbHJIb01zK1hvNW8vc1g2TzlRV3hIUkF2WlVHT2RSUTdjdnFSWGFxST0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQoA";
bytes memory v3QuoteBytes = Base64.decode(v3QuoteB64Str);
V3Struct.ParsedV3QuoteStruct memory v3quote = _testParsedQuoteAttestation(v3QuoteBytes);
V3Struct.ParsedV3QuoteStruct memory v3quote = parsedQuoteAttestation(v3QuoteBytes);
address parsedInstanceAddr =
address(bytes20(Bytes.slice(v3quote.localEnclaveReport.reportData, 0, 20)));
// console.log("[log] parsed instance addr = %s", parsedInstanceAddr);
Expand All @@ -66,14 +66,4 @@ contract AutomataDcapV3AttestationTest is Test, AttestationBase {
//console.logBytes32(hash);
assertEq(hash, 0xa27c4167ab139dffb020230b2ec856080d0e1af437b3a2c2beea1c9af17469bc);
}

function _testParsedQuoteAttestation(bytes memory v3QuoteBytes)
internal
returns (V3Struct.ParsedV3QuoteStruct memory v3quote)
{
v3quote = ParseV3QuoteBytes(address(pemCertChainLib), v3QuoteBytes);
// console.logBytes(v3quote.localEnclaveReport.reportData);
(bool verified,) = attestation.verifyParsedQuote(v3quote);
assertTrue(verified);
}
}
Loading

0 comments on commit a74d793

Please sign in to comment.