Skip to content

Commit

Permalink
Merge branch 'main' into a7_relayer_watchdog_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey authored Feb 22, 2024
2 parents d4a1937 + 4d2372c commit abef1be
Show file tree
Hide file tree
Showing 18 changed files with 346 additions and 138 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages/branding": "0.3.0",
"packages/bridge-ui": "2.9.0",
"packages/bridge-ui": "2.9.1",
"packages/eventindexer": "0.13.0",
"packages/fork-diff": "0.4.0",
"packages/guardian-prover-health-check": "0.1.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/bridge-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [2.9.1](https://github.com/taikoxyz/taiko-mono/compare/bridge-ui-v2.9.0...bridge-ui-v2.9.1) (2024-02-22)


### Bug Fixes

* **bridge-ui:** add dependency ([#15999](https://github.com/taikoxyz/taiko-mono/issues/15999)) ([14484a0](https://github.com/taikoxyz/taiko-mono/commit/14484a00c1d59332361fba32b74d39db2ae4b864))
* **bridge-ui:** fix wrong balance updates on network switch ([#15980](https://github.com/taikoxyz/taiko-mono/issues/15980)) ([b556e00](https://github.com/taikoxyz/taiko-mono/commit/b556e000b25fc8d5405cba77f3eebb4152dc1497))
* **bridge-ui:** incorrectly detecting bridged tokens ([#16007](https://github.com/taikoxyz/taiko-mono/issues/16007)) ([b151bcb](https://github.com/taikoxyz/taiko-mono/commit/b151bcb2e159ece03da3c2014e35dbbbed7d8410))
* **bridge-ui:** transactions view styling ([#15997](https://github.com/taikoxyz/taiko-mono/issues/15997)) ([620a22d](https://github.com/taikoxyz/taiko-mono/commit/620a22dcb1ce77a9335dff8bbe0546c4c5065b23))
* fix typos in tests and comments ([#15028](https://github.com/taikoxyz/taiko-mono/issues/15028)) ([54bf597](https://github.com/taikoxyz/taiko-mono/commit/54bf597c89a7f22161eeeffd13c20fe0acb4e2d7))

## [2.9.0](https://github.com/taikoxyz/taiko-mono/compare/bridge-ui-v2-v2.8.0...bridge-ui-v2-v2.9.0) (2023-10-18)


Expand Down
7 changes: 4 additions & 3 deletions packages/bridge-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bridge-ui",
"version": "2.9.0",
"version": "2.9.1",
"private": true,
"scripts": {
"dev": "vite dev",
Expand Down Expand Up @@ -61,8 +61,9 @@
"dependencies": {
"@wagmi/connectors": "^4.1.14",
"@wagmi/core": "^2.6.5",
"@walletconnect/ethereum-provider": "^2.11.1",
"@web3modal/wagmi": "^4.0.5",
"@walletconnect/ethereum-provider": "^2.11.2",
"@walletconnect/modal": "^2.6.2",
"@web3modal/wagmi": "^4.0.9",
"@zerodevx/svelte-toast": "^0.9.5",
"axios": "^1.6.7",
"buffer": "^6.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{:else}
<ActionButton
priority="primary"
class="!max-w-[215px] !min-h-[32px] !f-items-center !py-0"
class="!max-w-[215px] !min-h-[32px] !max-h-[48px] !f-items-center !py-0"
loading={web3modalOpen}
on:click={connectWallet}>
<div class="flex items-center body-regular space-x-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import { getTokenAddresses } from '$libs/token/getTokenAddresses';
import { getLogger } from '$libs/util/logger';
import { uid } from '$libs/util/uid';
import { account } from '$stores/account';
import { type Account, account } from '$stores/account';
import { connectedSourceChain } from '$stores/network';
import DialogView from './DialogView.svelte';
Expand Down Expand Up @@ -98,7 +98,10 @@
}
if (tokenInfo.canonical && tokenInfo.bridged) {
// double check we have the correct address for the destination chain and it is not 0x0
if (value?.addresses[destChain.id] !== tokenInfo.canonical?.address) {
if (
value?.addresses[destChain.id] !== tokenInfo.canonical?.address &&
value?.addresses[destChain.id] !== zeroAddress
) {
log('selected token is bridged', value?.addresses[destChain.id]);
$selectedTokenIsBridged = true;
} else {
Expand Down Expand Up @@ -174,10 +177,11 @@
if (srcChain && destChain) updateBalance($account?.address, srcChain.id, destChain.id);
};
const onAccountChange = () => {
const onAccountChange = (newAccount: Account, prevAccount?: Account) => {
const srcChain = $connectedSourceChain;
const destChain = $destNetwork;
if (srcChain && destChain) updateBalance($account?.address, srcChain.id, destChain.id);
if (destChain && srcChain && (newAccount?.chainId === prevAccount?.chainId || !newAccount || !prevAccount))
updateBalance($account?.address, srcChain.id, destChain.id);
};
$: textClass = disabled ? 'text-secondary-content' : 'font-bold ';
Expand Down
41 changes: 21 additions & 20 deletions packages/bridge-ui/src/components/Transactions/Transaction.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,29 @@
<!-- We disable these warnings as we dynamically add the role -->
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="flex text-primary-content md:h-[80px] h-[45px] w-full my-[10px] md:my-[0px]">
<div class="flex items-center text-primary-content md:h-[80px] h-[45px] w-full my-[10px] md:my-[0px]">
{#if isDesktopOrLarger}
{#if loading}
<div class="rounded-[10px] w-[50px] h-[50px] bg-neutral flex items-center justify-center">
<Spinner />
</div>
<div class="f-col text-left space-y-1">
<LoadingText mask="&nbsp;" class="min-w-[50px] max-w-[50px] h-4" />
<LoadingText mask="&nbsp;" class="min-w-[90px] max-w-[90px] h-4" />
<LoadingText mask="&nbsp;" class="min-w-[20px] max-w-[20px] h-4" />
</div>
{:else}
<img alt="nft" src={imgUrl} class="rounded-[10px] min-w-[50px] max-w-[50px] bg-neutral self-center" />
<div class="f-col text-left">
<div class="text-sm">{token?.name ? truncateString(token?.name, 15) : ''}</div>
<div class="text-sm text-secondary-content">
{token?.metadata?.name ? truncateString(token?.metadata?.name, 15) : ''}
<div class="flex md:w-3/12 gap-[8px]">
{#if loading}
<div class="rounded-[10px] w-[50px] h-[50px] bg-neutral flex items-center justify-center">
<Spinner />
</div>
<div class="text-sm text-secondary-content">{token?.tokenId}</div>
</div>
{/if}

<div class="f-col text-left space-y-1">
<LoadingText mask="&nbsp;" class="min-w-[50px] max-w-[50px] h-4" />
<LoadingText mask="&nbsp;" class="min-w-[90px] max-w-[90px] h-4" />
<LoadingText mask="&nbsp;" class="min-w-[20px] max-w-[20px] h-4" />
</div>
{:else}
<img alt="nft" src={imgUrl} class="rounded-[10px] min-w-[50px] max-w-[50px] bg-neutral self-center" />
<div class="f-col text-left">
<div class="text-sm">{token?.name ? truncateString(token?.name, 15) : 'No Token Name'}</div>
<div class="text-sm text-secondary-content">
{token?.metadata?.name ? truncateString(token?.metadata?.name, 15) : ''}
</div>
<div class="text-sm text-secondary-content">{token?.tokenId}</div>
</div>
{/if}
</div>
<div class="w-2/12 py-2 flex flex-row">
<ChainSymbolName chainId={item.srcChainId} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
</svelte:head>

<Overview />
<p>hiya! this is just a fun test, you can ignore it</p>
Binary file not shown.
1 change: 0 additions & 1 deletion packages/protocol/contracts/L1/TaikoData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ library TaikoData {
bytes32 blockHash;
bytes32 stateRoot;
bytes32 graffiti;
bytes32[2] __reserved;
}

/// @dev Struct representing state transition data.
Expand Down
1 change: 0 additions & 1 deletion packages/protocol/contracts/common/EssentialContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ abstract contract EssentialContract is OwnerUUPSUpgradable, AddressResolver {
}

/// @notice Initializes the contract without an address manager.
// solhint-disable-next-line func-name-mixedcase
function __Essential_init() internal virtual {
__Essential_init(address(0));
}
Expand Down
1 change: 1 addition & 0 deletions packages/protocol/contracts/tokenvault/ERC721Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ contract ERC721Vault is BaseNFTVault, IERC721ReceiverUpgradeable {
});
}

/// @inheritdoc IRecallableSender
function onMessageRecalled(
IBridge.Message calldata message,
bytes32 msgHash
Expand Down
9 changes: 9 additions & 0 deletions packages/protocol/script/SetRemoteBridgeSuites.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ contract SetRemoteBridgeSuites is DeployCapability {
address public timelockAddress = vm.envAddress("TIMELOCK_ADDRESS");
address public addressManagerAddress = vm.envAddress("ADDRESS_MANAGER_ADDRESS");
uint256[] public remoteChainIDs = vm.envUint("REMOTE_CHAIN_IDS", ",");
address[] public remoteSignalServices = vm.envAddress("REMOTE_SIGNAL_SERVICES", ",");
address[] public remoteBridges = vm.envAddress("REMOTE_BRIDGES", ",");
address[] public remoteERC20Vaults = vm.envAddress("REMOTE_ERC20_VAULTS", ",");
address[] public remoteERC721Vaults = vm.envAddress("REMOTE_ERC721_VAULTS", ",");
Expand All @@ -32,6 +33,10 @@ contract SetRemoteBridgeSuites is DeployCapability {
require(
remoteChainIDs.length == remoteBridges.length, "invalid remote bridge addresses length"
);
require(
remoteChainIDs.length == remoteSignalServices.length,
"invalid remote SignalService addresses length"
);
require(
remoteChainIDs.length == remoteERC20Vaults.length,
"invalid remote ERC20Vault addresses length"
Expand All @@ -51,13 +56,17 @@ contract SetRemoteBridgeSuites is DeployCapability {
uint64 chainid = uint64(remoteChainIDs[i]);

if (securityCouncilPrivateKey == 0) {
register(addressManagerAddress, "signal_service", remoteSignalServices[i], chainid);
register(addressManagerAddress, "bridge", remoteBridges[i], chainid);
register(addressManagerAddress, "erc20_vault", remoteERC20Vaults[i], chainid);
register(addressManagerAddress, "erc721_vault", remoteERC721Vaults[i], chainid);
register(addressManagerAddress, "erc1155_vault", remoteERC1155Vaults[i], chainid);
continue;
}

registerByTimelock(
addressManagerAddress, "signal_service", remoteSignalServices[i], chainid
);
registerByTimelock(addressManagerAddress, "bridge", remoteBridges[i], chainid);
registerByTimelock(addressManagerAddress, "erc20_vault", remoteERC20Vaults[i], chainid);
registerByTimelock(
Expand Down
3 changes: 1 addition & 2 deletions packages/protocol/test/L1/TaikoL1LibProvingWithTiers.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,7 @@ contract TaikoL1LibProvingWithTiers is TaikoL1TestBase {
parentHash: parentHash,
blockHash: blockHash,
stateRoot: stateRoot,
graffiti: 0x0,
__reserved: [bytes32(0), bytes32(0)]
graffiti: 0x0
});

TaikoData.TierProof memory proof;
Expand Down
3 changes: 1 addition & 2 deletions packages/protocol/test/L1/TaikoL1TestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ abstract contract TaikoL1TestBase is TaikoTest {
parentHash: parentHash,
blockHash: blockHash,
stateRoot: stateRoot,
graffiti: 0x0,
__reserved: [bytes32(0), bytes32(0)]
graffiti: 0x0
});

bytes32 instance =
Expand Down
6 changes: 2 additions & 4 deletions packages/protocol/test/verifiers/GuardianVerifier.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ contract TestGuardianVerifier is TaikoL1TestBase {
parentHash: bytes32(0),
blockHash: bytes32(0),
stateRoot: bytes32(0),
graffiti: bytes32(0),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32(0)
});

// TierProof
Expand Down Expand Up @@ -62,8 +61,7 @@ contract TestGuardianVerifier is TaikoL1TestBase {
parentHash: bytes32(0),
blockHash: bytes32(0),
stateRoot: bytes32(0),
graffiti: bytes32(0),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32(0)
});

// TierProof
Expand Down
33 changes: 11 additions & 22 deletions packages/protocol/test/verifiers/PseZkVerifier.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32(0),
blockHash: bytes32(0),
stateRoot: bytes32(0),
graffiti: bytes32(0),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32(0)
});

// TierProof
Expand Down Expand Up @@ -80,8 +79,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32(0),
blockHash: bytes32(0),
stateRoot: bytes32(0),
graffiti: bytes32(0),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32(0)
});

// TierProof
Expand Down Expand Up @@ -133,8 +131,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32("12"),
blockHash: bytes32("23"),
stateRoot: bytes32("34"),
graffiti: bytes32("1234"),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32("1234")
});

// TierProof
Expand Down Expand Up @@ -172,8 +169,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32("12"),
blockHash: bytes32("23"),
stateRoot: bytes32("34"),
graffiti: bytes32("1234"),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32("1234")
});

// TierProof
Expand Down Expand Up @@ -203,8 +199,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32("12"),
blockHash: bytes32("23"),
stateRoot: bytes32("34"),
graffiti: bytes32("1234"),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32("1234")
});

// TierProof
Expand Down Expand Up @@ -243,8 +238,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32("12"),
blockHash: bytes32("23"),
stateRoot: bytes32("34"),
graffiti: bytes32("1234"),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32("1234")
});

// TierProof
Expand Down Expand Up @@ -282,8 +276,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32("12"),
blockHash: bytes32("23"),
stateRoot: bytes32("34"),
graffiti: bytes32("1234"),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32("1234")
});

// TierProof
Expand Down Expand Up @@ -318,8 +311,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32("12"),
blockHash: bytes32("23"),
stateRoot: bytes32("34"),
graffiti: bytes32("1234"),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32("1234")
});

// TierProof
Expand Down Expand Up @@ -361,8 +353,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32("12"),
blockHash: bytes32("23"),
stateRoot: bytes32("34"),
graffiti: bytes32("1234"),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32("1234")
});

// TierProof
Expand Down Expand Up @@ -404,8 +395,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32("12"),
blockHash: bytes32("23"),
stateRoot: bytes32("34"),
graffiti: bytes32("1234"),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32("1234")
});

// TierProof
Expand Down Expand Up @@ -444,8 +434,7 @@ contract TestPseZkVerifier is TaikoL1TestBase {
parentHash: bytes32("12"),
blockHash: bytes32("23"),
stateRoot: bytes32("34"),
graffiti: bytes32("1234"),
__reserved: [bytes32(0), bytes32(0)]
graffiti: bytes32("1234")
});

// TierProof
Expand Down
Loading

0 comments on commit abef1be

Please sign in to comment.