Skip to content

Commit

Permalink
Merge branch 'main' into major_protocol_upgrade_rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
dionysuzx authored Apr 7, 2023
2 parents b3974ad + 45691b4 commit 624a4b5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
14 changes: 2 additions & 12 deletions packages/bridge-ui/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<script lang="ts">
import { wrap } from 'svelte-spa-router/wrap';
import QueryProvider from './components/providers/QueryProvider.svelte';
import Router from 'svelte-spa-router';
import { configureChains, createClient } from '@wagmi/core';
import { publicProvider } from '@wagmi/core/providers/public';
import { jsonRpcProvider } from '@wagmi/core/providers/jsonRpc';
import { CoinbaseWalletConnector } from '@wagmi/core/connectors/coinbaseWallet';
import { WalletConnectConnector } from '@wagmi/core/connectors/walletConnect';
import { MetaMaskConnector } from '@wagmi/core/connectors/metaMask';
import Home from './pages/home/Home.svelte';
import { setupI18n } from './i18n';
import {
pendingTransactions,
Expand Down Expand Up @@ -37,6 +34,7 @@
import { chains, mainnetWagmiChain, taikoWagmiChain } from './chain/chains';
import { providers } from './provider/providers';
import { RELAYER_URL } from './constants/envVars';
import Router from './components/Router.svelte';
const { chains: wagmiChains, provider } = configureChains(
[mainnetWagmiChain, taikoWagmiChain],
Expand Down Expand Up @@ -182,20 +180,12 @@
});
}
});
const routes = {
'/:tab?': wrap({
component: Home,
props: {},
userData: {},
}),
};
</script>

<QueryProvider>
<main>
<Navbar />
<Router {routes} />
<Router />
</main>
<Toast />
<SwitchEthereumChainModal />
Expand Down
11 changes: 11 additions & 0 deletions packages/bridge-ui/src/components/Router.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
import SvelteRouter from 'svelte-spa-router';
import Home from '../pages/home/Home.svelte';
// TODO: add a NoFound component
const routes = {
'/:tab?': Home,
};
</script>

<SvelteRouter {routes} />
13 changes: 9 additions & 4 deletions packages/bridge-ui/src/components/form/SelectChain.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import { errorToast, successToast } from '../Toast.svelte';
const toggleChains = async () => {
if (!$signer) {
errorToast('Please connect your wallet');
return;
}
try {
const chain = $fromChain === mainnetChain ? taikoChain : mainnetChain;
await switchNetwork({
Expand Down Expand Up @@ -43,10 +48,10 @@
{/if}
</div>

<button
on:click={toggleChains}
class="btn btn-square btn-sm toggle-chain"
disabled={!$signer}><ArrowRight size="16" /></button>
<button on:click={toggleChains} class="btn btn-square btn-sm toggle-chain">
<ArrowRight size="16" />
</button>

<div class="flex items-center w-2/5 justify-center">
{#if $toChain}
<svelte:component this={$toChain.icon} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
On Taiko, the next L2 state is known immediately and deterministically at the time a block is proposed to the TaikoL1 contract. After a block is proposed, a series of checks are done to compute this post-L2 state:

1. Block is proposed by any proposer (permissionlessly).
2. Block level properties are checked validity by TaikoL1 contract ([proposed block intrinsic validity function](./intrinsic-validity-functions#proposed-block-intrinsic-validity-function)).
2. Block level properties' validity is checked by the TaikoL1 contract with the ([proposed block intrinsic validity function](./intrinsic-validity-functions#proposed-block-intrinsic-validity-function)).
3. Proposed block is downloaded by a Taiko node, and the transaction list is parsed over and checked for validity ([transaction list intrinsic validity function](./intrinsic-validity-functions#transaction-list-intrinsic-validity-function)).
- IF every transaction in the list is valid, an ordered subset of the list is created by skipping over transactions which have an invalid nonce or the sender has too little Ether balance to pay for the transaction. This ordered subset is used along with the [anchor transaction](./anchor-transaction) to create a Taiko L2 block.
- IF any transaction in the list is invalid, the block is proven to be invalid.

0 comments on commit 624a4b5

Please sign in to comment.